]>
git.saurik.com Git - apt.git/blob - vendor/getinfo
2 # small helper to extract information form *.ent files
4 BASEDIR
="$(readlink -f "$(dirname $0)")"
7 # search for an exact match to use the correct sources.list example
9 DISTROS="$(find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2)"
10 for DISTRO in $DISTROS; do
11 if dpkg-vendor --is $DISTRO; then
17 # if we haven't found a specific, look for a deriving
18 # we do ubuntu and debian last as those are the biggest families
19 # and would therefore potentially 'shadow' smaller families
20 # (especially debian as it sorts quiet early)
21 for DISTRO in $DISTROS; do
22 if [ "$DISTRO" = 'debian' -o "$DISTRO" = 'ubuntu' ]; then continue; fi
23 if dpkg-vendor --derives-from $DISTRO; then
29 # Do the ubuntu/debian dance we talked about
30 if dpkg-vendor --derives-from ubuntu; then
39 if [ "$1" = "--vendor" ]; then
43 CURRENT_VENDOR=$(getcurrent)
45 INFO="$(readlink -f "${BASEDIR}/$CURRENT_VENDOR/apt-vendor.ent")"
46 VERBATIM="${BASEDIR}/..
/doc
/apt
-verbatim.ent
"
48 if [ -z "$INFO" ] || [ ! -e "$INFO" ]; then
49 echo >&2 'The current vendor is not valid or not chosen by the buildsystem yet.'
54 awk "/<!ENTITY
$1/ {f
=NR
} f
&& NR
-1==f
{ print
; exit 0 }" RS='"' "${2:-$INFO}"
58 local FIELD="$(getrawfield "$@")"
64 debian-stable-codename|debian-oldstable-codename|debian-testing-codename|ubuntu-codename)
65 getrawfield "$1" "$VERBATIM"
67 sourceslist-list-format|keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri|current-codename)
68 exec $0 --vendor $CURRENT_VENDOR 'vendor
' "$@"
74 getfield "$2" "$VERBATIM"
80 echo >&2 "Unknown data field $1 requested"