mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
updating the cache, handle it more efficiently
This commit is contained in:
parent
59230ae65e
commit
a552ddd1bd
2 changed files with 6 additions and 12 deletions
|
@ -48,9 +48,6 @@ print_updates() {
|
|||
|
||||
update_cache() {
|
||||
mycache=$1
|
||||
# Clear the cache, and background an immediate update.
|
||||
rm -f $mycache
|
||||
touch -t 197001010000 $mycache
|
||||
# Now we actually have to do hard computational work to calculate updates.
|
||||
# Let's try to be "nice" about it:
|
||||
renice 10 $$ >/dev/null 2>&1 || true
|
||||
|
@ -83,14 +80,11 @@ PKG="byobu"
|
|||
[ -d "/var/run/screen/S-$USER" ] && DIR="/var/run/screen/S-$USER" || DIR="$HOME/.byobu"
|
||||
mycache="$DIR/$PKG.updates-available"
|
||||
|
||||
# If mycache is present, use it
|
||||
[ -r $mycache ] && print_updates `grep "^[0-9]" $mycache | sed "s/ .*$//"`
|
||||
|
||||
# Update the cache if necessary
|
||||
if [ "/var/lib/apt" -nt "$mycache" ] || [ "/var/lib/apt/lists" -nt "$mycache" ]; then
|
||||
# If apt is newer than mycache, background an update now
|
||||
update_cache "$mycache"
|
||||
fi
|
||||
if [ -r $mycache ]; then
|
||||
# If mycache is present, use it
|
||||
print_updates `grep "^[0-9]" $mycache | sed "s/ .*$//"`
|
||||
else
|
||||
# Otherwise, background an update now
|
||||
update_cache "$mycache"
|
||||
fi
|
||||
|
|
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -4,12 +4,12 @@ byobu (2.33) unreleased; urgency=low
|
|||
temp_f, updates_available, wifi: make byobu status scripts friendlier
|
||||
for busybox environments (tested on the Palm Pre), LP: #430096
|
||||
* bin/updates_available: print the current cache even if we're
|
||||
updating the cache
|
||||
updating the cache, handle it more efficiently
|
||||
* po/byoub-*.po: rename to just *.po, fix translations location, LP: #430095
|
||||
* debian/control: drop update-notifier-common and lsb-release to suggests,
|
||||
as we can live without these now
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 16 Sep 2009 16:46:57 -0500
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 16 Sep 2009 23:28:02 -0500
|
||||
|
||||
byobu (2.32-0ubuntu1) karmic; urgency=low
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue