Compare commits

..

27 commits
old ... master

Author SHA1 Message Date
0a3e474971 Don't use spkg and read this file 2021-07-04 00:56:15 +03:00
Ohio2
9de707fdde spkg change 2021-07-02 03:25:46 +02:00
Ohio2
a0c9a157d8 dot instead of source, source caused problems 2021-07-01 20:38:39 +02:00
Ohio2
d215e11a08 spkg script change 2021-07-01 20:21:00 +02:00
Ohio2
edf3f7dbc8 Manual setup part 2021-07-01 19:21:30 +02:00
Ohio2
2c9d523f9d /bin 2021-07-01 18:38:43 +02:00
Ohio2
06d5c456a9 Setup updated for current sPKG standards 2021-07-01 18:06:28 +02:00
Ohio2
87198c7507 fixed perfix typo 2021-07-01 17:22:19 +02:00
hippoz
21c5eeab32 switch to using package scripts instead of makefiles 2021-07-01 18:18:02 +03:00
Ohio2
79d6b7881b CRITICAL PATCH NO 1000 2021-07-01 01:30:34 +02:00
Ohio2
cf72136072 critical bug 2021-07-01 01:22:09 +02:00
Ohio2
dfe8b548dd Major patch 2021-06-30 23:16:01 +02:00
Ohio2
2355e05562 patch in $source 2021-06-30 22:57:44 +02:00
Ohio2
cd264800cc fix typo 2021-06-30 22:54:50 +02:00
Ohio2
9f617d1280 sPKG via WGET fixed; sources and setup 2021-06-30 22:38:15 +02:00
Ohio2
0e5c0de66a Too much lines for something that just lists packages 2021-06-30 02:25:18 +02:00
Ohio2
2497f084c6 dblist added 2021-06-30 02:18:42 +02:00
d4b8b95c2f little correction 2021-06-30 02:29:11 +03:00
Ohio2
f4a0b92ca0 Caching in the new spkg 2021-06-30 01:25:28 +02:00
Ohio2
0aef560fe8 June 30th manual update 2021-06-30 00:29:43 +02:00
c6f1681cb9 fixed format of v. 2021-06-30 01:27:22 +03:00
hippoz
e8590c3426 bump version and have each package start in its own working directory 2021-06-30 01:26:20 +03:00
Ohio2
4ce26f75e6 etc 2021-06-29 23:19:51 +02:00
4f3c5a6930 add home to os-release 2021-06-29 23:10:54 +03:00
5a6750444e Merge pull request 'format code and split things into their own respective functions' (#6) from hippoz/spkg:master into master
Reviewed-on: #6
2021-06-29 22:56:42 +03:00
Ohio2
b0d9b00fc3 ... 2021-06-29 21:51:11 +02:00
hippoz
8d88abdda7 format code and split things into their own respective functions 2021-06-29 22:35:23 +03:00
4 changed files with 128 additions and 54 deletions

1
README.md Normal file
View file

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

13
man
View file

@ -1,18 +1,19 @@
.\" 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:11: "1" "June 2021" "spkg:11: parse error near `&&'" "User Commands" .TH SPKG "1" "July 2021" "spkg 21.07.01.2a.nr" "User Commands"
.SH NAME .SH NAME
spkg:11: \- manual page for spkg:11: parse error near `&&' spkg \- manual page for spkg 21.07.01.2a.nr
.SH DESCRIPTION .SH DESCRIPTION
\&./spkg:11: parse error near `&&' .IP
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:11: .B spkg
is maintained as a Texinfo manual. If the is maintained as a Texinfo manual. If the
.B info .B info
and and
.B spkg:11: .B spkg
programs are properly installed at your site, the command programs are properly installed at your site, the command
.IP .IP
.B info spkg:11: .B info spkg
.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="" HOME_URL="https://git.hippoz.xyz/duck"
DOCUMENTATION_URL="" DOCUMENTATION_URL=""
SUPPORT_URL="" SUPPORT_URL=""
BUG_REPORT_URL="" BUG_REPORT_URL=""

166
spkg
View file

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