Quellcode durchsuchen

apt-key errors out nicely if wget is not installed (Closes: #545754)

David Kalnischkies vor 16 Jahren
Ursprung
Commit
6355a02fbf
2 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 8 1
      cmdline/apt-key
  2. 2 0
      debian/changelog

+ 8 - 1
cmdline/apt-key

@@ -56,7 +56,14 @@ add_keys_with_verify_against_master_keyring() {
 # (otherwise it does not make sense from a security POV)
 # (otherwise it does not make sense from a security POV)
 net_update() {
 net_update() {
     if [ -z "$ARCHIVE_KEYRING_URI" ]; then
     if [ -z "$ARCHIVE_KEYRING_URI" ]; then
-	echo "ERROR: no location for the archive-keyring given" 
+	echo "ERROR: no location for the archive-keyring given"
+	exit 1
+    fi
+    # in theory we would need to depend on wget for this, but this feature
+    # isn't useable in debian anyway as we have no keyring uri nor a master key
+    if ! which wget >/dev/null 2>&1; then
+	echo "ERROR: an installed wget is required for a network-based update"
+	exit 1
     fi
     fi
     if [ ! -d /var/lib/apt/keyrings ]; then
     if [ ! -d /var/lib/apt/keyrings ]; then
 	mkdir -p /var/lib/apt/keyrings
 	mkdir -p /var/lib/apt/keyrings

+ 2 - 0
debian/changelog

@@ -39,6 +39,8 @@ apt (0.7.26) UNRELEASED; urgency=low
   * share/*-archive.gpg:
   * share/*-archive.gpg:
     - remove the horrible outdated files. We already depend on
     - remove the horrible outdated files. We already depend on
       the keyring so we don't need to ship our own version
       the keyring so we don't need to ship our own version
+  * cmdline/apt-key:
+    - errors out if wget is not installed (Closes: #545754)
 
 
  -- Michael Vogt <mvo@debian.org>  Thu, 10 Dec 2009 22:02:38 +0100
  -- Michael Vogt <mvo@debian.org>  Thu, 10 Dec 2009 22:02:38 +0100