Compare commits

..

No commits in common. "master" and "ut.beta" have entirely different histories.

4 changed files with 55 additions and 128 deletions

View file

@ -1 +0,0 @@
As of yesterday, sPKG via wget is comndomned to use until cancellation (Presumably never)

13
man
View file

@ -1,19 +1,18 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.3.
.TH SPKG "1" "July 2021" "spkg 21.07.01.2a.nr" "User Commands" .TH SPKG:11: "1" "June 2021" "spkg:11: parse error near `&&'" "User Commands"
.SH NAME .SH NAME
spkg \- manual page for spkg 21.07.01.2a.nr spkg:11: \- manual page for spkg:11: parse error near `&&'
.SH DESCRIPTION .SH DESCRIPTION
.IP \&./spkg:11: parse error near `&&'
How to use: install to install, update to update, list to list, remove to remove.
.SH "SEE ALSO" .SH "SEE ALSO"
The full documentation for The full documentation for
.B spkg .B spkg:11:
is maintained as a Texinfo manual. If the is maintained as a Texinfo manual. If the
.B info .B info
and and
.B spkg .B spkg:11:
programs are properly installed at your site, the command programs are properly installed at your site, the command
.IP .IP
.B info spkg .B info spkg:11:
.PP .PP
should give you access to the complete manual. should give you access to the complete manual.

View file

@ -3,7 +3,7 @@ PRETTY_NAME="Duck Linux Beta"
ID=dlb ID=dlb
BUILD_ID=rolling BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209" ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://git.hippoz.xyz/duck" HOME_URL=""
DOCUMENTATION_URL="" DOCUMENTATION_URL=""
SUPPORT_URL="" SUPPORT_URL=""
BUG_REPORT_URL="" BUG_REPORT_URL=""

167
spkg
View file

