From 18ca6d101e7f166fa56d40638364b8bb4dbbd467 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 16 Apr 2009 13:09:40 -0500 Subject: [PATCH] bin/updates-available: background updates checking processes, let them write to cache, and let the next cache check pick up the changes -Dustin Kirkland Thu, 16 Apr 2009 13:03:19 -0500 --- bin/updates-available | 46 +++++++++++++++++------------------------- debian/changelog | 5 ++++- po/es.po | 2 +- po/fr.po | 2 +- po/screen-profiles.pot | 2 +- 5 files changed, 25 insertions(+), 32 deletions(-) diff --git a/bin/updates-available b/bin/updates-available index 3cec0684..8e86cb76 100755 --- a/bin/updates-available +++ b/bin/updates-available @@ -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 "?" diff --git a/debian/changelog b/debian/changelog index f2f8193c..7776ad8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 ] * debian/control: fix typo in screen-profiles-extras description - -- Dustin Kirkland Thu, 16 Apr 2009 12:55:35 -0500 + -- Dustin Kirkland Thu, 16 Apr 2009 13:03:19 -0500 screen-profiles (1.44-0ubuntu1) jaunty; urgency=low diff --git a/po/es.po b/po/es.po index ee3d5d11..04057003 100644 --- a/po/es.po +++ b/po/es.po @@ -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 \n" "Language-Team: LANGUAGE \n" diff --git a/po/fr.po b/po/fr.po index c297f0e3..513a9d70 100644 --- a/po/fr.po +++ b/po/fr.po @@ -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 \n" "Language-Team: LANGUAGE \n" diff --git a/po/screen-profiles.pot b/po/screen-profiles.pot index cdfcdf53..6d5d82c7 100644 --- a/po/screen-profiles.pot +++ b/po/screen-profiles.pot @@ -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 \n" "Language-Team: LANGUAGE \n"