]> git.saurik.com Git - apt.git/commitdiff
merged net-update fixes from apt--mvo
authorMichael Vogt <michael.vogt@ubuntu.com>
Wed, 13 Feb 2008 14:44:01 +0000 (15:44 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Wed, 13 Feb 2008 14:44:01 +0000 (15:44 +0100)
cmdline/apt-key

index 533193901d80499e721c114d7d05c6bc079a6f01..e0c4b5e4854d505b0ea06584415785908e420a56 100755 (executable)
@@ -58,8 +58,19 @@ net_update() {
     if [ ! -d /var/lib/apt/keyrings ]; then
        mkdir -p /var/lib/apt/keyrings
     fi
+    keyring=/var/lib/apt/keyrings/$(basename $ARCHIVE_KEYRING)
+    old_mtime=0
+    if [ -e $keyring ]; then
+       old_mtime=$(stat -c %Y $keyring)
+    fi
     (cd  /var/lib/apt/keyrings; wget -q -N $ARCHIVE_KEYRING_URI)
-    add_keys_with_verify_against_master_keyring /var/lib/apt/keyrings/$(basename $ARCHIVE_KEYRING) $MASTER_KEYRING
+    if [ ! -e $keyring ]; then
+       return
+    fi
+    new_mtime=$(stat -c %Y $keyring)
+    if [ $new_mtime -ne $old_mtime ]; then
+       add_keys_with_verify_against_master_keyring $keyring $MASTER_KEYRING
+    fi
 }
 
 update() {