Merge lp:~cristiklein/update-notifier/use-xdg-folders into lp:update-notifier/ubuntu
- use-xdg-folders
- Merge into ubuntu
| 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 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Sebastian Geiger (community) | obsolete | Disapprove | |
| Ubuntu Core Development Team | Pending | ||
| Review via email: | |||
Commit message
Description of the change
| 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://
| 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
| Sebastian Geiger (lanoxx) wrote : | # |
Patches already in upstream.
| 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.
| 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.
| 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.
| Sebastian Geiger (lanoxx) wrote : | # |
Not at all, its one bug less after all :)
Preview Diff
| 1 | === modified file 'INSTALL' |
| 2 | --- INSTALL 2009-06-30 11:18:26 +0000 |
| 3 | +++ INSTALL 2009-11-19 14:20:25 +0000 |
| 4 | @@ -2,7 +2,7 @@ |
| 5 | ************************* |
| 6 | |
| 7 | Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, |
| 8 | -2006, 2007, 2008 Free Software Foundation, Inc. |
| 9 | +2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
| 10 | |
| 11 | This file is free documentation; the Free Software Foundation gives |
| 12 | unlimited permission to copy, distribute and modify it. |
| 13 | @@ -159,7 +159,7 @@ |
| 14 | CC is not installed, it is recommended to use the following options in |
| 15 | order to use an ANSI C compiler: |
| 16 | |
| 17 | - ./configure CC="cc -Ae" |
| 18 | + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" |
| 19 | |
| 20 | and if that doesn't work, install pre-built binaries of GCC for HP-UX. |
| 21 | |
| 22 | @@ -174,6 +174,16 @@ |
| 23 | |
| 24 | ./configure CC="cc -nodtk" |
| 25 | |
| 26 | + On Solaris, don't put `/usr/ucb' early in your `PATH'. This |
| 27 | +directory contains several dysfunctional programs; working variants of |
| 28 | +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' |
| 29 | +in your `PATH', put it _after_ `/usr/bin'. |
| 30 | + |
| 31 | + On Haiku, software installed for all users goes in `/boot/common', |
| 32 | +not `/usr/local'. It is recommended to use the following options: |
| 33 | + |
| 34 | + ./configure --prefix=/boot/common |
| 35 | + |
| 36 | Specifying the System Type |
| 37 | ========================== |
| 38 | |
| 39 | @@ -189,7 +199,8 @@ |
| 40 | |
| 41 | where SYSTEM can have one of these forms: |
| 42 | |
| 43 | - OS KERNEL-OS |
| 44 | + OS |
| 45 | + KERNEL-OS |
| 46 | |
| 47 | See the file `config.sub' for the possible values of each field. If |
| 48 | `config.sub' isn't included in this package, then this package doesn't |
| 49 | |
| 50 | === modified file 'config.h.in' |
| 51 | --- config.h.in 2006-04-03 16:11:00 +0000 |
| 52 | +++ config.h.in 2009-11-19 14:20:25 +0000 |
| 53 | @@ -63,6 +63,9 @@ |
| 54 | /* Define to the one symbol short name of this package. */ |
| 55 | #undef PACKAGE_TARNAME |
| 56 | |
| 57 | +/* Define to the home page for this package. */ |
| 58 | +#undef PACKAGE_URL |
| 59 | + |
| 60 | /* Define to the version of this package. */ |
| 61 | #undef PACKAGE_VERSION |
| 62 | |
| 63 | |
| 64 | === modified file 'data/hooks.py' |
| 65 | --- data/hooks.py 2005-10-09 17:06:55 +0000 |
| 66 | +++ data/hooks.py 2009-11-19 14:20:25 +0000 |
| 67 | @@ -43,7 +43,8 @@ |
| 68 | def _readSeenFile(self): |
| 69 | """ read the users config file that stores what hook files are |
| 70 | already seen """ |
| 71 | - hooks_seen = user.home+"/.update-notifier/hooks_seen" |
| 72 | + dataHome = os.getenv("XDG_DATA_HOME", os.path.join(user.home, '.local', 'share')) |
| 73 | + hooks_seen = os.path.join(dataHome, 'update-notifier' , 'hooks_seen') |
| 74 | if os.path.exists(hooks_seen): |
| 75 | for line in open(hooks_seen): |
| 76 | filename, mtime, cmd_run = string.split(line) |
| 77 | |
| 78 | === modified file 'src/hooks.c' |
| 79 | --- src/hooks.c 2009-07-07 18:45:47 +0000 |
| 80 | +++ src/hooks.c 2009-11-19 14:20:25 +0000 |
| 81 | @@ -20,8 +20,8 @@ |
| 82 | #include "assert.h" |
| 83 | |
| 84 | |
| 85 | -/* relative to the home dir */ |
| 86 | -#define HOOKS_SEEN ".update-notifier/hooks_seen" |
| 87 | +/* relative to the user data dir */ |
| 88 | +#define HOOKS_SEEN "update-notifier/hooks_seen" |
| 89 | |
| 90 | /* used by e.g. the installer to mark stuff that's already done */ |
| 91 | #define GLOBAL_HOOKS_SEEN "/etc/update-notifier/hooks_seen" |
| 92 | @@ -127,7 +127,7 @@ |
| 93 | hf->mtime = hook_file_time(hf->filename); |
| 94 | |
| 95 | // write out the list of known files |
| 96 | - gchar *filename = g_strdup_printf("%s/%s",g_get_home_dir(),HOOKS_SEEN); |
| 97 | + gchar *filename = g_strdup_printf("%s/%s",g_get_user_data_dir(),HOOKS_SEEN); |
| 98 | FILE *f = fopen(filename, "w"); |
| 99 | if(f==NULL) { |
| 100 | g_warning("Something went wrong writing the users hook file"); |
| 101 | @@ -783,7 +783,7 @@ |
| 102 | hook_read_seen_file(priv,GLOBAL_HOOKS_SEEN); |
| 103 | |
| 104 | // read user hook file |
| 105 | - filename = g_strdup_printf("%s/%s", g_get_home_dir(),HOOKS_SEEN); |
| 106 | + filename = g_strdup_printf("%s/%s", g_get_user_data_dir(),HOOKS_SEEN); |
| 107 | hook_read_seen_file(priv,filename); |
| 108 | g_free(filename); |
| 109 | |
| 110 | |
| 111 | === modified file 'src/update-notifier.c' |
| 112 | --- src/update-notifier.c 2009-11-16 20:52:04 +0000 |
| 113 | +++ src/update-notifier.c 2009-11-19 14:20:25 +0000 |
| 114 | @@ -531,8 +531,8 @@ |
| 115 | un = g_new0 (UpgradeNotifier, 1); |
| 116 | |
| 117 | // check for .update-notifier dir and create if needed |
| 118 | - gchar *dirname = g_strdup_printf("%s/.update-notifier", |
| 119 | - g_get_home_dir()); |
| 120 | + gchar *dirname = g_strdup_printf("%s/update-notifier", |
| 121 | + g_get_user_data_dir()); |
| 122 | if(!g_file_test(dirname, G_FILE_TEST_IS_DIR)) |
| 123 | g_mkdir(dirname, 0700); |
| 124 | g_free(dirname); |
Is there any particular reason why you put the files into XDG_USER_DATA instead of XDG_USER_CONFIG or XDG_USER_CACHE?