Browse Source

generate apt-key script with vendor info about keys

The apt-key script uses quiet a few keyring files for operation which
are specific to the distribution it is build on and is hence one of the
most patched parts – even if it is not that often used anymore now that
a fragment directory for trusted.gpg exists.
tags/devuan/2.0.1+devuan1
David Kalnischkies 7 years ago
parent
commit
5b2c6ddcc0
6 changed files with 19 additions and 6 deletions
  1. +1
    -0
      .gitignore
  2. +5
    -5
      cmdline/apt-key.in
  3. +8
    -0
      cmdline/makefile
  4. +2
    -0
      vendor/debian/apt-vendor.ent
  5. +1
    -1
      vendor/getinfo
  6. +2
    -0
      vendor/ubuntu/apt-vendor.ent

+ 1
- 0
.gitignore View File

@@ -31,6 +31,7 @@
/debian/apt-transport-https/

# generated from *.in files
/cmdline/apt-key
/doc/apt-vendor.ent
/doc/examples/sources.list
/debian/libapt-pkg*.install


cmdline/apt-key → cmdline/apt-key.in View File

@@ -25,13 +25,13 @@ GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"

GPG="$GPG_CMD"

MASTER_KEYRING=''
MASTER_KEYRING='&keyring-master-filename;'
eval $(apt-config shell MASTER_KEYRING APT::Key::MasterKeyring)
ARCHIVE_KEYRING='/usr/share/keyrings/debian-archive-keyring.gpg'
ARCHIVE_KEYRING='&keyring-filename;'
eval $(apt-config shell ARCHIVE_KEYRING APT::Key::ArchiveKeyring)
REMOVED_KEYS='/usr/share/keyrings/debian-archive-removed-keys.gpg'
REMOVED_KEYS='&keyring-removed-filename;'
eval $(apt-config shell REMOVED_KEYS APT::Key::RemovedKeys)
ARCHIVE_KEYRING_URI=''
ARCHIVE_KEYRING_URI='&keyring-uri;'
eval $(apt-config shell ARCHIVE_KEYRING_URI APT::Key::ArchiveKeyringURI)
TMP_KEYRING=/var/lib/apt/keyrings/maybe-import-keyring.gpg

@@ -142,7 +142,7 @@ net_update() {
update() {
if [ ! -f $ARCHIVE_KEYRING ]; then
echo >&2 "ERROR: Can't find the archive-keyring"
echo >&2 "Is the debian-archive-keyring package installed?"
echo >&2 "Is the &keyring-package; package installed?"
exit 1
fi
requires_root

+ 8
- 0
cmdline/makefile View File

@@ -41,6 +41,14 @@ SOURCE = apt-cdrom.cc
include $(PROGRAM_H)

# The apt-key program
apt-key: apt-key.in
sed -e "s#&keyring-filename;#$(shell ../vendor/getinfo keyring-filename)#" \
-e "s#&keyring-removed-filename;#$(shell ../vendor/getinfo keyring-removed-filename)#" \
-e "s#&keyring-master-filename;#$(shell ../vendor/getinfo keyring-master-filename)#" \
-e "s#&keyring-uri;#$(shell ../vendor/getinfo keyring-uri)#" \
-e "s#&keyring-package;#$(shell ../vendor/getinfo keyring-package)#" $< > $@
chmod 755 $@

SOURCE=apt-key
TO=$(BIN)
TARGET=program


+ 2
- 0
vendor/debian/apt-vendor.ent View File

@@ -3,3 +3,5 @@
<!ENTITY keyring-package "<package>debian-archive-keyring</package>">
<!ENTITY keyring-filename "<filename>/usr/share/keyrings/debian-archive-keyring.gpg</filename>">
<!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename>">
<!ENTITY keyring-master-filename "">
<!ENTITY keyring-uri "">

+ 1
- 1
vendor/getinfo View File

@@ -26,7 +26,7 @@ debian-stable-codename)
ubuntu-codename)
getrawfield 'stable-codename' "${BASEDIR}/../doc/apt-verbatim.ent"
;;
keyring-package)
keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri)
getfield "$1"
;;
*)


+ 2
- 0
vendor/ubuntu/apt-vendor.ent View File

@@ -3,3 +3,5 @@
<!ENTITY keyring-package "<package>ubuntu-keyring</package>">
<!ENTITY keyring-filename "<filename>/usr/share/keyrings/ubuntu-archive-keyring.gpg</filename>">
<!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/ubuntu-archive-removed-keys.gpg</filename>">
<!ENTITY keyring-master-filename "/usr/share/keyrings/ubuntu-master-keyring.gpg">
<!ENTITY keyring-uri "http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg">

Loading…
Cancel
Save