diff options
-rwxr-xr-x | pkg | 13 | ||||
-rw-r--r-- | src/memdmp/zsh-zuwu/APKBUILD | 2 | ||||
-rwxr-xr-x | src/memdmp/zsh-zuwu/zsh-zuwu.post-deinstall | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | src/memdmp/zsh-zuwu/zsh-zuwu.post-install | 0 |
4 files changed, 13 insertions, 4 deletions
@@ -1,20 +1,27 @@ #!/usr/bin/env zsh set -e +BIN="$0" OPERATION="$1" REPO="$2" PKG="$3" syntax() { - echo -e "\x1b[0;31mSyntax: $0 <add|del|readd> <REPONAME> <PKG>\x1b[0m" 1>&2; exit 1; + echo -e "\x1b[0;91mSyntax: $BIN <add|del|readd> <REPONAME> <PKG>\x1b[0m" 1>&2; exit 1; } if [[ "$REPO" == "" ]]; then syntax; fi if [[ "$PKG" == "" ]]; then syntax; fi +if ! [[ -f "src/$REPO/$PKG/APKBUILD" ]]; then + echo -e "\x1b[0;91mThe package $PKG does not exist in $REPO in the current source tree.\x1b[0m" 1>&2; exit 1; +fi +if ! ls "target/$REPO/"*"/$PKG"*".apk" > /dev/null 2>/dev/null; then + echo -e "\x1b[0;91mThe package $PKG does not exist in $REPO in the current target, yet does exist in the source tree. Try building it.\x1b[0m" 1>&2; exit 1; +fi if [[ "$OPERATION" == "readd" ]]; then sudo apk del "$PKG"; - sudo apk add --repository "$(busybox dirname "$(busybox realpath "$0")")/target/$REPO" "$PKG"; + sudo apk add --repository "$(busybox dirname "$(busybox realpath "$BIN")")/target/$REPO" "$PKG"; elif [[ "$OPERATION" == "del" ]]; then sudo apk del "$PKG"; elif [[ "$OPERATION" == "add" ]]; then - sudo apk add --repository "$(busybox dirname "$(busybox realpath "$0")")/target/$REPO" "$PKG"; + sudo apk add --repository "$(busybox dirname "$(busybox realpath "$BIN")")/target/$REPO" "$PKG"; else syntax; fi
\ No newline at end of file diff --git a/src/memdmp/zsh-zuwu/APKBUILD b/src/memdmp/zsh-zuwu/APKBUILD index 9ce6024..2f05dcf 100644 --- a/src/memdmp/zsh-zuwu/APKBUILD +++ b/src/memdmp/zsh-zuwu/APKBUILD @@ -9,7 +9,7 @@ arch="all" license="MIT" depends="zsh" makedepends="lzip" -install="$pkgname.post-install" +install="$pkgname.post-install $pkgname.post-deinstall" subpackages="" source="https://git.estrogen.zone/zuwu.git/snapshot/$_pkgname-$pkgver.tar.lz" builddir="$srcdir/$_pkgname-$pkgver" diff --git a/src/memdmp/zsh-zuwu/zsh-zuwu.post-deinstall b/src/memdmp/zsh-zuwu/zsh-zuwu.post-deinstall new file mode 100755 index 0000000..a7488a9 --- /dev/null +++ b/src/memdmp/zsh-zuwu/zsh-zuwu.post-deinstall @@ -0,0 +1,2 @@ +#!/usr/bin/env zsh +echo -e "\x1b[0;32mEach user that had zuwu installed should clean up their \x1b[0;34m\$HOME/.zshrc\x1b[0;32m.\nIf they don't, everything will still continue to work, it's just good practice to remove it :3\x1b[0m" diff --git a/src/memdmp/zsh-zuwu/zsh-zuwu.post-install b/src/memdmp/zsh-zuwu/zsh-zuwu.post-install index a4cf43d..a4cf43d 100644..100755 --- a/src/memdmp/zsh-zuwu/zsh-zuwu.post-install +++ b/src/memdmp/zsh-zuwu/zsh-zuwu.post-install |