Merge lp:~vorlon/update-notifier/lp.876298 into lp:update-notifier

Proposed by Steve Langasek on 2012-03-20
Status: Merged
Merged at revision: 669
Proposed branch: lp:~vorlon/update-notifier/lp.876298
Merge into: lp:update-notifier
Diff against target: 491 lines (+365/-8)
13 files modified
data/Makefile.am (+14/-1)
data/package-data-downloader (+274/-0)
data/package-data-downloads-failed-permanently.in (+14/-0)
data/package-data-downloads-failed.in (+15/-0)
debian/changelog (+16/-0)
debian/control (+1/-1)
debian/update-notifier-common.cron.daily (+6/-0)
debian/update-notifier-common.dirs (+2/-0)
debian/update-notifier-common.install (+2/-0)
debian/update-notifier-common.postinst (+11/-0)
debian/update-notifier-common.triggers (+1/-0)
po/POTFILES.in (+2/-0)
src/update-notifier.c (+7/-6)
To merge this branch: bzr merge lp:~vorlon/update-notifier/lp.876298
Reviewer Review Type Date Requested Status
Michael Vogt 2012-03-20 Pending
Ubuntu Core Development Team 2012-03-20 Pending
Review via email: mp+98487@code.launchpad.net

Description of the Change

initial implementation of a hook to let packages queue delayed downloads

To post a comment you must log in.
lp:~vorlon/update-notifier/lp.876298 updated on 2012-03-20
654. By Steve Langasek on 2012-03-20

add proper exception handling so we can at least see unexpected exceptions;
this uncovered a buglet trying to push to sums without declaring it first...

655. By Steve Langasek on 2012-03-20

use 'with open()' to be more idiomatic

656. By Steve Langasek on 2012-03-20

print the filename as we download it, not as we parse it

657. By Steve Langasek on 2012-03-20

support localization of the new file

658. By Steve Langasek on 2012-03-20

src/update-notifier.c: when there are new hooks, check them whether or
not dpkg has run; this allows other packages to send us notifications
by ways other than running a package maintainer script.

659. By Steve Langasek on 2012-03-20

there's no reason to 'pass' if we have other handling in place for the
exception

660. By Steve Langasek on 2012-03-20

don't skip the script unless the *current* package is listed as failing the
checksum check.

Steve Langasek (vorlon) wrote :

This implementation has a problem. The file in /usr/share/package-data-downloads will always have the mtime that was set when the package was created. This means that if a user installs an out-of-date version of the package which successfully downloads the data it requests, then runs apt-get update and installs the current version, the hook will not trigger because the stamp file's date will still be newer than the mtime on the hook.

Still thinking how to fix this.

Steve Langasek (vorlon) wrote :

I think the best solution here is to just require packages to remove their own stamp files in the maintainer script when they want to ensure a new download; annoyingly manual, but anything else is either going to download too little, or way too much.

lp:~vorlon/update-notifier/lp.876298 updated on 2012-03-22
661. By Steve Langasek on 2012-03-21

add support for reading proxy settings from apt

662. By Steve Langasek on 2012-03-21

Add proper error handling in case of download failure

663. By Steve Langasek on 2012-03-21

debian/update-notifier-common.cron.daily: add a cronjob to periodically
retry any failed downloads.

664. By Steve Langasek on 2012-03-21

add support for stampfiles for both permanent and temporary hook failures,
so we can keep track of what notifications we need to send to users.

665. By Steve Langasek on 2012-03-22

Add data/package-data-downloads-failed-permanently.in, so we can actually
notify the user of permanent errors.

666. By Steve Langasek on 2012-03-22

tune the language in the notification for the non-permanent failures, based on
improvements in the new one for permanent failures

667. By Steve Langasek on 2012-03-22

whoops, wrong variable

Michael Vogt (mvo) wrote :

Thanks Steve!

That looks very good, some small remarks:

