summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:18:12 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:52:55 +0200
commit0427f00b7e8af1d79c6d1922ea0d04c01ee6614e (patch)
tree295b5d8a013b115329d93f4cdeef1c83cc68efbb
parent9f8f85fac8f1681d3367b96734b9595584955570 (diff)
downloadalpine-conf-0427f00b7e8af1d79c6d1922ea0d04c01ee6614e.zip
setup-apkrepos: fix -h usage help text
-rw-r--r--setup-apkrepos.in11
1 files changed, 6 insertions, 5 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index 1c295a7..732463f 100644
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -2,9 +2,10 @@
PROGRAM=setup-apkrepos
PREFIX=@PREFIX@
-MIRRORS_URL=https://mirrors.alpinelinux.org/mirrors.txt
+: ${LIBDIR=$PREFIX/lib}
+. "$LIBDIR/libalpine.sh"
-. $PREFIX/lib/libalpine.sh
+MIRRORS_URL=https://mirrors.alpinelinux.org/mirrors.txt
if [ "$ROOT" != "/" ]; then
apk_root_opt="--root $ROOT"
@@ -149,8 +150,7 @@ usage() {
-r Add a random mirror and do not prompt
-1 Add first mirror on the list (normally a CDN)
__EOF__
- exit 1
-
+ exit $1
}
community_prefix="# "
@@ -162,8 +162,9 @@ while getopts "c1fhr" opt; do
c) community_prefix="";;
f) add_fastest=true;;
1) add_first=true;;
- h) usage;;
+ h) usage 0;;
r) add_random=true;;
+ '?') usage "1" >&2;;
esac
done
shift $(($OPTIND - 1))