code overhaul, manual page, and plans for this to become alnux default

This commit is contained in:
Ohio2 2021-04-04 17:38:38 +02:00
parent 62304ea878
commit 3cdbc8e423
2 changed files with 33 additions and 10 deletions

18
man Normal file
View file

@ -0,0 +1,18 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.2.
.TH NOT "1" "April 2021" "not done yet lol" "User Commands"
.SH NAME
not \- manual page for not done yet lol
.SH DESCRIPTION
sPKG via WGET, to cache, just type in (doas or sudo) spkg cache save
.SH "SEE ALSO"
The full documentation for
.B not
is maintained as a Texinfo manual. If the
.B info
and
.B not
programs are properly installed at your site, the command
.IP
.B info not
.PP
should give you access to the complete manual.

25
spkg Normal file → Executable file
View file

@ -1,24 +1,29 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#sPKG via wget #sPKG via wget
#fuck spaghetti code #fuck spaghetti code
#mkay #mkay. gonna do a massive code overhaul!
source=git.hippoz.xyz/spkg/repo source=git.hippoz.xyz/spkg/repo
case ${1} in case ${1} in
remove) dirstack=$(pwd) && cd /usr/src/${2} && make uninstall && popd ;; remove) pushd && cd /usr/src/${2} && make uninstall && popd ;;
install) case ${2} in install) case ${2} in
--root-dir=) dirstack=$(pwd) && mkdir -P /usr/src/${2} && wget $source/${2}/Makefile /usr/src/${2}/Makefile && cd /usr/src/${2} && make prepare && PREFIX=${3} make && make install && cat ${2} > /var/cache/spkg.cache && popd || echo 'Invalid package.' && popd ;; --root-dir=) pushd && mkdir /usr/src/${2} 2>/dev/null && wget $source/${2}/Makefile /usr/src/${2}/Makefile && cd /usr/src/${2} && make prepare && PREFIX=${3} make && make install && cat ${2} > /var/cache/spkg.cache && popd || echo 'Invalid package.' && popd ;;
*) dirstack=$(pwd) && mkdir -P /usr/src/${2} && wget $source/${2}/Makefile /usr/src/${2}/Makefile && cd /usr/src/${2} && make prepare && make && make install && cat ${2} > /var/cache/spkg.cache && popd || echo 'Invalid package.' && popd ;; *) 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 && cat ${2} > /var/cache/spkg.cache && popd || echo 'Invalid package.' && popd ;;
cache) case ${2} in esac ;;
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 ${3} 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 /etc/spkg 2>/dev/null && mkdir /etc/spkg/cache 2>/dev/null && cp /usr/src/ /etc/spkg/cache ;;
esac ;; esac ;;
database) case ${3} in database) case ${3} in
lookup) case ${4} in lookup) case ${4} in
local) grep ${5} /var/cache/spkg.cache ;; local) grep ${5} /var/cache/spkg.cache ;;
query) wget $source/spkg.cache /tmp/spkg/ && grep ${5} /tmp/spkg/web.spkg.cache && rm /tmp/spkg/cache || mkdir -P /tmp/spkg ;; query) wget $source/spkg.cache /tmp/spkg/ && grep ${5} /tmp/spkg/web.spkg.cache && rm /tmp/spkg/cache || mkdir -P /tmp/spkg && wget $source/spkg.cache /tmp/spkg/ && grep ${5} /tmp/spkg/web.spkg.cache && rm /tmp/spkg/cache;;
esac esac ;;
esac esac ;;
esac esac ;;
--help) echo 'sPKG via WGET, to cache, just type in (doas or sudo) spkg cache save' ;;
--version) echo 'not done yet lol' ;;
esac