]> git.saurik.com Git - apt.git/blobdiff - vendor/getinfo
document which keyring formats are supported by apt-key
[apt.git] / vendor / getinfo
index 4f94d7c425c802d329db7a9c845256220f728f5e..37eb74cef629b906edd129c905f55e90bb5543a7 100755 (executable)
@@ -6,7 +6,7 @@ BASEDIR="$(readlink -f "$(dirname $0)")"
 getcurrent() {
        # search for an exact match to use the correct sources.list example
        cd $BASEDIR
-       DISTROS="$(find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2)"
+       DISTROS="$(find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2)"
        for DISTRO in $DISTROS; do
                if dpkg-vendor --is $DISTRO; then
                        echo $DISTRO
@@ -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
@@ -58,8 +64,8 @@ case "$1" in
 debian-stable-codename|debian-oldstable-codename|debian-testing-codename|ubuntu-codename)
        getrawfield "$1" "$VERBATIM"
        ;;
-keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri|current-codename)
-       exec $0 'vendor' "$@"
+sourceslist-list-format|keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri|current-codename)
+       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"