From e8590c34261c93155d3806742ad559579566fb0e Mon Sep 17 00:00:00 2001 From: hippoz Date: Wed, 30 Jun 2021 01:26:20 +0300 Subject: [PATCH] bump version and have each package start in its own working directory --- spkg | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spkg b/spkg index 81fa500..889d290 100755 --- a/spkg +++ b/spkg @@ -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)