This commit is contained in:
Ohio2 2021-06-29 17:04:04 +02:00
parent 6c96f158fc
commit b477c096ae

4
spkg
View file

@ -7,7 +7,7 @@ case ${1} in
#remove, just well, uninstalls and removes from cache.
remove) for fname in $@
do
pushd && cd /usr/src/${2} && sed "s/${2} $({2} --version)//" && make uninstall && cd .. && rm -rf ${2} && popd && done ;;
pushd && cd /usr/src/${2} && sed "s/${2} $(${2} --version)//" && make uninstall && cd .. && rm -rf ${2} && popd && done ;;
#install is complicated, root dir just changes the root dir, first install gets the make file that's requested, prepares, makes, installs
#and saves to cache.
install) case ${2} in
@ -39,7 +39,7 @@ case ${1} in
#update is really complicated. you must know that it compares local and repo version of the package
update) for fname in $@
do
version1=$(grep ${2} /var/cache/spkg.cache) && version2=$(wget $source/spkg.cache /tmp/spkg/web.spkg.cache && grep ${2} /tmp/spkg/web.spkg.cache ) && [ version1 = version2] && echo 'Up to date.' || pushd && mkdir /usr/src/${2} 2>/dev/null && wget $source/${2}/Makefile /usr/src/${2}/Makefile && cd /usr/src/${2} && make prepare && make && make install && sed "s/${2} $({2} --version)//" && sed a\ "${3} $(${3} --version)" /var/cache/spkg.cache > /var/cache/spkg.cache && popd && done ;;
version1=$(grep ${2} /var/cache/spkg.cache) && version2=$(wget $source/spkg.cache /tmp/spkg/web.spkg.cache && grep ${2} /tmp/spkg/web.spkg.cache ) && [ version1 = version2] && echo 'Up to date.' || pushd && mkdir /usr/src/${2} 2>/dev/null && wget $source/${2}/Makefile /usr/src/${2}/Makefile && cd /usr/src/${2} && make prepare && make && make install && sed "s/${2} $({$2} --version)//" && sed a\ "${3} $(${3} --version)" /var/cache/spkg.cache > /var/cache/spkg.cache && popd && done ;;
--help) echo 'sPKG via WGET, to cache, just type in sudo spkg cache save.
to install, just type in sudo spkg install.
to update, just type in sudo spkg update.