diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2008-02-13 15:22:30 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2008-02-13 15:22:30 +0100 |
commit | 93886541b35bf232e2a03eca01e39ddea2137111 (patch) | |
tree | 7a90794e6353a2db06c1cc27c4b20deae428bb0f /cmdline/apt-key | |
parent | 3916f941154e6b98f69730688efeb8df217ce44a (diff) |
cmdline/apt-key: make net-update more robust
Diffstat (limited to 'cmdline/apt-key')
-rwxr-xr-x | cmdline/apt-key | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cmdline/apt-key b/cmdline/apt-key index bbf3a7697..b65c01f71 100755 --- a/cmdline/apt-key +++ b/cmdline/apt-key @@ -61,8 +61,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() { |