+ regexp = re.compile(r"(.*).permanent-failure$")
+ for file in os.listdir(STAMPDIR):
+ match = regexp.match(file)
+ if match:
+ res.append(match.group(1))

Could be written as something like:
+ return glob.glob(STAMPDIR+"*.permanent-failure")

proxy_list = subprocess.check_output(['apt-config', 'shell',
214 + 'http', 'Acquire::http::Proxy',
215 + 'https', 'Acquire::https::Proxy',
216 + 'ftp', 'Acquire::ftp::Proxy'])
...
Could we written as:
import apt
http_proxy = apt.apt_pkg.config.get("Acquire::http::Proxy")
https_proxy = apt.apt_pkg.config.get("Acquire::https::Proxy")

I think its a good idea to use:
+ output = subprocess.check_output(["sha256sum", dest_file])
instead of the buildin hashlib as this is simpler

+ if line == " $packages\n":
Could be written as something like:
line = string.Template(line).substitute({'packages' : " ,".join(packages) + "\n"})

Note that this is all minor nitpicking. Having tests would be awsome of course, but
I can have a look at tihs tomorrow morning.

Steve Langasek (vorlon) wrote :

> Could be written as something like:
> + return glob.glob(STAMPDIR+"*.permanent-failure")

We do want to strip off the extension and directory name, though, to get just the name of the hook that's failed. So in the end, I'm not sure this is shorter/cleaner?

Committed the other two suggestions, thanks!

lp:~vorlon/update-notifier/lp.876298 updated on 2012-03-23
668. By Steve Langasek on 2012-03-23

since we already depend on python-apt, just use it instead of shelling out to
apt-config.

669. By Steve Langasek on 2012-03-23

use string.Template per mvo's suggestion, instead of doing by-hand variable
substitution.

Michael Vogt (mvo) wrote :

Thanks a bunch, I don't have a strong opinion about the glob, here is the full alternative that we could
use, but either way is fine I think:
- res = []
- regexp = re.compile(r"(.*).permanent-failure$")
- for file in os.listdir(STAMPDIR):
- match = regexp.match(file)
- if match:
- res.append(match.group(1))
- return res
+ files = glob.glob(os.path.join(STAMPDIR, "*.permanent-failure"))
+ return [os.path.splitext(os.path.basename(path))[0] for path in files]

I work on lp:~mvo/update-notifier/lp.876298/ now to add some small tests and I did include this
change but feel free to not merge it if you like the previous version better, both work fine.

Michael Vogt (mvo) wrote :

I commited some basic tests to lp:~mvo/update-notifier/lp.876298/ mostly because I wanted to make sure that
I don't break stuff where I changed stuff. I also did some code changes and tried to cover them with tests
so that its safe. None of the code changes is really critical, look at them and pick the bits you like and
ignore the others :) I hope they all make sense but to a certain extend its a matter of preference. Taking
the tests would be nice though they should work regardless of the code changes I made.

Feedback very welcome, it would be really nice if we had a test for the process_download_requests() too,
but I have not looked what this involves, probably a bit of "from mock import Mock,patch" to patch some
of the methods like urlretrieve() that we want to have mocks.

Thanks again for your work on this feature, I think its highly useful!

Steve Langasek (vorlon) wrote :

On Fri, Mar 23, 2012 at 09:16:20AM -0000, Michael Vogt wrote:
> I commited some basic tests to lp:~mvo/update-notifier/lp.876298/ mostly
> because I wanted to make sure that I don't break stuff where I changed
> stuff. I also did some code changes and tried to cover them with tests so
> that its safe. None of the code changes is really critical, look at them
> and pick the bits you like and ignore the others :) I hope they all make
> sense but to a certain extend its a matter of preference. Taking the
> tests would be nice though they should work regardless of the code changes
> I made.

Thanks, I've merged these changes into trunk now. (Well, this is an
overloaded MP now, isn't it?)

