bin/updates-available: background updates checking processes,

let them write to cache, and let the next cache check pick up the
changes
-Dustin Kirkland <kirkland@ubuntu.com>Thu, 16 Apr 2009 13:03:19 -0500
This commit is contained in:
Dustin Kirkland 2009-04-16 13:09:40 -05:00
commit 18ca6d101e
5 changed files with 25 additions and 32 deletions

View file

@ -75,33 +75,23 @@ fi
renice 10 $$ >/dev/null 2>&1 || true
ionice -c3 -p $$ >/dev/null 2>&1 || true
# If apt-check binary exists, use it
# 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.
if [ -x /usr/lib/update-notifier/apt-check ]; then
u=`/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;/ /"`
echo "$u" > $mycache
print_updates $u
# If apt-check binary exists, use it
/usr/lib/update-notifier/apt-check 2>&1 | tail -n 1 | sed "s/;/ /" > $mycache &
elif [ -x /usr/bin/apt-get ]; then
# If apt-get exists, use it
/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst > $mycache &
elif [ -x /usr/bin/zypper ]; then
# If zypper exists, use it
/usr/bin/zypper --no-refresh lu --best-effort | grep 'v |' | wc -l > $mycache &
elif [ -x /usr/bin/yum ]; then
# If yum exists, use it
/usr/bin/yum list updates | grep -c "updates" > $mycache &
else
# If we're here, we have no idea
print_updates "?"
fi
# If apt-get exists, use it
if [ -x /usr/bin/apt-get ]; then
u=`/usr/bin/apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst`
echo "$u" > $mycache
print_updates $u
fi
# If zypper exists, use it
if [ -x /usr/bin/zypper ]; then
u=`/usr/bin/zypper --no-refresh lu --best-effort | grep 'v |' | wc -l`
echo "$u" > $mycache
print_updates $u
fi
# If yum exists, use it
if [ -x /usr/bin/yum ]; then
u=`/usr/bin/yum list updates | grep -c "updates"`
echo "$u" > $mycache
print_updates $u
fi
# If we're here, we have no idea
print_updates "?"

5
debian/changelog vendored
View file

@ -8,11 +8,14 @@ screen-profiles (1.45) unreleased; urgency=low
out nice and ionice calls; this *really* slows down startup
* bin/*: route and ifconfig are in /sbin, fully qualify
* bin/release: eliminate one expensive lsb_release call
* bin/updates-available: background updates checking processes,
let them write to cache, and let the next cache check pick up the
changes
[ Jon Bernard <bernardj@gmail.com> ]
* debian/control: fix typo in screen-profiles-extras description
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 16 Apr 2009 12:55:35 -0500
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 16 Apr 2009 13:03:19 -0500
screen-profiles (1.44-0ubuntu1) jaunty; urgency=low

View file

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-07 17:17-0700\n"
"POT-Creation-Date: 2009-04-16 12:56-0500\n"
"PO-Revision-Date: 2008-12-22 01:01-0500\n"
"Last-Translator: Nicolas Valcarcel <nvalcarcel@ubuntu.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-07 17:17-0700\n"
"POT-Creation-Date: 2009-04-16 12:56-0500\n"
"PO-Revision-Date: 2008-12-17 23:42+0100\n"
"Last-Translator: Nicolas Barcet <nicolas.barcet@ubuntu.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-04-07 17:17-0700\n"
"POT-Creation-Date: 2009-04-16 12:56-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"