bump version and have each package start in its own working directory

This commit is contained in:
hippoz 2021-06-30 01:26:20 +03:00
parent 4ce26f75e6
commit e8590c3426

12
spkg
View file

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
source="https://git.hippoz.xyz/spkg/repo" source="https://git.hippoz.xyz/spkg/repo"
tmpdir="/tmp"
setup() { setup() {
cp ./spkg /usr/bin/spkg cp ./spkg /usr/bin/spkg
chmod +x /usr/bin/spkg chmod +x /usr/bin/spkg
@ -10,14 +9,14 @@ setup() {
} }
removepkg() { removepkg() {
pkgname=$1 pkgname=$1
cd /usr/src/"${pkgname}" || exit 2 cd /usr/src/"${pkgname}" || exit 2
make uninstall make uninstall
} }
instpkg() { instpkg() {
pkgname=$1 pkgname=$1
prefix=$2 prefix=$2
mkdir -p "${tmpdir}"/spkg/work/"${1}"-work/
cd "${tmpdir}"/spkg/work/"${1}"-work/ || exit 2
mkdir -p "${prefix}"/usr/src/"${pkgname}" mkdir -p "${prefix}"/usr/src/"${pkgname}"
wget "${source}"/"${pkgname}"/Makefile "${prefix}"/usr/src/"${pkgname}"/Makefile wget "${source}"/"${pkgname}"/Makefile "${prefix}"/usr/src/"${pkgname}"/Makefile
cd "${prefix}"/usr/src/"${pkgname}" || exit 2 cd "${prefix}"/usr/src/"${pkgname}" || exit 2
@ -32,7 +31,6 @@ instpkg() {
update() { update() {
pkgname=$1 pkgname=$1
prefix=$2 prefix=$2
version1=$(grep "${pkgname}" /var/cache/spkg.cache) version1=$(grep "${pkgname}" /var/cache/spkg.cache)
version2=$(wget "${source}"/spkg.cache /tmp/spkg/web.spkg.cache && grep "${pkgname}" /tmp/spkg/web.spkg.cache ) version2=$(wget "${source}"/spkg.cache /tmp/spkg/web.spkg.cache && grep "${pkgname}" /tmp/spkg/web.spkg.cache )
if [ "$version1" = "${version2}" ]; then if [ "$version1" = "${version2}" ]; then
@ -43,14 +41,12 @@ update() {
} }
dbquery() { dbquery() {
pkgname=$1 pkgname=$1
wget "${source}"/spkg.cache /tmp/spkg/web.spkg.cache wget "${source}"/spkg.cache /tmp/spkg/web.spkg.cache
grep "${pkgname}" /tmp/spkg/web.spkg.cache grep "${pkgname}" /tmp/spkg/web.spkg.cache
rm /tmp/spkg/cache || mkdir 2>/dev/null /tmp/spkg rm /tmp/spkg/cache || mkdir 2>/dev/null /tmp/spkg
} }
dblocal() { dblocal() {
pkgname=$1 pkgname=$1
grep "${pkgname}" /var/cache/spkg.cache grep "${pkgname}" /var/cache/spkg.cache
} }
usage() { usage() {
@ -60,7 +56,7 @@ usage() {
to setup (IMPORTANT!!!), just type in sudo spkg setup' to setup (IMPORTANT!!!), just type in sudo spkg setup'
} }
version() { version() {
echo "beta 21.06.29.1a" echo "spkg 30.1a"
} }
case "${1}" in case "${1}" in
setup) setup)