> Feedback very welcome, it would be really nice if we had a test for the
> process_download_requests() too, but I have not looked what this involves,
> probably a bit of "from mock import Mock,patch" to patch some of the
> methods like urlretrieve() that we want to have mocks.

I haven't had a chance to look at adding these tests yet. :/

We also don't have counter-based aging of failures yet. I guess we need to
get that sorted before landing this feature?

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/Makefile.am'
2--- data/Makefile.am 2011-08-10 13:46:45 +0000
3+++ data/Makefile.am 2012-03-23 02:54:17 +0000
4@@ -12,14 +12,27 @@
5 dist_convert_DATA = update-notifier.convert
6
7 helperdir = $(libdir)/update-notifier
8-helper_SCRIPTS = apt_check.py apt-cdrom-check cddistupgrader update-motd-reboot-required update-motd-updates-available update-motd-fsck-at-reboot backend_helper.py
9+helper_SCRIPTS = apt_check.py apt-cdrom-check cddistupgrader update-motd-reboot-required update-motd-updates-available update-motd-fsck-at-reboot backend_helper.py package-data-downloader
10
11 notifydir = $(datadir)/update-notifier
12 notify_SCRIPTS = notify-reboot-required
13+notify_in_files = package-data-downloads-failed.in package-data-downloads-failed-permanently.in
14+notify_DATA = $(notify_in_files:.in=)
15
16 EXTRA_DIST= $(helper_SCRIPTS) \
17 $(desktop_in_files) \
18+ $(notify_in_files) \
19 $(gsettings_SCHEMAS:.xml=.xml.in)
20
21 CLEANFILES = \
22 $(gsettings_SCHEMAS)
23+
24+package-data-downloads-failed: package-data-downloads-failed.in
25+ $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po)
26+ $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -r -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
27+ sed -i -e's/^_//' $@
28+
29+package-data-downloads-failed-permanently: package-data-downloads-failed-permanently.in
30+ $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po)
31+ $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -r -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
32+ sed -i -e's/^_//' $@
33
34=== added file 'data/package-data-downloader'
35--- data/package-data-downloader 1970-01-01 00:00:00 +0000
36+++ data/package-data-downloader 2012-03-23 02:54:17 +0000
37@@ -0,0 +1,274 @@
38+#!/usr/bin/python
39+# -*- coding: utf-8 -*-
40+"""Process new requests to download per-package data"""
41+# Copyright (C) 2012 Canonical Ltd
42+#
43+# This program is free software; you can redistribute it and/or modify
44+# it under the terms of version 3 of the GNU General Public License as
45+# published by the Free Software Foundation.
46+#
47+# This program is distributed in the hope that it will be useful,
48+# but WITHOUT ANY WARRANTY; without even the implied warranty of
49+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+# GNU General Public License for more details.
51+#
52+# You should have received a copy of the GNU General Public License along
53+# with this program; if not, write to the Free Software Foundation, Inc.,
54+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
55+
56+import os
57+import sys
58+import subprocess
59+import re
60+import traceback
61+import urllib
62+import debian.deb822
63+import string
64+import apt
65+from datetime import timedelta
66+
67+DATADIR = "/usr/share/package-data-downloads/"
68+STAMPDIR = "/var/lib/update-notifier/package-data-downloads/"
69+NOTIFIER_SOURCE_FILE = "/usr/share/update-notifier/package-data-downloads-failed"
70+NOTIFIER_FILE = "/var/lib/update-notifier/user.d/data-downloads-failed"
71+NOTIFIER_PERMANENT_SOURCE_FILE = NOTIFIER_SOURCE_FILE + '-permanently'
72+NOTIFIER_PERMANENT_FILE = NOTIFIER_FILE + '-permanently'
73+
74+failures = []
75+permanent_failures = []
76+
77+def create_or_update_stampfile(file):
78+ """Create or update the indicated stampfile, and remove failure flags"""
79+
80+ try:
81+ with open(file, 'w'):
82+ pass
83+ # Ignore errors
84+ except Exception:
85+ traceback.print_exc(file=sys.stderr)
86+
87+ os.utime(file, None)
88+
89+ for ext in ('.failed', '.permanent-failure'):
90+ if os.path.exists(file + ext):
91+ os.unlink(file + ext)
92+
93+
94+def mark_hook_failed(hook_name, permanent=False):
95+ """Create a stampfile recording that a hook failed
96+
97+ We create separate stampfiles for failed hooks so we can
98+ keep track of how long the hook has been failing and if the failure
99+ should be considered permanent."""
100+
101+ if permanent:
102+ filename = hook_name + '.permanent-failure'
103+ else:
104+ filename = hook_name + '.failed'
105+
106+ failure_file = os.path.join(STAMPDIR, filename)
107+ try:
108+ with open(failure_file, 'w'):
109+ pass
110+
111+ # Ignore errors
112+ except Exception:
113+ traceback.print_exc(file=sys.stderr)
114+
115+ for ext in ('', '.failed', '.permanent-failure'):
116+ stampfile = hook_name + ext
117+ if filename != stampfile \
118+ and os.path.exists(os.path.join(STAMPDIR, stampfile)):
119+ os.unlink(os.path.join(STAMPDIR, stampfile))
120+
121+
122+def hook_is_permanently_failed(hook_name):
123+ """Check if this hook has been marked as permanently failing.
124+
125+ If so, don't raise any more errors about it."""
126+
127+ failure_file = os.path.join(STAMPDIR, hook_name + '.permanent-failure')
128+ return os.path.exists(failure_file)
129+
130+
131+def hook_aged_out(hook_name):
132+ """Check if this hook has been failing consistently for >= 3 days"""
133+
134+ failure_file = os.path.join(STAMPDIR, hook_name + '.failed')
135+ try:
136+ hook_date = os.stat(failure_file).st_ctime
137+ cur_time = os.times()[4]
138+ d = timedelta(microseconds=cur_time-hook_date)
139+ if d.days >= 3:
140+ return True
141+ except OSError:
142+ pass
143+ except Exception:
144+ traceback.print_exc(file=sys.stderr)
145+ return False
146+
147+
148+def record_failure(hook):
149+ """Record that the named hook has failed"""
150+ if hook_aged_out(hook):
151+ permanent_failures.append(hook)
152+ else:
153+ failures.append(hook)
154+
155+
156+def existing_permanent_failures():
157+ """Return the list of all previously recorded permanent failures"""
158+
159+ res = []
160+ regexp = re.compile(r"(.*).permanent-failure$")
161+ for file in os.listdir(STAMPDIR):
162+ match = regexp.match(file)
163+ if match:
164+ res.append(match.group(1))
165+ return res
166+
167+
168+def trigger_update_notifier(failures, permanent=False):
169+ """Tell update-notifier that there were failed packages"""
170+
171+ try:
172+ if permanent:
173+ input = open(NOTIFIER_PERMANENT_SOURCE_FILE, 'r')
174+ output = open(NOTIFIER_PERMANENT_FILE, 'w')
175+ else:
176+ input = open(NOTIFIER_SOURCE_FILE, 'r')
177+ output = open(NOTIFIER_FILE, 'w')
178+ except Exception:
179+ # Things failed and we can't even notify about it. Break the
180+ # trigger so that there's some error propagation, even if not
181+ # the most pleasant sort.
182+ traceback.print_exc(file=sys.stderr)
183+ sys.exit(1)
184+
185+ packages = []
186+ for failure in failures:
187+ packages.append(os.path.basename(failure))
188+
189+ for line in input:
190+ line = string.Template(line).substitute({'packages' : ", ".join(packages)})
191+ output.write(line)
192+ input.close()
193+ output.close()
194+
195+
196+def process_download_requests():
197+ """Process requests to download package data files
198+
199+ Iterate over /usr/share/package-data-downloads and download any
200+ package data specified in the contained file, then hand off to
201+ the indicated handler for further processing.
202+
203+ Successful downloads are recorded in
204+ /var/lib/update-notifier/package-data-downloads to avoid unnecessary
205+ repeat handling.
206+
207+ Failed downloads are reported to the user via the
208+ update-notifier interface."""
209+
210+ # Get our proxy settings from apt
211+ proxies = {}
212+ try:
213+ for proto in ('http','https','ftp'):
214+ proxies[proto] = apt.apt_pkg.config.get("Acquire::"+proto+"::Proxy")
215+ if not proxies[proto]:
216+ proxies.pop(proto)
217+
218+ if proxies:
219+ urllib._urlopener = urllib.URLopener(proxies)
220+ except Exception:
221+ pass
222+
223+ # Iterate through all the available hooks. If we get a failure
224+ # processing any of them (download failure, checksum failure, or
225+ # failure to run the hook script), record it but continue processing
226+ # the rest of the hooks since some of them may succeed.
227+ for relfile in os.listdir(DATADIR):
228+ # FIXME: ignore files ending in .dpkg-*
229+ stampfile = os.path.join(STAMPDIR, relfile)
230+ file = os.path.join(DATADIR, relfile)
231+ try:
232+ hook_date = os.stat(file).st_mtime
233+ stamp_date = os.stat(stampfile).st_mtime
234+ if hook_date < stamp_date:
235+ continue
236+ except Exception as e:
237+ if not isinstance(e, OSError):
238+ traceback.print_exc(file=sys.stderr)
239+
240+ hook = debian.deb822.Deb822()
241+ files = []
242+ sums = []
243+ for para in hook.iter_paragraphs(open(file)):
244+ if para.has_key('script'):
245+ if not files:
246+ record_failure(relfile)
247+ break
248+ command = [para['script']]
249+
250+ # Download each file and verify the sum
251+ try:
252+ for i in range(len(files)):
253+ print files[i]
254+ dest_file = urllib.urlretrieve(files[i])[0]
255+ output = subprocess.check_output(["sha256sum", dest_file])
256+ output = output.split(' ')[0]
257+ if output == sums[i]:
258+ command.append(dest_file)
259+ else:
260+ record_failure(relfile)
261+ break
262+ if relfile in failures:
263+ break
264+
265+ result = subprocess.call(command)
266+ if result:
267+ # There's no sense redownloading if the script fails
268+ permanent_failures.append(relfile)
269+ else:
270+ create_or_update_stampfile(stampfile)
271+ break
272+ except Exception:
273+ traceback.print_exc(file=sys.stderr)
274+
275+ record_failure(relfile)
276+ # The 'script' is always the last stanza
277+ break
278+
279+ # Not in a 'script' stanza, so we should have some urls
280+ try:
281+ files.append(para['url'])
282+ sums.append(para['sha256'])
283+ except Exception as e:
284+ if not isinstance(e, KeyError):
285+ traceback.print_exc(file=sys.stderr)
286+ record_failure(relfile)
287+ break
288+
289+ # We only report about "permanent" failures when there are new ones,
290+ # but we want the whole list of permanently-failing hooks so when
291+ # we clobber the update-notifier file we don't lose information the
292+ # user may not have seen yet
293+ if permanent_failures:
294+ new_failures = False
295+ previous_failures = existing_permanent_failures()
296+ for failure in permanent_failures:
297+ if failure not in previous_failures:
298+ mark_hook_failed(failure, permanent=True)
299+ previous_failures.append(failure)
300+ new_failures = True
301+ if new_failures:
302+ trigger_update_notifier(previous_failures, permanent=True)
303+
304+ if failures:
305+ for failure in failures:
306+ mark_hook_failed(failure)
307+ trigger_update_notifier(failures)
308+
309+
310+if __name__ == "__main__":
311+ process_download_requests()
312
313=== added file 'data/package-data-downloads-failed-permanently.in'
314--- data/package-data-downloads-failed-permanently.in 1970-01-01 00:00:00 +0000
315+++ data/package-data-downloads-failed-permanently.in 2012-03-23 02:54:17 +0000
316@@ -0,0 +1,14 @@
317+_Name: Data files for some packages could not be downloaded
318+Priority: High
319+_Description:
320+ The following packages requested additional data downloads after package
321+ installation, but the data could not be downloaded or could not be
322+ processed.
323+ .
324+ .
325+ $packages
326+ .
327+ .
328+ This is a permanent failure that leaves these packages unusable on your
329+ system. You may need to fix your Internet connection, then remove and
330+ reinstall the packages to fix this problem.
331
332=== added file 'data/package-data-downloads-failed.in'
333--- data/package-data-downloads-failed.in 1970-01-01 00:00:00 +0000
334+++ data/package-data-downloads-failed.in 2012-03-23 02:54:17 +0000
335@@ -0,0 +1,15 @@
336+_Name: Failure to download extra data files
337+Priority: High
338+Terminal: True
339+Command: /usr/lib/update-notifier/package-data-downloader
340+_Description:
341+ The following packages requested additional data downloads after package
342+ installation, but the data could not be downloaded or could not be
343+ processed.
344+ .
345+ .
346+ $packages
347+ .
348+ .
349+ The download will be attempted again later, or you can try the download
350+ again now. Running this command requires an active Internet connection.
351
352=== modified file 'debian/changelog'
353--- debian/changelog 2012-03-11 09:29:32 +0000
354+++ debian/changelog 2012-03-23 02:54:17 +0000
355@@ -1,3 +1,19 @@
356+update-notifier (0.119ubuntu2) UNRELEASED; urgency=low
357+
358+ * data/package-data-downloader, data/package-data-downloads-failed.in,
359+ data/package-data-downloads-failed-permanently.in,
360+ debian/update-notifier-common.{postinst,triggers}: add a new handler and
361+ dpkg trigger to let packages queue data for download after package
362+ install, so that network connectivity problems don't make installs
363+ and upgrades unreliable. LP: #876298.
364+ * debian/update-notifier-common.cron.daily: add a cronjob to periodically
365+ retry any failed downloads.
366+ * src/update-notifier.c: when there are new hooks, check them whether or
367+ not dpkg has run; this allows other packages to send us notifications
368+ by ways other than running a package maintainer script.
369+
370+ -- Steve Langasek <steve.langasek@ubuntu.com> Mon, 19 Mar 2012 20:52:16 +0000
371+
372 update-notifier (0.119ubuntu1) precise; urgency=low
373
374 * src/update-notifier.c: Consider both the "sudo" and "admin" groups as
375
376=== modified file 'debian/control'
377--- debian/control 2011-09-27 09:57:41 +0000
378+++ debian/control 2012-03-23 02:54:17 +0000
379@@ -41,7 +41,7 @@
380 Depends: ${shlibs:Depends},
381 ${misc:Depends},
382 python,
383- python-apt (>= 0.6.12)
384+ python-apt (>= 0.6.12), python-debian
385 Recommends: libpam-modules (>= 1.0.1-9ubuntu3)
386 Description: Files shared between update-notifier and other packages
387 Apt setup files and reboot notification scripts shared between
388
389=== added file 'debian/update-notifier-common.cron.daily'
390--- debian/update-notifier-common.cron.daily 1970-01-01 00:00:00 +0000
391+++ debian/update-notifier-common.cron.daily 2012-03-23 02:54:17 +0000
392@@ -0,0 +1,6 @@
393+#!/bin/sh
394+
395+set -e
396+
397+# Try to rerun any package data downloads that failed at package install time.
398+/usr/lib/update-notifier/package-data-downloader
399
400=== modified file 'debian/update-notifier-common.dirs'
401--- debian/update-notifier-common.dirs 2012-01-18 08:35:33 +0000
402+++ debian/update-notifier-common.dirs 2012-03-23 02:54:17 +0000
403@@ -2,6 +2,8 @@
404 etc/update-notifier
405 var/lib/update-notifier
406 var/lib/update-notifier/user.d
407+var/lib/update-notifier/package-data-downloads
408 etc/update-motd.d
409 usr/share/update-notifier/plugins/cache-changed
410 usr/share/update-notifier/upgrader-patches
411+usr/share/package-data-downloads
412
413=== modified file 'debian/update-notifier-common.install'
414--- debian/update-notifier-common.install 2012-01-18 08:35:33 +0000
415+++ debian/update-notifier-common.install 2012-03-23 02:54:17 +0000
416@@ -6,6 +6,8 @@
417 debian/98-reboot-required etc/update-motd.d
418 debian/98-fsck-at-reboot etc/update-motd.d
419 usr/share/update-notifier/notify-reboot-required
420+usr/share/update-notifier/package-data-downloads-failed
421+usr/share/update-notifier/package-data-downloads-failed-permanently
422 usr/lib/update-notifier/
423 usr/share/locale
424 debian/update-manager-downloader-fix2.diff usr/share/update-notifier/upgrader-patches
425
426=== modified file 'debian/update-notifier-common.postinst'
427--- debian/update-notifier-common.postinst 2010-11-17 19:51:40 +0000
428+++ debian/update-notifier-common.postinst 2012-03-23 02:54:17 +0000
429@@ -14,4 +14,15 @@
430 rm -f /etc/update-motd.d/20-cpu-checker
431 fi
432
433+if [ "$1" = triggered ]; then
434+ for trigger in $2; do
435+ case $trigger in
436+ /usr/share/package-data-downloads)
437+ /usr/lib/update-notifier/package-data-downloader
438+ ;;
439+ esac
440+ done
441+ exit 0
442+fi
443+
444 #DEBHELPER#
445
446=== added file 'debian/update-notifier-common.triggers'
447--- debian/update-notifier-common.triggers 1970-01-01 00:00:00 +0000
448+++ debian/update-notifier-common.triggers 2012-03-23 02:54:17 +0000
449@@ -0,0 +1,1 @@
450+interest /usr/share/package-data-downloads
451
452=== modified file 'po/POTFILES.in'
453--- po/POTFILES.in 2011-07-14 07:37:31 +0000
454+++ po/POTFILES.in 2012-03-23 02:54:17 +0000
455@@ -17,3 +17,5 @@
456 [type: gettext/glade]ui/reboot-dialog.ui
457 data/com.ubuntu.update-notifier.gschema.xml.in
458 data/update-notifier.desktop.in
459+[type: gettext/rfc822deb] data/package-data-downloads-failed.in
460+[type: gettext/rfc822deb] data/package-data-downloads-failed-permanently.in
461
462=== modified file 'src/update-notifier.c'
463--- src/update-notifier.c 2012-03-11 09:27:31 +0000
464+++ src/update-notifier.c 2012-03-23 02:54:17 +0000
465@@ -328,12 +328,6 @@
466 if(un->update_finished_timer > 0)
467 g_source_remove(un->update_finished_timer);
468
469- // show pending hooks/reboots
470- if(un->hook_pending) {
471- //g_print("checking hooks now\n");
472- check_update_hooks(un->hook);
473- un->hook_pending = FALSE;
474- }
475 if(un->reboot_pending) {
476 //g_print("checking reboot now\n");
477 reboot_check (un->reboot);
478@@ -350,6 +344,13 @@
479 un->last_apt_action = 0;
480 }
481
482+ // show pending hooks
483+ if(un->hook_pending) {
484+ //g_print("checking hooks now\n");
485+ check_update_hooks(un->hook);
486+ un->hook_pending = FALSE;
487+ }
488+
489 // apt-get update/install or dpkg is runing (and updates files in
490 // it's list/cache dir) or in /var/lib/dpkg/status
491 if(un->apt_get_runing)

Subscribers

People subscribed via source and target branches

to all changes: