diff options
author | Julian Andres Klode <jak@debian.org> | 2016-08-07 03:32:12 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-08-10 16:10:41 +0200 |
commit | 79635b696b1ca113d0527d4afe96908eada5cc48 (patch) | |
tree | 38aab916ee5e22e6a83b766a8cb710dfc67b2566 | |
parent | 1ed5f97952d3a7b722bd73992c92769ec0efc67c (diff) | |
download | apt-79635b696b1ca113d0527d4afe96908eada5cc48.tar.gz |
vendor/getinfo: Accept --vendor VENDOR option
This can be used to query a field for a specific vendor. It
also speeds up things a lot if we can cache the current vendor
in cmake and pass it to further getinfo invocations.
Gbp-Dch: ignore
-rwxr-xr-x | vendor/getinfo | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vendor/getinfo b/vendor/getinfo index 504b086af..37e0c1480 100755 --- a/vendor/getinfo +++ b/vendor/getinfo @@ -36,7 +36,13 @@ getcurrent() { return 0 } -INFO="$(readlink -f "${BASEDIR}/$(getcurrent)/apt-vendor.ent")" +if [ "$1" = "--vendor" ]; then + CURRENT_VENDOR="$2" + shift 2 +else + CURRENT_VENDOR=$(getcurrent) +fi +INFO="$(readlink -f "${BASEDIR}/$CURRENT_VENDOR/apt-vendor.ent")" VERBATIM="${BASEDIR}/../doc/apt-verbatim.ent" if [ -z "$INFO" ] || [ ! -e "$INFO" ]; then @@ -59,7 +65,7 @@ debian-stable-codename|debian-oldstable-codename|debian-testing-codename|ubuntu- getrawfield "$1" "$VERBATIM" ;; sourceslist-list-format|keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri|current-codename) - exec $0 'vendor' "$@" + exec $0 --vendor $CURRENT_VENDOR 'vendor' "$@" ;; vendor) getfield "$2" @@ -67,9 +73,8 @@ vendor) verbatim) getfield "$2" "$VERBATIM" ;; - current) - getcurrent + echo $CURRENT_VENDOR ;; *) echo >&2 "Unknown data field $1 requested" |