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
source="https://git.hippoz.xyz/spkg/repo"
tmpdir="/tmp"
setup() {
cp ./spkg /usr/bin/spkg
chmod +x /usr/bin/spkg
@ -10,14 +9,14 @@ setup() {
}
removepkg() {
pkgname=$1
cd /usr/src/"${pkgname}" || exit 2
make uninstall
}
instpkg() {
pkgname=$1
prefix=$2
mkdir -p "${tmpdir}"/spkg/work/"${1}"-work/
cd "${tmpdir}"/spkg/work/"${1}"-work/ || exit 2
mkdir -p "${prefix}"/usr/src/"${pkgname}"
wget "${source}"/"${pkgname}"/Makefile "${prefix}"/usr/src/"${pkgname}"/Makefile
cd "${prefix}"/usr/src/"${pkgname}" || exit 2
@ -32,7 +31,6 @@ instpkg() {
update() {
pkgname=$1
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
@ -43,14 +41,12 @@ update() {
}
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
}
usage() {
@ -60,7 +56,7 @@ usage() {
to setup (IMPORTANT!!!), just type in sudo spkg setup'
}
version() {
echo "beta 21.06.29.1a"
echo "spkg 30.1a"
}
case "${1}" in
setup)