From cd1e504643ea56fc8dd73fd01835c9a253a801cf Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 19 Jul 2024 03:44:16 -0300 Subject: [PATCH] Fix a few bugs --- libexec/sourcezap/commands/sourcezap-install | 4 +--- libexec/sourcezap/functions.sh | 4 ++-- libexec/sourcezap/utils/git/get-changed-files | 2 +- libexec/sourcezap/utils/git/get-removed-files | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libexec/sourcezap/commands/sourcezap-install b/libexec/sourcezap/commands/sourcezap-install index e82de5e..8b1d23a 100755 --- a/libexec/sourcezap/commands/sourcezap-install +++ b/libexec/sourcezap/commands/sourcezap-install @@ -72,16 +72,14 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi -set -x umask ${mode} cd "${gitdir}" run_install "-d" "${installdir}" chmod ${mode} "${installdir}" -set +x if [ -e "${revfile}" ]; then perform_update else perform_install fi -"${libexec}"/utils/git/run rev-parse HEAD > "${revfile}" +git rev-parse HEAD > "${revfile}" printok "install complete" diff --git a/libexec/sourcezap/functions.sh b/libexec/sourcezap/functions.sh index a2ad165..e14a696 100644 --- a/libexec/sourcezap/functions.sh +++ b/libexec/sourcezap/functions.sh @@ -7,10 +7,10 @@ git() printok() { - printf "ok: %s\n" "${msg}" > /dev/stdout + printf "ok: %s\n" "${@}" > /dev/stdout } printerr() { - printf "error: %s\n" "${err}" > /dev/stderr + printf "error: %s\n" "${@}" > /dev/stderr } diff --git a/libexec/sourcezap/utils/git/get-changed-files b/libexec/sourcezap/utils/git/get-changed-files index ebbcc13..8d6785d 100755 --- a/libexec/sourcezap/utils/git/get-changed-files +++ b/libexec/sourcezap/utils/git/get-changed-files @@ -3,7 +3,7 @@ set -e ## # variables -localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)} +localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)} libexec="${localbase}"/libexec/sourcezap gitdir=$1 commit=$2 diff --git a/libexec/sourcezap/utils/git/get-removed-files b/libexec/sourcezap/utils/git/get-removed-files index ff5695e..51ba723 100755 --- a/libexec/sourcezap/utils/git/get-removed-files +++ b/libexec/sourcezap/utils/git/get-removed-files @@ -3,7 +3,7 @@ set -e ## # variables -localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)} +localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../../..)} libexec="${localbase}"/libexec/sourcezap gitdir=$1 commit=$2