From c18c579c6da9f6efd910b38528cdd436a1243329 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 19 Jan 2009 21:46:19 -0600 Subject: [PATCH] allow for faster startup by skipping apt-check on initial startup --- bin/updates-available | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/updates-available b/bin/updates-available index 8b455450..ff6c1975 100755 --- a/bin/updates-available +++ b/bin/updates-available @@ -33,12 +33,17 @@ if [ -r $mycache -a -O $mycache ]; then u=`grep -m 1 "^[0-9]" $mycache | sed "s/\s.*$//"` print_updates $u fi +else + # Otherwise, let's quickly clear the cache, and then recreate it with + # a really old timestamp (so that it get's updated on next run) + rm -f $mycache + touch -t 197001010000 $mycache + exit 0 fi # If apt-check binary exists, use it if [ -x /usr/lib/update-notifier/apt-check ]; then - u=`/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$//"` - echo "$u" > $mycache + u=`/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;.*$//" | tee $mycache` print_updates $u fi