From 0b0bd6711d7f46e018e03028e3818f8eeb414814 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 10 Sep 2009 12:16:47 -0500 Subject: [PATCH] no need to look at this cache file any more Signed-off-by: Dustin Kirkland --- bin/updates_available | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/bin/updates_available b/bin/updates_available index d864b891..b84559af 100755 --- a/bin/updates_available +++ b/bin/updates_available @@ -76,21 +76,17 @@ update_cache() { PKG="byobu" -# The following is somewhat Ubuntu and Debian specific. +# The following is somewhat Ubuntu and Debian specific (apt). # I would welcome contributions from other distros to make this # more distro-agnostic. -cache="/var/lib/update-notifier/updates-available" mycache="/var/run/screen/S-$USER/$PKG.updates-available" -# If global cache is newer than mycache, overwrite mycache -[ $cache -nt $mycache ] && cp -a "$cache" "$mycache" - -# If apt is newer than mycache, background an update now -[ "/var/lib/apt" -nt "$mycache" ] && update_cache "$mycache" - -# If mycache is present, use it -if [ -r $mycache ]; then +if [ "/var/lib/apt" -nt "$mycache" ]; then + # If apt is newer than mycache, background an update now + update_cache "$mycache" +elif [ -r $mycache ]; then + # If mycache is present, use it print_updates `grep "^[0-9]" $mycache | sed "s/ .*$//"` else # Otherwise, background an update now