@ -1,120 +1,49 @@
#!/bin/sh #!/usr/bin/env sh
source="https://git.hippoz.xyz/duck/repo/raw/branch/master" # NOTE: sPKG via wget CAN'T RUN WITHOUT MAKE!!!
tmpdir="/tmp" source=git.hippoz.xyz/spkg/repos
setup() { # THIS IS UT.BETA
prefix=$1 case ${1} in
mkdir "${prefix}"/bin #setup does the important shit like, copy spkg and chmod it, install osrel to etc.
cp ./spkg "${prefix}"/bin/spkg setup) cp ./spkg /usr/bin/spkg && chmod +x /usr/bin/spkg && mkdir /etc/ && mv os-release /etc/ ;;
chmod +x "${prefix}"/bin/spkg #remove, just well, uninstalls and removes from cache.
mkdir "${prefix}"/etc/ remove) for fname in $@
mv os-release "${prefix}"/etc/ do
mkdir "${prefix}"/var pushd && cd /usr/src/${2} && make uninstall && cd .. && rm -rf ${2} && sed "s/${2}//" && popd && done ;;
mkdir "${prefix}"/var/cache #install is complicated, root dir just changes the root dir, first install gets the make file that's requested, prepares, makes, installs
mkdir "${prefix}"/usr/ #and saves to cache.
mkdir "${prefix}"/usr/share install) case ${2} in
mkdir "${prefix}"/usr/share/man --root-dir=) for fname in $@
mkdir "${prefix}"/usr/share/man/man1 "${prefix}"/usr/share/man/man2 "${prefix}"/usr/share/man/man3 "${prefix}"/usr/share/man/man4 "${prefix}"/usr/share/man/man5 "${prefix}"/usr/share/man/man6 "${prefix}"/usr/share/man/man7 "${prefix}"/usr/share/man/man8 "${prefix}"/usr/share/man/man9 do
install -Dm644 ./man /usr/share/man1/spkg.1 pushd && mkdir ${4}/usr/src/${3} 2>/dev/null && wget $source/${3}/Makefile ${4}/usr/src/${3}/Makefile && cd ${4}/usr/src/${3} && make prepare && make && make install && cat ${3} > ${4}/var/cache/spkg.cache && ${3} --version && popd && done || echo 'Invalid package.' && popd ;;
} *) for fname in $@
removepkg() { do
pkgname=$1 pushd && mkdir /usr/src/${3} 2>/dev/null && wget $source/${3}/Makefile /usr/src/${3}/Makefile && cd /usr/src/${3} && make prepare && make && make install && cat ${3} > /var/cache/spkg.cache && popd && done || echo 'Invalid package.' && popd ;;
prefix=$2 esac ;;
cd /usr/src/"${pkgname}" || exit 2 cache) case ${2} in
{ #cache clean rm and save are easy thus won't wase time for them
. ./PACKAGE clean) rm -rf /usr/src/* ;;
"pkg_uninstall" "${prefix}" rm) rm -rf /usr/src/${3} ;;
} save) case ${3} in
sed "s/${pkgname} ${pkg_ver}//" "${prefix}"/var/cache/spkg.cache to) cp /usr/src/ ${4} ;;
} *) 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 ;;
instpkg() { esac ;;
pkgname=$1 #database lookup local just greps cache
prefix=$2 # on the other hand, query is complicated, does the same thing though.
mkdir -p "${tmpdir}"/spkg/work/"${1}"-work/ #but for online cache.
cd "${tmpdir}"/spkg/work/"${1}"-work/ || exit 2 database) case ${3} in
mkdir -p "${prefix}"/usr/src/"${pkgname}" lookup) case ${4} in
wget -O "${prefix}"/usr/src/"${pkgname}" "${source}"/"${pkgname}"/PACKAGE local) grep $@ /var/cache/spkg.cache ;;
cd "${prefix}"/usr/src/"${pkgname}" || exit 2 query) wget $source/spkg.cache /tmp/spkg/web.spkg.cache && grep ${5} /tmp/spkg/web.spkg.cache && rm /tmp/spkg/cache || mkdir 2>/dev/null /tmp/spkg && wget $source/spkg.cache /tmp/spkg/ && grep ${5} /tmp/spkg/web.spkg.cache && rm /tmp/spkg/cache;;
export PREFIX="${prefix}" esac ;;
export PKGNAME="${pkgname}" esac ;;
{ esac ;;
. ./PACKAGE #update is really complicated. you must know that it compares local and repo version of the package
"pkg_install" "${prefix}" update) for fname in $@
} do
sed a\ "${pkgname} ${pkg_ver}" "${prefix}"/var/cache/spkg.cache > "${prefix}"/var/cache/spkg.cache 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 && cat ${2} > /var/cache/spkg.cache && ${2} --version > /var/cache/spkg.cache && popd && done ;;
} --help) echo 'sPKG via WGET, to cache, just type in sudo spkg cache save.
update() { to install, just type in sudo spkg install.
pkgname=$1 to update, just type in sudo spkg update.
prefix=$2 to setup (IMPORTANT!!!), just type in sudo spkg setup' ;;
version1=$(grep "${pkgname}" /var/cache/spkg.cache) --version) echo 'beta 21.06.29.2a.ut' ;;
version2=$(wget "${source}"/spkg.cache /tmp/spkg/web.spkg.cache && grep "${pkgname}" /tmp/spkg/web.spkg.cache )
if [ "$version1" = "${version2}" ]; then
echo 'Up to date.'
else
instpkg "${pkgname}" "${prefix}"
fi
}
dbquery() {
pkgname=$1
wget "${source}"/spkg.cache /tmp/spkg/web.spkg.cache
grep "${pkgname}" /tmp/spkg/web.spkg.cache
rm /tmp/spkg/cache || mkdir 2>/dev/null /tmp/spkg
}
dblocal() {
pkgname=$1
grep "${pkgname}" /var/cache/spkg.cache
}
dblist() {
cat /var/cache/spkg.cache
}
usage() {
echo ' How to use: install to install, update to update, list to list, remove to remove. '
}
version() {
echo "spkg 21.07.02.1a"
}
case "${1}" in
setup)
case "${2}" in
--root-dir) setup "${3}" ;;
*) setup "/" ;;
esac ;;
remove)
case "${2}" in
--root-dir) removepkg "${3}" "${4}" ;;
*) removepkg "${3}" "/" ;;
esac ;;
install)
case "${2}" in
--root-dir) instpkg "${4}" "${3}" ;;
*) instpkg "${3}" "/" ;;
esac ;;
cache)
case "${2}" in
clean)
rm -rf /usr/src/* ;;
rm)
rm -rf /usr/src/"${3}" ;;
save)
case ${3} in
to) cp -rv /usr/src/* "${4}"/ ;;
esac ;;
database)
case "${3}" in
lookup)
case "${4}" in
local)
dblocal "${5}" ;;
query)
dbquery "${5}" ;;
esac;;
esac ;;
esac ;;
list)
dblist ;;
update)
update "${2}" ;;
--help)
usage ;;
--version)
version ;;
esac esac