From b83c0257aa06c2ce63d289d42091f61a4865f7ea Mon Sep 17 00:00:00 2001 From: memdmp Date: Sun, 5 Jan 2025 05:03:26 +0100 Subject: fix: check for package existence --- pkg | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkg b/pkg index 492b7cc..72cb5aa 100755 --- a/pkg +++ b/pkg @@ -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 \x1b[0m" 1>&2; exit 1; + echo -e "\x1b[0;91mSyntax: $BIN \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 ! [[ -f "target/$REPO/"*"/$PKG"*".apk" ]]; 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 -- cgit v1.2.3 From 617d93582704fab32603c562eb31a3fa0ac7275d Mon Sep 17 00:00:00 2001 From: memdmp Date: Sun, 5 Jan 2025 05:06:52 +0100 Subject: feat: remind users to remove the shit from their rc --- src/memdmp/zsh-zuwu/APKBUILD | 2 +- src/memdmp/zsh-zuwu/zsh-zuwu.post-deinstall | 2 ++ src/memdmp/zsh-zuwu/zsh-zuwu.post-install | 0 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 src/memdmp/zsh-zuwu/zsh-zuwu.post-deinstall mode change 100644 => 100755 src/memdmp/zsh-zuwu/zsh-zuwu.post-install 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 old mode 100644 new mode 100755 -- cgit v1.2.3 From cf9705cdd1d4e8f66586c5e5858e6a6e3dc5791f Mon Sep 17 00:00:00 2001 From: memdmp Date: Sun, 5 Jan 2025 05:06:59 +0100 Subject: fix: use ls --- pkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg b/pkg index 72cb5aa..a09fee4 100755 --- a/pkg +++ b/pkg @@ -12,7 +12,7 @@ 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 ! [[ -f "target/$REPO/"*"/$PKG"*".apk" ]]; then +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 -- cgit v1.2.3 From 5d3c79c33ad63db1b93d56d89fdd487f3046eb84 Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 22 Jan 2025 17:05:39 +0100 Subject: feat: env script for ensuring we set build env correctly --- env | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 env diff --git a/env b/env new file mode 100755 index 0000000..8ef8942 --- /dev/null +++ b/env @@ -0,0 +1,8 @@ +#!/usr/bin/env zsh +export APORTSDIR="$(pwd)/src" +if [[ "$ZSH_EVAL_CONTEXT" =~ :file$ ]]; then + # Being sourced, continue as-is +else + # Spawn a zsh session + exec zsh +fi -- cgit v1.2.3 From 3aeb4028d977a0879d8f9c99d2cb72460a968dac Mon Sep 17 00:00:00 2001 From: memdmp Date: Sat, 1 Mar 2025 01:57:11 +0100 Subject: memdmp/zsh-zuwu: upgrade to 0.3.0 --- src/memdmp/zsh-zuwu/APKBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memdmp/zsh-zuwu/APKBUILD b/src/memdmp/zsh-zuwu/APKBUILD index 2f05dcf..bf52783 100644 --- a/src/memdmp/zsh-zuwu/APKBUILD +++ b/src/memdmp/zsh-zuwu/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: memdmp _pkgname="zuwu" pkgname="zsh-$_pkgname" -pkgver=0.0.0 +pkgver=0.3.0 pkgrel=0 pkgdesc="Opinionated ZSH \"Microframework\" to give a baseline usable experience" url="https://git.estrogen.zone/zuwu.git/" @@ -27,5 +27,5 @@ package() { # TODO: write examples :3 sha512sums=" -96097849fc5f4e9c4bf399009411610c71c2baaec7900540d64444c26472f8c86ac3c6b8c4e5b886534bea99b1e505819c0128457b497fe98ddeed84b1c6ef45 zuwu-0.0.0.tar.lz +03331bd523e2e6c1ca79c8e59a4c052884fa08f584440fecedafee5a28623c8161d1a7358fb5a03455b70384aa63cab327c32f7c0bf67570346298a357e2c0ff zuwu-0.3.0.tar.lz " -- cgit v1.2.3