From 5b363c9eacacd7f5cb6a3b77309aabb5eaae704e Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 20 Apr 2024 00:28:10 -0300 Subject: [PATCH] Alternate mode syntax --- libexec/portzap/portzap-clone | 4 ++-- libexec/portzap/portzap-install | 6 +++--- libexec/portzap/portzap-pull | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libexec/portzap/portzap-clone b/libexec/portzap/portzap-clone index 1b384c6..6d1dc24 100755 --- a/libexec/portzap/portzap-clone +++ b/libexec/portzap/portzap-clone @@ -8,7 +8,7 @@ git="${localbase}"/bin/git giturl=$1 gitdir=$2 branch=$3 -mode="u=rwX,g=rwX,o=" +mode="ug=rwX,o=" ## # main @@ -24,7 +24,7 @@ if [ -e "${gitdir}/.git" ]; then fi set -x -umask "${mode}" +umask ${mode} doas -u _portzap "${git}" clone "${giturl}" "${gitdir}" cd "${gitdir}" doas -u _portzap "${git}" config core.filemode off diff --git a/libexec/portzap/portzap-install b/libexec/portzap/portzap-install index b8da101..16da5f2 100755 --- a/libexec/portzap/portzap-install +++ b/libexec/portzap/portzap-install @@ -6,7 +6,7 @@ gitdir=$1 installdir=$2 revfile=$3 libexec=$(dirname "$0") -mode="u=rwX,g=rwX,o=" +mode="ug=rwX,o=" ## # functions @@ -64,11 +64,11 @@ if [ "$(id -u)" != "0" ]; then fi set -x -umask "${mode}" +umask ${mode} cd "${gitdir}" set +x run_install "-d" "${installdir}" -chmod u=rwx,g=rwx,o= "${installdir}" +chmod ${mode} "${installdir}" if [ -e "${revfile}" ]; then perform_update else diff --git a/libexec/portzap/portzap-pull b/libexec/portzap/portzap-pull index 0e8b1bb..6438c94 100755 --- a/libexec/portzap/portzap-pull +++ b/libexec/portzap/portzap-pull @@ -7,7 +7,7 @@ localbase=${LOCALBASE:-/usr/local} git="${localbase}"/bin/git gitdir=$1 branch=$2 -mode="u=rwX,g=rwX,o=" +mode="ug=rwX,o=" owner="_portzap:_portzap" ## @@ -43,7 +43,7 @@ if [ ! -e "${gitdir}/.git" ]; then exit 1 fi -umask "${mode}" +umask ${mode} doas -u root /bin/chmod -R "${mode}" "${gitdir}/.git" doas -u root /usr/sbin/chown -R "${owner}" "${gitdir}/.git" cd "${gitdir}"