Merge lp:~cristiklein/update-notifier/use-xdg-folders into lp:update-notifier/ubuntu

Proposed by Cristian Klein
Status: Merged
Merge reported by: Michael Vogt
Merged at revision: not available
Proposed branch: lp:~cristiklein/update-notifier/use-xdg-folders
Merge into: lp:update-notifier/ubuntu
Diff against target: 124 lines (+25/-10)
5 files modified
INSTALL (+14/-3)
config.h.in (+3/-0)
data/hooks.py (+2/-1)
src/hooks.c (+4/-4)
src/update-notifier.c (+2/-2)
To merge this branch: bzr merge lp:~cristiklein/update-notifier/use-xdg-folders
Reviewer Review Type Date Requested Status
Sebastian Geiger (community) obsolete Disapprove
Ubuntu Core Development Team Pending
Review via email: mp+15038@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sebastian Geiger (lanoxx) wrote :

Is there any particular reason why you put the files into XDG_USER_DATA instead of XDG_USER_CONFIG or XDG_USER_CACHE?

review: Needs Information
Revision history for this message
Cristian Klein (cristiklein) wrote :

> Is there any particular reason why you put the files into XDG_USER_DATA
> instead of XDG_USER_CONFIG or XDG_USER_CACHE?

Hello,

I used [1] to take this decision. If "hooks_seen" is deleted the user won't say "Damn, I will have to reconfigure all" and he doesn't say "It's bloody slow those days". So, by elimination, I assumed it is user data an should belong to XDG_USER_DATA.

Of course, I don't know the application too well, so I might be wrong.

Cristi.

[1] http://ploum.frimouvy.org/?207-modify-your-application-to-use-xdg-folders

Revision history for this message
Sebastian Geiger (lanoxx) wrote :

Hi Christian,

thanks for the reply. I used XDG_CONFIG_HOME now, since update-notifier regenerates the HOOKS_SEEN file if you delete it. So the only change for the user is, that he has to acknowledge the notify dialog if the file gets deleted.

The patches have now been merged into upstream from separate patches, see rev 589 through 591.

Cheers Sebastian

Revision history for this message
Sebastian Geiger (lanoxx) wrote :

Patches already in upstream.

review: Disapprove (obsolete)
Revision history for this message
Cristian Klein (cristiklein) wrote :

Hello,

Are you sure HOOKS_SEEN is CONFIG? IMHO, it doesn't trigger the "Damn, I will have to reconfigure all" reaction of the user. Could you please explain your choice?

Thanks,
Cristi.

Revision history for this message
Sebastian Geiger (lanoxx) wrote :

You can test it, simply but deleting the HOOKS_SEEN file and then manually starting update-notifier from the console. It will open a dialog telling you a few things you have to do, like restart Firefox, etc. and afterwards, after you close it, a new HOOKS_SEEN files is generated.

One more question, are the changes you made to INSTALL and config.h.in important? If yes, then we could send them as a separate patch to mvo.

P.S I will try to get Michael to put you name into the commit message, since most of my patch was inspired by your branch.

Revision history for this message
Cristian Klein (cristiklein) wrote :

Okey, your argument is good enough for me. :)

Regarding, INSTALL and config.h.in, these changes are most likely because I used a newer version of autoconf/make and should be ignored. Sorry for that, I should not have let these changes leak.

Thank you for your time.

Revision history for this message
Sebastian Geiger (lanoxx) wrote :

