is anybody reading these

This commit is contained in:
Maksymilian Sęk 2021-01-28 14:13:40 +01:00
parent 9231a4c60b
commit be369765f7

22
spkg
View file

@ -1,14 +1,24 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#sPKG via wget #sPKG via wget
source=mirror #fuck spaghetti code
source=git.hippoz.xyz/spkg/repo
case $1 in case $1 in
remove) dirstack=$(pwd) && cd /usr/src/$2 && make uninstall ;; remove) dirstack=$(pwd) && cd /usr/src/$2 && make uninstall && rm ./$2 && popd ;;
install) dirstack=$(pwd) && wget $source/$2.tar.zst /usr/src/$2.tar.zst && rm ./$2.tar.zst && cd /usr/src && untar -x --zstd $2 && cd $2 && make && make install && cat $2 > /var/cache/spkg.cache && popd || echo 'Invalid package.' && popd ;; install) case $2 in
--root-dir=) dirstack=$(pwd) && wget $source/$2 /usr/src/$2 && cd /usr/src && untar -x --zstd $2 && cd $2 && make && make install && cat $2 > /var/cache/spkg.cache && && rm ./$2.tar.zst && popd || echo 'Invalid package.' && popd ;;
*) dirstack=$(pwd) && wget $source/$2 /usr/src/$2 && cd /usr/src && untar -x --zstd $2 && cd $2 && make && make install && cat $2 > /var/cache/spkg.cache && && rm ./$2.tar.zst && popd || echo 'Invalid package.' && popd ;;
cache) case $2 in cache) case $2 in
rm) rm -rf /usr/src/* ;; rm) rm -rf /usr/src/* ;;
clean) rm -rf /usr/src/$3 ;; clean) rm -rf /usr/src/$3 ;;
save) case $4 in save) case $3 in
to) cp /usr/src/ $4 to) cp /usr/src/ $4 ;;
*) cp /usr/src/ /etc/spkg/cache || mkdir -P /etc/spkg && mkdir -P /etc/spkg/cache && echo 'Made a caching directory, rerun:' && echo 'spkg cache' *) cp /usr/src/ /etc/spkg/cache || mkdir -P /etc/spkg && mkdir -P /etc/spkg/cache && echo 'Made a caching directory, rerun:' && echo 'spkg cache' ;;
esac ;; esac ;;
database) case $3 in
lookup) case $4 in
local) grep $5 /var/cache/spkg.cache ;;
query) wget $source/web.spkg.cache /tmp/spkg/ && grep $5 /tmp/spkg/web.spkg.cache && rm /tmp/spkg/cache || mkdir -P /tmp/spkg ;;
esac
esac
esac esac