From 52eb094aa26254c4e659959d62d2ffca2374f508 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Sat, 17 Dec 2022 18:43:13 +0000 Subject: [PATCH] Fix repo-add Commit 4f43ce3e4a7829cf9c7f8b28925ddb5a1013ce19 broke repo-add by switching to parseopts without accounting for the added "--". This caused the dbname to always be read as "--". Accounts for "--" and makes repo-add respect "--" as end of opts. --- scripts/repo-add.sh.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 62010ddc..5e51a4c5 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -611,7 +611,7 @@ unset OPT_SHORT OPT_LONG OPTRET declare -a args # parse arguments -while (( $# )); do +while true; do case $1 in -q|--quiet) QUIET=1;; -n|--new) ONLYADDNEW=1;; @@ -634,13 +634,16 @@ while (( $# )); do --include-sigs) INCLUDE_SIGS=1 ;; - *) - args+=("$1") + --) + shift + break ;; esac shift done +args=("$@") + # check if messages are to be printed using color if [[ -t 2 && $USE_COLOR != "n" ]]; then colorize