Not at all, its one bug less after all :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'INSTALL'
--- INSTALL 2009-06-30 11:18:26 +0000
+++ INSTALL 2009-11-19 14:20:25 +0000
@@ -2,7 +2,7 @@
2*************************2*************************
33
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
52006, 2007, 2008 Free Software Foundation, Inc.52006, 2007, 2008, 2009 Free Software Foundation, Inc.
66
7 This file is free documentation; the Free Software Foundation gives7 This file is free documentation; the Free Software Foundation gives
8unlimited permission to copy, distribute and modify it.8unlimited permission to copy, distribute and modify it.
@@ -159,7 +159,7 @@
159CC is not installed, it is recommended to use the following options in159CC is not installed, it is recommended to use the following options in
160order to use an ANSI C compiler:160order to use an ANSI C compiler:
161161
162 ./configure CC="cc -Ae"162 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
163163
164and if that doesn't work, install pre-built binaries of GCC for HP-UX.164and if that doesn't work, install pre-built binaries of GCC for HP-UX.
165165
@@ -174,6 +174,16 @@
174174
175 ./configure CC="cc -nodtk"175 ./configure CC="cc -nodtk"
176176
177 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
178directory contains several dysfunctional programs; working variants of
179these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
180in your `PATH', put it _after_ `/usr/bin'.
181
182 On Haiku, software installed for all users goes in `/boot/common',
183not `/usr/local'. It is recommended to use the following options:
184
185 ./configure --prefix=/boot/common
186
177Specifying the System Type187Specifying the System Type
178==========================188==========================
179189
@@ -189,7 +199,8 @@
189199
190where SYSTEM can have one of these forms:200where SYSTEM can have one of these forms:
191201
192 OS KERNEL-OS202 OS
203 KERNEL-OS
193204
194 See the file `config.sub' for the possible values of each field. If205 See the file `config.sub' for the possible values of each field. If
195`config.sub' isn't included in this package, then this package doesn't206`config.sub' isn't included in this package, then this package doesn't
196207
=== modified file 'config.h.in'
--- config.h.in 2006-04-03 16:11:00 +0000
+++ config.h.in 2009-11-19 14:20:25 +0000
@@ -63,6 +63,9 @@
63/* Define to the one symbol short name of this package. */63/* Define to the one symbol short name of this package. */
64#undef PACKAGE_TARNAME64#undef PACKAGE_TARNAME
6565
66/* Define to the home page for this package. */
67#undef PACKAGE_URL
68
66/* Define to the version of this package. */69/* Define to the version of this package. */
67#undef PACKAGE_VERSION70#undef PACKAGE_VERSION
6871
6972
=== modified file 'data/hooks.py'
--- data/hooks.py 2005-10-09 17:06:55 +0000
+++ data/hooks.py 2009-11-19 14:20:25 +0000
@@ -43,7 +43,8 @@
43 def _readSeenFile(self):43 def _readSeenFile(self):
44 """ read the users config file that stores what hook files are44 """ read the users config file that stores what hook files are
45 already seen """45 already seen """
46 hooks_seen = user.home+"/.update-notifier/hooks_seen"46 dataHome = os.getenv("XDG_DATA_HOME", os.path.join(user.home, '.local', 'share'))
47 hooks_seen = os.path.join(dataHome, 'update-notifier' , 'hooks_seen')
47 if os.path.exists(hooks_seen):48 if os.path.exists(hooks_seen):
48 for line in open(hooks_seen):49 for line in open(hooks_seen):
49 filename, mtime, cmd_run = string.split(line)50 filename, mtime, cmd_run = string.split(line)
5051
=== modified file 'src/hooks.c'
--- src/hooks.c 2009-07-07 18:45:47 +0000
+++ src/hooks.c 2009-11-19 14:20:25 +0000
@@ -20,8 +20,8 @@
20#include "assert.h"20#include "assert.h"
2121
2222
23/* relative to the home dir */23/* relative to the user data dir */
24#define HOOKS_SEEN ".update-notifier/hooks_seen"24#define HOOKS_SEEN "update-notifier/hooks_seen"
2525
26/* used by e.g. the installer to mark stuff that's already done */26/* used by e.g. the installer to mark stuff that's already done */
27#define GLOBAL_HOOKS_SEEN "/etc/update-notifier/hooks_seen"27#define GLOBAL_HOOKS_SEEN "/etc/update-notifier/hooks_seen"
@@ -127,7 +127,7 @@
127 hf->mtime = hook_file_time(hf->filename);127 hf->mtime = hook_file_time(hf->filename);
128128
129 // write out the list of known files129 // write out the list of known files
130 gchar *filename = g_strdup_printf("%s/%s",g_get_home_dir(),HOOKS_SEEN);130 gchar *filename = g_strdup_printf("%s/%s",g_get_user_data_dir(),HOOKS_SEEN);
131 FILE *f = fopen(filename, "w");131 FILE *f = fopen(filename, "w");
132 if(f==NULL) {132 if(f==NULL) {
133 g_warning("Something went wrong writing the users hook file");133 g_warning("Something went wrong writing the users hook file");
@@ -783,7 +783,7 @@
783 hook_read_seen_file(priv,GLOBAL_HOOKS_SEEN);783 hook_read_seen_file(priv,GLOBAL_HOOKS_SEEN);
784 784
785 // read user hook file785 // read user hook file
786 filename = g_strdup_printf("%s/%s", g_get_home_dir(),HOOKS_SEEN);786 filename = g_strdup_printf("%s/%s", g_get_user_data_dir(),HOOKS_SEEN);
787 hook_read_seen_file(priv,filename);787 hook_read_seen_file(priv,filename);
788 g_free(filename);788 g_free(filename);
789789
790790
=== modified file 'src/update-notifier.c'
--- src/update-notifier.c 2009-11-16 20:52:04 +0000
+++ src/update-notifier.c 2009-11-19 14:20:25 +0000
@@ -531,8 +531,8 @@
531 un = g_new0 (UpgradeNotifier, 1);531 un = g_new0 (UpgradeNotifier, 1);
532532
533 // check for .update-notifier dir and create if needed533 // check for .update-notifier dir and create if needed
534 gchar *dirname = g_strdup_printf("%s/.update-notifier",534 gchar *dirname = g_strdup_printf("%s/update-notifier",
535 g_get_home_dir());535 g_get_user_data_dir());
536 if(!g_file_test(dirname, G_FILE_TEST_IS_DIR))536 if(!g_file_test(dirname, G_FILE_TEST_IS_DIR))
537 g_mkdir(dirname, 0700);537 g_mkdir(dirname, 0700);
538 g_free(dirname);538 g_free(dirname);

Subscribers

People subscribed via source and target branches

to all changes: