From: Shane Jaroch Date: Thu, 8 Jan 2026 21:16:39 +0000 (-0500) Subject: more, clean up shellcheck? X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=48a4ac0a78ffcab07c4d09d7cd297ed47f67bfcb;p=gamesguru%2Fgit-remote-gcrypt.git more, clean up shellcheck? --- diff --git a/git-remote-gcrypt b/git-remote-gcrypt index 6d63e2c..0fd697b 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -32,6 +32,7 @@ Packkey_bytes=63 # nbr random bytes for packfile keys, any >= 256 bit is ok Hashtype=SHA256 # SHA512 SHA384 SHA256 SHA224 supported. VERSION="@@DEV_VERSION@@" + # Help function show_help() { cat >&2 <&2; exit 1; } - FORCE_CLEAN=yes - ;; - -*) echo "Unknown option for $cmd: $1" >&2; exit 1 ;; + --force|-f) FORCE_CLEAN=yes ;; + -*) echo "Unknown option: $1" >&2; exit 1 ;; *) if [ -z "$URL" ]; then URL="$1" else - echo "Error: Multiple URLs/remotes provided to $cmd" >&2 + echo "Error: Multiple URLs/remotes provided to clean" >&2 exit 1 fi ;; @@ -211,7 +212,6 @@ Recipients= # xfeed: The most basic output function puts $1 into the stdin of $2..$# xfeed() { - # shellcheck disable=SC3043 local input_="" input_=$1; shift "$@" <&1 && status_=$(rungpg --status-fd 3 -q -d 3>&1 1>&4 || { @@ -638,7 +629,6 @@ genkey() gpg_hash() { - # shellcheck disable=SC3043 local hash_="" hash_=$(rungpg --with-colons --print-md "$1" | tr A-F a-f) hash_=${hash_#:*:} @@ -684,7 +674,7 @@ make_new_repo() # $1 return var for goodsig match, $2 return var for signers text read_config() { - # shellcheck disable=SC3043,SC2034 + # shellcheck disable=SC2034 local recp_="" r_tail="" r_keyinfo="" r_keyfpr="" gpg_list="" cap_="" conf_part="" good_sig="" signers_="" Conf_signkey=$(git config --get "remote.$NAME.gcrypt-signingkey" '.+' || git config --path user.signingkey || :) @@ -761,7 +751,6 @@ read_config() ensure_connected() { - # shellcheck disable=SC3043 local manifest_="" r_repoid="" r_name="" url_frag="" r_sigmatch="" r_signers="" \ tmp_manifest="" tmp_stderr="" early_bad_files="" @@ -777,7 +766,6 @@ ensure_connected() if [ "$NAME" != "gcrypt-clean" ] && ! isurl sftp "$URL" && ! isurl rsync "$URL" && ! isurl rclone "$URL" && ! islocalrepo "$URL"; then # It's a gitception backend - do early safety check # Fetch the default branch to see what files exist - # shellcheck disable=SC3043 local check_files="" git fetch --quiet "$URL" "refs/heads/master:refs/gcrypt/safety-check" 2>/dev/null || git fetch --quiet "$URL" "refs/heads/main:refs/gcrypt/safety-check" 2>/dev/null || true @@ -909,7 +897,6 @@ ensure_connected() # $3 the key get_verify_decrypt_pack() { - # shellcheck disable=SC3043 local rcv_id="" tmp_encrypted="" tmp_encrypted="$Tempdir/packF" GET "$URL" "$2" "$tmp_encrypted" && @@ -924,7 +911,6 @@ get_verify_decrypt_pack() # $1 destdir (when repack, else "") get_pack_files() { - # shellcheck disable=SC3043 local pack_id="" r_pack_key_line="" htype_="" pack_="" key_="" while IFS=': ' read -r _ htype_ pack_ # <