Merge lp:~mterry/gconf/ubuntu-gsettings-trigger into lp:~ubuntu-desktop/gconf/ubuntu

Proposed by Michael Terry
Status: Merged
Merged at revision: 54
Proposed branch: lp:~mterry/gconf/ubuntu-gsettings-trigger
Merge into: lp:~ubuntu-desktop/gconf/ubuntu
Diff against target: 92 lines (+42/-0)
4 files modified
debian/changelog (+10/-0)
debian/gconf2.postinst (+30/-0)
debian/gconf2.postrm (+1/-0)
debian/gconf2.triggers (+1/-0)
To merge this branch: bzr merge lp:~mterry/gconf/ubuntu-gsettings-trigger
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+45427@code.launchpad.net

Description of the change

  * debian/gconf2.triggers, debian/gconf2.postinst, debian/gconf2.postrm:
    - Declare a new trigger on /usr/share/GConf/gsettings to watch when
      new gsettings convert files are installed. When a new one is
      installed, we notify that a reboot is required, to pick it up on
      next user login.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Hrm, just realized that this will trigger a notice when removing a package with a convert file... Let me readjust.

55. By Michael Terry

don't bother with hash sums; only trigger a notification if a new file appears, not if a file disappears

Revision history for this message
Michael Terry (mterry) wrote :

OK, I updated the branch to ignore file removals.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-01-06 15:35:32 +0000
3+++ debian/changelog 2011-01-06 21:01:42 +0000
4@@ -1,3 +1,13 @@
5+gconf (2.32.1-2ubuntu2) natty; urgency=low
6+
7+ * debian/gconf2.triggers, debian/gconf2.postinst, debian/gconf2.postrm:
8+ - Declare a new trigger on /usr/share/GConf/gsettings to watch when
9+ new gsettings convert files are installed. When a new one is
10+ installed, we notify that a reboot is required, to pick it up on
11+ next user login.
12+
13+ -- Michael Terry <mterry@ubuntu.com> Thu, 06 Jan 2011 14:10:22 -0500
14+
15 gconf (2.32.1-2ubuntu1) natty; urgency=low
16
17 * Resynchronize on Debian
18
19=== modified file 'debian/gconf2.postinst'
20--- debian/gconf2.postinst 2010-05-17 19:44:19 +0000
21+++ debian/gconf2.postinst 2011-01-06 21:01:42 +0000
22@@ -8,6 +8,32 @@
23 kill -s HUP `pidof gconfd-2` >/dev/null 2>&1 || true
24 }
25
26+check_for_new_convert_files()
27+{
28+ # Check /usr/share/GConf/gsettings to see if there are any new files.
29+ # We do this by keeping track of the files in that directory since last
30+ # time we ran, stored in /usr/share/GConf/gsettings.dpkg-cache.
31+ #
32+ # If any new files exist, we notify that a reboot is a good idea.
33+ # We don't worry about updated files, since gsettings-data-convert doesn't.
34+
35+ convertdir="/usr/share/GConf/gsettings"
36+ if [ ! -d "$convertdir" ]; then
37+ return 0
38+ fi
39+
40+ cachefile="$convertdir.dpkg-cache"
41+ newcachefile="$cachefile.new"
42+ (cd /usr/share/GConf/gsettings; ls -1 * > "$newcachefile" 2>/dev/null)
43+ if [ ! -e "$cachefile" ] || \
44+ [ -n "$(comm -1 -3 $cachefile $newcachefile 2>/dev/null)" ]; then
45+ if [ -x /usr/share/update-notifier/notify-reboot-required ]; then
46+ /usr/share/update-notifier/notify-reboot-required
47+ fi
48+ fi
49+ mv "$newcachefile" "$cachefile" || true # save for future runs
50+}
51+
52 if [ "$1" = triggered ]; then
53 for trigger in $2; do
54 case $trigger in
55@@ -20,6 +46,9 @@
56 /usr/share/gconf/mandatory)
57 update-gconf-defaults --no-signal --mandatory
58 ;;
59+ /usr/share/GConf/gsettings)
60+ check_for_new_convert_files
61+ ;;
62 esac
63 done
64 signal_daemons
65@@ -52,5 +81,6 @@
66 gconf-schemas --register-all --no-signal
67 update-gconf-defaults --no-signal
68 update-gconf-defaults --no-signal --mandatory
69+check_for_new_convert_files
70 signal_daemons
71
72
73=== modified file 'debian/gconf2.postrm'
74--- debian/gconf2.postrm 2009-05-15 10:26:55 +0000
75+++ debian/gconf2.postrm 2011-01-06 21:01:42 +0000
76@@ -5,6 +5,7 @@
77 if [ -d /var/lib/gconf ]; then
78 find /var/lib/gconf -mindepth 2 -maxdepth 2 -exec rm -rf \{} \;
79 fi
80+ rm -f /usr/share/GConf/gsettings.dpkg-cache
81 fi
82
83 #DEBHELPER#
84
85=== modified file 'debian/gconf2.triggers'
86--- debian/gconf2.triggers 2010-05-17 19:44:19 +0000
87+++ debian/gconf2.triggers 2011-01-06 21:01:42 +0000
88@@ -1,3 +1,4 @@
89 interest /usr/share/gconf/defaults
90 interest /usr/share/gconf/mandatory
91 interest /usr/share/gconf/schemas
92+interest /usr/share/GConf/gsettings

Subscribers

People subscribed via source and target branches