From a37d6d40f6df0a6595a0df5820a166bc35cf651c Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Wed, 22 Mar 2023 15:45:26 -0600 Subject: [PATCH] lxc-debian: fix getopt parsing of --mirror When the --keyring option was added, the `,` between `mirror:` and `keyring:` was omitted in the long option string passed to `getopt`. This causes `--mirror` to be parsed as `--mirror:keyring`, matching `*) break ;;` and prematurely terminating option parsing. To avoid this, add the missing `,`. Also order `keyring:` before `mirror:` to preserve lexical ordering of long options. Fixes: eebcd76feb47 ("lxc-debian: allow using a custom keyring") Signed-off-by: Kevin Locke --- templates/lxc-debian.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 060e4dd..7c75e95 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -715,7 +715,7 @@ EOF return 0 } -options=$(getopt -o hp:n:a:r:cI:FS: -l arch:,auth-key:,clean,help,enable-non-free,mirror:keyring:,name:,packages:,path:,release:,rootfs:,security-mirror:,interpreter-path:,flush-cache -- "$@") +options=$(getopt -o hp:n:a:r:cI:FS: -l arch:,auth-key:,clean,help,enable-non-free,keyring:,mirror:,name:,packages:,path:,release:,rootfs:,security-mirror:,interpreter-path:,flush-cache -- "$@") if [ $? -ne 0 ]; then usage "$(basename "$0")" exit 1