mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
fixes for Bug #332890
This is the screen-profiles half of the problem. Prefer /var/run/updates-available over local cache, if it has been touched more recently. We also need apt-get/dpkg to update /var/run/updates-available upon completion
This commit is contained in:
parent
5877db7f1c
commit
aed6f0d1e8
2 changed files with 13 additions and 7 deletions
|
@ -40,10 +40,15 @@ print_updates() {
|
||||||
|
|
||||||
cache=/var/run/updates-available
|
cache=/var/run/updates-available
|
||||||
mycache=$HOME/.screenrc-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=
|
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+.
|
# 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.*$//"`
|
u=`grep -m 1 "^[0-9]" $cache | sed "s/\s.*$//"`
|
||||||
s=`grep -m 2 "^[0-9]" $cache | tail -n 1 | sed "s/\s.*$//"`
|
s=`grep -m 2 "^[0-9]" $cache | tail -n 1 | sed "s/\s.*$//"`
|
||||||
print_updates $u $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,
|
# If the user's updates-available cache is present, and less than an hour old,
|
||||||
# use it. (The "hour" part should be configurable)
|
# use it. (The "hour" part should be configurable)
|
||||||
if [ -r $mycache -a -O $mycache ]; then
|
if [ -r $mycache -a -O $mycache ]; then
|
||||||
now=`date +%s`
|
diff=`expr $now - $mycache_timestamp`
|
||||||
timestamp=`stat -c "%Y" $mycache`
|
|
||||||
diff=`expr $now - $timestamp`
|
|
||||||
if [ $diff -lt $EXPIRATION ]; then
|
if [ $diff -lt $EXPIRATION ]; then
|
||||||
print_updates `cat $mycache`
|
print_updates `cat $mycache`
|
||||||
fi
|
fi
|
||||||
|
|
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,4 +1,4 @@
|
||||||
screen-profiles (1.27) UNRELEASED; urgency=low
|
screen-profiles (1.27-0ubuntu1) jaunty; urgency=low
|
||||||
|
|
||||||
* Fix for LP: #333189:
|
* Fix for LP: #333189:
|
||||||
- keybindings/common: add profile reload shortcut, "ctrl-a ~"
|
- keybindings/common: add profile reload shortcut, "ctrl-a ~"
|
||||||
|
@ -7,8 +7,11 @@ screen-profiles (1.27) UNRELEASED; urgency=low
|
||||||
* Fix for LP: #333180
|
* Fix for LP: #333180
|
||||||
- screen-profiles: add toggle for auto launch of welcome
|
- screen-profiles: add toggle for auto launch of welcome
|
||||||
- po/*: updated for the new messages
|
- 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 <kirkland@ubuntu.com> Mon, 23 Feb 2009 14:25:02 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 23 Feb 2009 14:44:05 -0600
|
||||||
|
|
||||||
screen-profiles (1.26-0ubuntu1) jaunty; urgency=low
|
screen-profiles (1.26-0ubuntu1) jaunty; urgency=low
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue