mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* debian/control, usr/lib/byobu/updates_available: LP: #878547
- recommend run-one, MIR pending - use run-this-one to ensure that more than one apt-check doesn't get run simultaneously
This commit is contained in:
parent
c902c522d4
commit
1a2209b64e
3 changed files with 15 additions and 9 deletions
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -1,6 +1,9 @@
|
|||
byobu (4.48) unreleased; urgency=low
|
||||
|
||||
* UNRELEASED
|
||||
* debian/control, usr/lib/byobu/updates_available: LP: #878547
|
||||
- recommend run-one, MIR pending
|
||||
- use run-this-one to ensure that more than one apt-check doesn't
|
||||
get run simultaneously
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 09 Nov 2011 17:54:11 -0600
|
||||
|
||||
|
|
2
debian/control
vendored
2
debian/control
vendored
|
@ -12,7 +12,7 @@ Vcs-Bzr: http://bazaar.launchpad.net/~kirkland/byobu/trunk
|
|||
Package: byobu
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, debconf (>= 0.5) | debconf-2.0, screen, gettext-base, python, python-newt (>= 0.52.2-11)
|
||||
Recommends: tmux
|
||||
Recommends: run-one, tmux
|
||||
Suggests: apport, vim, w3m, po-debconf, update-notifier-common, lsb-release
|
||||
Provides: screen-profiles, screen-profiles-extras, byobu-extras
|
||||
Replaces: screen-profiles (<< 2.0), screen-profiles-extras (<< 2.0), byobu-extras (<< 2.17)
|
||||
|
|
|
@ -36,7 +36,7 @@ ___print_updates() {
|
|||
}
|
||||
|
||||
___update_cache() {
|
||||
local mycache=$1
|
||||
local mycache=$1 RUN_THIS_ONE=
|
||||
# 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
|
||||
|
@ -44,25 +44,28 @@ ___update_cache() {
|
|||
# These are very computationally intensive processes.
|
||||
# Background this work, have it write to the cache files,
|
||||
# and let the next cache check pick up the results.
|
||||
# Also, try to ensure that no more than one of these run at
|
||||
# a given time; install the run-one package.
|
||||
command -v run-this-one >/dev/null && RUN_THIS_ONE=run-this-one
|
||||
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
||||
# If apt-check binary exists, use it
|
||||
/usr/lib/update-notifier/apt-check 2>&1 | awk '-F;' 'END { print $1, $2 }' > "$mycache" &
|
||||
$RUN_THIS_ONE /usr/lib/update-notifier/apt-check 2>&1 | awk '-F;' 'END { print $1, $2 }' > "$mycache" &
|
||||
elif command -v apt-get >/dev/null; then
|
||||
# If apt-get exists, use it
|
||||
apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
|
||||
$RUN_THIS_ONE apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
|
||||
elif command -v pkcon >/dev/null; then
|
||||
# use packagekit to show list of packages
|
||||
pkcon get-updates -p | grep -c '^Package' > "$mycache" &
|
||||
$RUN_THIS_ONE pkcon get-updates -p | grep -c '^Package' > "$mycache" &
|
||||
elif command -v zypper >/dev/null; then
|
||||
# If zypper exists, use it
|
||||
zypper --no-refresh lu --best-effort | grep -c 'v |' > $mycache &
|
||||
$RUN_THIS_ONE zypper --no-refresh lu --best-effort | grep -c 'v |' > $mycache &
|
||||
elif command -v yum >/dev/null; then
|
||||
# If yum exists, use it
|
||||
# TODO: We need a better way of counting updates available from a RH expert
|
||||
yum list updates -q | grep -vc "Updated Packages" > $mycache &
|
||||
$RUN_THIS_ONE yum list updates -q | grep -vc "Updated Packages" > $mycache &
|
||||
elif command -v pacman >/dev/null; then
|
||||
# If pacman (Archlinux) exists, use it
|
||||
LC_ALL=C pacman -Sup | grep -vc "^\(::\| \)" > $mycache &
|
||||
LC_ALL=C $RUN_THIS_ONE pacman -Sup | grep -vc "^\(::\| \)" > $mycache &
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue