]> git.pld-linux.org Git - packages/dia.git/commitdiff
- support for HOME_ETC
authorwitekfl <witekfl@pld-linux.org>
Wed, 19 Nov 2003 23:07:43 +0000 (23:07 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dia-home_etc.patch -> 1.1

dia-home_etc.patch [new file with mode: 0644]

diff --git a/dia-home_etc.patch b/dia-home_etc.patch
new file mode 100644 (file)
index 0000000..a4dddc9
--- /dev/null
@@ -0,0 +1,68 @@
+diff -Nru dia-0.92.2.orig/app/app_procs.c dia-0.92.2/app/app_procs.c
+--- dia-0.92.2.orig/app/app_procs.c    2003-10-24 21:52:32.000000000 +0200
++++ dia-0.92.2/app/app_procs.c 2003-11-19 11:18:08.000000000 +0100
+@@ -664,6 +664,7 @@
+ static void create_user_dirs(void)
+ {
+   gchar *dir, *subdir;
++      gchar *home_etc = getenv("HOME_ETC");
+ #ifdef G_OS_WIN32
+   /* not necessary to quit the program with g_error, everywhere else
+@@ -675,7 +676,7 @@
+     return; /* ... and return. Probably removes my one and only FAQ. --HB */
+   }
+ #endif
+-  dir = g_strconcat(g_get_home_dir(), G_DIR_SEPARATOR_S ".dia", NULL);
++  dir = g_strconcat(home_etc ? home_etc : g_get_home_dir(), G_DIR_SEPARATOR_S ".dia", NULL);
+   if (mkdir(dir, 0755) && errno != EEXIST)
+ #ifndef G_OS_WIN32
+     g_error(_("Could not create per-user Dia config directory"));
+diff -Nru dia-0.92.2.orig/app/preferences.c dia-0.92.2/app/preferences.c
+--- dia-0.92.2.orig/app/preferences.c  2003-08-31 23:24:55.000000000 +0200
++++ dia-0.92.2/app/preferences.c       2003-11-19 11:16:14.000000000 +0100
+@@ -446,8 +446,9 @@
+   fd = open(filename, O_RDONLY);
+   if (fd < 0) {
+-    const gchar *homedir = g_get_home_dir();
++    const gchar *homedir = getenv("HOME_ETC");
++              if (!homedir) homedir = g_get_home_dir();
+     g_free(filename);
+     filename = g_strconcat(homedir, G_DIR_SEPARATOR_S ".diarc", NULL);
+     fd = open(filename, O_RDONLY);
+diff -Nru dia-0.92.2.orig/lib/dia_dirs.c dia-0.92.2/lib/dia_dirs.c
+--- dia-0.92.2.orig/lib/dia_dirs.c     2003-04-25 18:34:48.000000000 +0200
++++ dia-0.92.2/lib/dia_dirs.c  2003-11-19 11:16:14.000000000 +0100
+@@ -86,9 +86,9 @@
+ gchar *
+ dia_config_filename(const gchar *subfile)
+ {
+-  const gchar *homedir;
++  const gchar *homedir = getenv("HOME_ETC");
+-  homedir = g_get_home_dir();
++  if (!homedir) homedir = g_get_home_dir();
+   if (!homedir) {
+     homedir = g_get_tmp_dir(); /* put config stuff in /tmp -- not ideal, but
+                               * we should not reach this state */
+diff -Nru dia-0.92.2.orig/plug-ins/python/python-startup.py dia-0.92.2/plug-ins/python/python-startup.py
+--- dia-0.92.2.orig/plug-ins/python/python-startup.py  2003-01-19 17:38:22.000000000 +0100
++++ dia-0.92.2/plug-ins/python/python-startup.py       2003-11-19 11:24:16.000000000 +0100
+@@ -20,9 +20,12 @@
+               sys.stderr.write('could not import %s\n' % file)
+ # import any python plugins from the user ...
+-if not os.environ.has_key('HOME'):
+-    os.environ['HOME'] = os.pathsep + 'tmp'
+-plugindir = os.path.join(os.environ['HOME'], '.dia', 'python')
++if os.environ.has_key('HOME_ETC'):
++    plugindir = os.path.join(os.environ['HOME_ETC'], '.dia', 'python')
++else:
++    if not os.environ.has_key('HOME'):
++        os.environ['HOME'] = os.pathsep + 'tmp'
++    plugindir = os.path.join(os.environ['HOME'], '.dia', 'python')
+ if os.path.isdir(plugindir):
+     # import all plugins found in user plugin dir
This page took 0.098434 seconds and 4 git commands to generate.