]>
Commit | Line | Data |
---|---|---|
0fc8faba | 1 | diff -Nru dia-0.92.2.orig/app/app_procs.c dia-0.92.2/app/app_procs.c |
2 | --- dia-0.92.2.orig/app/app_procs.c 2003-10-24 21:52:32.000000000 +0200 | |
3 | +++ dia-0.92.2/app/app_procs.c 2003-11-19 11:18:08.000000000 +0100 | |
4 | @@ -664,6 +664,7 @@ | |
5 | static void create_user_dirs(void) | |
6 | { | |
7 | gchar *dir, *subdir; | |
8 | + gchar *home_etc = getenv("HOME_ETC"); | |
9 | ||
10 | #ifdef G_OS_WIN32 | |
11 | /* not necessary to quit the program with g_error, everywhere else | |
12 | @@ -675,7 +676,7 @@ | |
13 | return; /* ... and return. Probably removes my one and only FAQ. --HB */ | |
14 | } | |
15 | #endif | |
16 | - dir = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S ".dia", NULL); | |
17 | + dir = g_strconcat(home_etc ? home_etc : g_get_home_dir(), G_DIR_SEPARATOR_S ".dia", NULL); | |
18 | if (mkdir(dir, 0755) && errno != EEXIST) | |
19 | #ifndef G_OS_WIN32 | |
20 | g_error(_("Could not create per-user Dia config directory")); | |
21 | diff -Nru dia-0.92.2.orig/app/preferences.c dia-0.92.2/app/preferences.c | |
22 | --- dia-0.92.2.orig/app/preferences.c 2003-08-31 23:24:55.000000000 +0200 | |
23 | +++ dia-0.92.2/app/preferences.c 2003-11-19 11:16:14.000000000 +0100 | |
24 | @@ -446,8 +446,9 @@ | |
25 | fd = open(filename, O_RDONLY); | |
26 | ||
27 | if (fd < 0) { | |
28 | - const gchar *homedir = g_get_home_dir(); | |
29 | + const gchar *homedir = getenv("HOME_ETC"); | |
30 | ||
31 | + if (!homedir) homedir = g_get_home_dir(); | |
32 | g_free(filename); | |
33 | filename = g_strconcat(homedir, G_DIR_SEPARATOR_S ".diarc", NULL); | |
34 | fd = open(filename, O_RDONLY); | |
35 | diff -Nru dia-0.92.2.orig/lib/dia_dirs.c dia-0.92.2/lib/dia_dirs.c | |
36 | --- dia-0.92.2.orig/lib/dia_dirs.c 2003-04-25 18:34:48.000000000 +0200 | |
37 | +++ dia-0.92.2/lib/dia_dirs.c 2003-11-19 11:16:14.000000000 +0100 | |
38 | @@ -86,9 +86,9 @@ | |
39 | gchar * | |
40 | dia_config_filename(const gchar *subfile) | |
41 | { | |
42 | - const gchar *homedir; | |
43 | + const gchar *homedir = getenv("HOME_ETC"); | |
44 | ||
45 | - homedir = g_get_home_dir(); | |
46 | + if (!homedir) homedir = g_get_home_dir(); | |
47 | if (!homedir) { | |
48 | homedir = g_get_tmp_dir(); /* put config stuff in /tmp -- not ideal, but | |
49 | * we should not reach this state */ | |
50 | diff -Nru dia-0.92.2.orig/plug-ins/python/python-startup.py dia-0.92.2/plug-ins/python/python-startup.py | |
51 | --- dia-0.92.2.orig/plug-ins/python/python-startup.py 2003-01-19 17:38:22.000000000 +0100 | |
52 | +++ dia-0.92.2/plug-ins/python/python-startup.py 2003-11-19 11:24:16.000000000 +0100 | |
53 | @@ -20,9 +20,12 @@ | |
54 | sys.stderr.write('could not import %s\n' % file) | |
55 | ||
56 | # import any python plugins from the user ... | |
57 | -if not os.environ.has_key('HOME'): | |
58 | - os.environ['HOME'] = os.pathsep + 'tmp' | |
59 | -plugindir = os.path.join(os.environ['HOME'], '.dia', 'python') | |
60 | +if os.environ.has_key('HOME_ETC'): | |
61 | + plugindir = os.path.join(os.environ['HOME_ETC'], '.dia', 'python') | |
62 | +else: | |
63 | + if not os.environ.has_key('HOME'): | |
64 | + os.environ['HOME'] = os.pathsep + 'tmp' | |
65 | + plugindir = os.path.join(os.environ['HOME'], '.dia', 'python') | |
66 | ||
67 | if os.path.isdir(plugindir): | |
68 | # import all plugins found in user plugin dir |