diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-13 11:37:01 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-13 15:52:55 +0200 |
commit | 4a0936126de486fc1899466efff8403504aa0a17 (patch) | |
tree | f7cbc04363bae1083864c9afc7abac3a7c5614a8 | |
parent | 77c328703c2582fcc93227e716401652b230b934 (diff) | |
download | alpine-conf-4a0936126de486fc1899466efff8403504aa0a17.zip |
setup-apkcache: fix usage and -h option
-rw-r--r-- | setup-apkcache.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/setup-apkcache.in b/setup-apkcache.in index fbe8541..5e40c21 100644 --- a/setup-apkcache.in +++ b/setup-apkcache.in @@ -1,8 +1,8 @@ #!/bin/sh PREFIX=@PREFIX@ - -. "$PREFIX/lib/libalpine.sh" +: ${LIBDIR=$PREFIX/lib} +. "$LIBDIR/libalpine.sh" usage() { cat <<-__EOF__ @@ -15,7 +15,7 @@ usage() { options: -h Show this help __EOF__ - exit 1 + exit $1 } is_mounted() { @@ -112,7 +112,8 @@ apk_cache_help() { while getopts "h" opt; do case $opt in - h) usage;; + h) usage 0;; + '?') usage "1" >&2;; esac done shift $(( $OPTIND - 1 )) |