diff --git a/bin/updates-available b/bin/updates-available index 8b3aaaca..c5280d12 100755 --- a/bin/updates-available +++ b/bin/updates-available @@ -40,10 +40,15 @@ print_updates() { cache=/var/run/updates-available mycache=$HOME/.screenrc-updates-available +now=`date +%s` +cache_timestamp=`stat -c "%Y" $cache 2>/dev/null || echo 0` +mycache_timestamp=`stat -c "%Y" $mycache 2>/dev/null || echo 0` +diff=`expr $now - $cache_timestamp` u= -# If global updates-available cache is present, use it. +# If global updates-available cache is present, and newer than mycache, and +# within expiration, use it. # Only available in Jaunty+. -if [ -r $cache ]; then +if [ -r $cache -a $cache_timestamp -gt $mycache_timestamp -a $diff -lt $EXPIRATION ]; then u=`grep -m 1 "^[0-9]" $cache | sed "s/\s.*$//"` s=`grep -m 2 "^[0-9]" $cache | tail -n 1 | sed "s/\s.*$//"` print_updates $u $s @@ -52,9 +57,7 @@ fi # If the user's updates-available cache is present, and less than an hour old, # use it. (The "hour" part should be configurable) if [ -r $mycache -a -O $mycache ]; then - now=`date +%s` - timestamp=`stat -c "%Y" $mycache` - diff=`expr $now - $timestamp` + diff=`expr $now - $mycache_timestamp` if [ $diff -lt $EXPIRATION ]; then print_updates `cat $mycache` fi diff --git a/debian/changelog b/debian/changelog index 85bdb606..b6e15edd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -screen-profiles (1.27) UNRELEASED; urgency=low +screen-profiles (1.27-0ubuntu1) jaunty; urgency=low * Fix for LP: #333189: - keybindings/common: add profile reload shortcut, "ctrl-a ~" @@ -7,8 +7,11 @@ screen-profiles (1.27) UNRELEASED; urgency=low * Fix for LP: #333180 - screen-profiles: add toggle for auto launch of welcome - po/*: updated for the new messages + * Fix for LP: #332890 + - bin/updates-available: prefer /var/run/updates-available over + ~/.screenrc-updates-available, if touched more recently - -- Dustin Kirkland Mon, 23 Feb 2009 14:25:02 -0600 + -- Dustin Kirkland Mon, 23 Feb 2009 14:44:05 -0600 screen-profiles (1.26-0ubuntu1) jaunty; urgency=low