mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
- use run-one when running apt-check or apt-get - if run-one isn't installed on Debian/Ubuntu, update package checking won't work; sorry
This commit is contained in:
parent
343064e751
commit
64d8ac8f45
3 changed files with 14 additions and 12 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -3,6 +3,10 @@ byobu (5.20) unreleased; urgency=low
|
||||||
* usr/bin/byobu-status:
|
* usr/bin/byobu-status:
|
||||||
- fix upgrades to the new width handling, where some things
|
- fix upgrades to the new width handling, where some things
|
||||||
were undefined
|
were undefined
|
||||||
|
* usr/lib/byobu/updates_available: LP: #976928, #1010505, #999151
|
||||||
|
- use run-one when running apt-check or apt-get
|
||||||
|
- if run-one isn't installed on Debian/Ubuntu,
|
||||||
|
update package checking won't work; sorry
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 08 Jun 2012 17:25:23 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 08 Jun 2012 17:25:23 -0500
|
||||||
|
|
||||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -17,7 +17,8 @@ Depends:
|
||||||
gettext-base,
|
gettext-base,
|
||||||
python,
|
python,
|
||||||
python-newt (>= 0.52.2-11),
|
python-newt (>= 0.52.2-11),
|
||||||
tmux (>= 1.5) | screen
|
tmux (>= 1.5) | screen,
|
||||||
|
util-linux,
|
||||||
Recommends:
|
Recommends:
|
||||||
screen,
|
screen,
|
||||||
tmux (>= 1.5),
|
tmux (>= 1.5),
|
||||||
|
@ -25,7 +26,6 @@ Suggests:
|
||||||
apport,
|
apport,
|
||||||
lsb-release,
|
lsb-release,
|
||||||
po-debconf,
|
po-debconf,
|
||||||
run-one,
|
|
||||||
ttf-ubuntu-font-family (>= 0.80-0ubuntu1~medium),
|
ttf-ubuntu-font-family (>= 0.80-0ubuntu1~medium),
|
||||||
update-notifier-common,
|
update-notifier-common,
|
||||||
vim,
|
vim,
|
||||||
|
|
|
@ -39,7 +39,7 @@ ___print_updates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
___update_cache() {
|
___update_cache() {
|
||||||
local mycache=$1 RUN_ONE=
|
local mycache=$1 flock="$1.lock"
|
||||||
# Now we actually have to do hard computational work to calculate updates.
|
# Now we actually have to do hard computational work to calculate updates.
|
||||||
# Let's try to be "nice" about it:
|
# Let's try to be "nice" about it:
|
||||||
renice 10 $$ >/dev/null 2>&1 || true
|
renice 10 $$ >/dev/null 2>&1 || true
|
||||||
|
@ -47,28 +47,26 @@ ___update_cache() {
|
||||||
# These are very computationally intensive processes.
|
# These are very computationally intensive processes.
|
||||||
# Background this work, have it write to the cache files,
|
# Background this work, have it write to the cache files,
|
||||||
# and let the next cache check pick up the results.
|
# and let the next cache check pick up the results.
|
||||||
# Also, try to ensure that no more than one of these run at
|
# Ensure that no more than one of these run at a given time
|
||||||
# a given time; install the run-one package.
|
|
||||||
command -v run-one >/dev/null && RUN_ONE=run-one
|
|
||||||
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
if [ -x /usr/lib/update-notifier/apt-check ]; then
|
||||||
# If apt-check binary exists, use it
|
# If apt-check binary exists, use it
|
||||||
$RUN_ONE /usr/lib/update-notifier/apt-check 2>&1 | awk '-F;' 'END { print $1, $2 }' > "$mycache" &
|
flock -xn "$flock" /usr/lib/update-notifier/apt-check 2>&1 | awk '-F;' 'END { print $1, $2 }' > "$mycache" &
|
||||||
elif command -v apt-get >/dev/null; then
|
elif command -v apt-get >/dev/null; then
|
||||||
# If apt-get exists, use it
|
# If apt-get exists, use it
|
||||||
$RUN_ONE apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
|
flock -xn "$flock" apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
|
||||||
elif command -v pkcon >/dev/null; then
|
elif command -v pkcon >/dev/null; then
|
||||||
# use packagekit to show list of packages
|
# use packagekit to show list of packages
|
||||||
$RUN_ONE pkcon get-updates -p | grep -c '^Package' > "$mycache" &
|
flock -xn "$flock" pkcon get-updates -p | grep -c '^Package' > "$mycache" &
|
||||||
elif command -v zypper >/dev/null; then
|
elif command -v zypper >/dev/null; then
|
||||||
# If zypper exists, use it
|
# If zypper exists, use it
|
||||||
$RUN_ONE zypper --no-refresh lu --best-effort | grep -c 'v |' > $mycache &
|
flock -xn "$flock" zypper --no-refresh lu --best-effort | grep -c 'v |' > $mycache &
|
||||||
elif command -v yum >/dev/null; then
|
elif command -v yum >/dev/null; then
|
||||||
# If yum exists, use it
|
# If yum exists, use it
|
||||||
# TODO: We need a better way of counting updates available from a RH expert
|
# TODO: We need a better way of counting updates available from a RH expert
|
||||||
$RUN_ONE yum list updates -q | grep -vc "Updated Packages" > $mycache &
|
flock -xn "$flock" yum list updates -q | grep -vc "Updated Packages" > $mycache &
|
||||||
elif command -v pacman >/dev/null; then
|
elif command -v pacman >/dev/null; then
|
||||||
# If pacman (Archlinux) exists, use it
|
# If pacman (Archlinux) exists, use it
|
||||||
LC_ALL=C $RUN_ONE pacman -Sup | grep -vc "^\(::\| \)" > $mycache &
|
LC_ALL=C flock -xn "$flock" pacman -Sup | grep -vc "^\(::\| \)" > $mycache &
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue