From 25933cbc85e54f31f0a1cc039e376d5e5acb0124 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 9 Aug 2024 23:31:36 -0300 Subject: [PATCH] Sync with recent sourcezap changes --- libexec/portzap/commands/portzap-checkout | 2 +- libexec/portzap/commands/portzap-clone | 2 +- libexec/portzap/commands/portzap-pull | 2 +- libexec/portzap/commands/portzap-sh | 9 +++++---- libexec/portzap/utils/isportzap-member | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libexec/portzap/commands/portzap-checkout b/libexec/portzap/commands/portzap-checkout index 4604e2e..5531ad7 100644 --- a/libexec/portzap/commands/portzap-checkout +++ b/libexec/portzap/commands/portzap-checkout @@ -21,7 +21,7 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi -if ! "${libexec}"/utils/isportzap-member > /dev/null 2>&1; then +if ! "${libexec}"/utils/isportzap-member; then printerr "$(id -un) is not a member of _portzap" exit 1 fi diff --git a/libexec/portzap/commands/portzap-clone b/libexec/portzap/commands/portzap-clone index 40becb6..4001542 100755 --- a/libexec/portzap/commands/portzap-clone +++ b/libexec/portzap/commands/portzap-clone @@ -22,7 +22,7 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi -if ! "${libexec}"/utils/isportzap-member > /dev/null 2>&1; then +if ! "${libexec}"/utils/isportzap-member; then printerr "$(id -un) is not a member of _portzap" exit 1 fi diff --git a/libexec/portzap/commands/portzap-pull b/libexec/portzap/commands/portzap-pull index 44c73f3..2acdfc2 100755 --- a/libexec/portzap/commands/portzap-pull +++ b/libexec/portzap/commands/portzap-pull @@ -20,7 +20,7 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi -if ! "${libexec}"/utils/isportzap-member > /dev/null 2>&1; then +if ! "${libexec}"/utils/isportzap-member; then printerr "$(id -un) is not a member of _portzap" exit 1 fi diff --git a/libexec/portzap/commands/portzap-sh b/libexec/portzap/commands/portzap-sh index e30001c..1767347 100644 --- a/libexec/portzap/commands/portzap-sh +++ b/libexec/portzap/commands/portzap-sh @@ -20,15 +20,16 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi +if ! "${libexec}"/utils/isportzap-member; then + printerr "$(id -un) is not a member of _portzap" + exit 1 +fi + if [ ! -e "${gitdir}" ]; then printerr "try 'portzap clone' instead" exit 1 fi -if ! "${libexec}"/utils/isportzap-member; then - printerr "$(id -un) is not a member of _portzap" -fi - cd "${gitdir}" doas -n \ -u "${user}" \ diff --git a/libexec/portzap/utils/isportzap-member b/libexec/portzap/utils/isportzap-member index ff4d9c4..593e357 100644 --- a/libexec/portzap/utils/isportzap-member +++ b/libexec/portzap/utils/isportzap-member @@ -5,5 +5,5 @@ set -e # main group="_portzap" mygroups=$(id -Gn | tr ' ' '\n') -echo "${mygroups}" | grep -e "^${group}$" +echo "${mygroups}" | grep -e "^${group}$" > /dev/null 2>&1 exit "${?}"