1
0
mirror of https://github.com/lxc/lxc-templates.git synced 2025-06-23 17:44:45 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Stéphane Graber
96c78bebf5
Merge pull request #56 from kevinoid/debian-getopt-mirror
lxc-debian: fix getopt parsing of --mirror
2023-04-14 01:22:19 -04:00
Kevin Locke
a37d6d40f6 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 <kevin@kevinlocke.name>
2023-03-22 15:45:26 -06:00

View File

@ -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