]> git.pld-linux.org Git - packages/gentoo.git/blob - gentoo-home_etc.patch
- up to 0.20.7
[packages/gentoo.git] / gentoo-home_etc.patch
1 diff -u -r --from-file=gentoo-0.11.55/ gentoo-0.11.55/src/configure.c gentoo-0.11.55-home_etc/src/configure.c
2 --- gentoo-0.11.55/src/configure.c      2003-10-12 15:45:23.000000000 +0200
3 +++ gentoo-0.11.55-home_etc/src/configure.c     2005-06-24 00:11:12.000000000 +0200
4 @@ -173,14 +173,22 @@
5         guint           i;
6         const CfgModule *page;
7  
8 +       if((home = getenv("HOME_ETC")) != NULL)
9 +       {
10 +               strcpy(rcname, home);
11 +               strcat(rcname, "/" RCNAME);
12 +       }
13 +
14 +       else { 
15         if((home = getenv("HOME")) != NULL)
16         {
17                 strcpy(rcname, home);
18                 strcat(rcname, "/" RCNAME);
19 +
20         }
21         else
22                 return;
23 -
24 +       }
25         cfg_modified_clear(min);
26         if((out = xml_put_open(rcname)) != NULL)
27         {
28 @@ -440,9 +448,15 @@
29         gchar   name[PATH_MAX] = "", *hpath;
30         guint32 i, flags = 0UL;
31  
32 -       if((hpath = getenv("HOME")) != NULL)
33 +       if((hpath = getenv("HOME_ETC")) != NULL) {
34                 g_snprintf(name, sizeof name, "%s" G_DIR_SEPARATOR_S "%s", hpath, RCNAME);
35 -
36 +       }
37 +       else {
38 +       if((hpath = getenv("HOME")) != NULL) {
39 +               g_snprintf(name, sizeof name, "%s" G_DIR_SEPARATOR_S "%s", hpath, RCNAME);
40 +               }
41 +       }
42 +       
43         /* Does the user seem to have a local config? */
44         if(!fut_can_read_named(name))
45                 g_snprintf(name, sizeof name, PATH_CFG G_DIR_SEPARATOR_S "%s", RCNAME + 1);     /* Nope, check for global one. */
46 @@ -464,9 +478,14 @@
47         {
48                 gchar   homename[PATH_MAX] = "", syscfg[PATH_MAX], whine[2 * PATH_MAX];
49  
50 +               if((hpath = getenv("HOME_ETC")) != NULL) {
51 +                       g_snprintf(homename, sizeof homename, "%s/%s", hpath, RCNAME);
52 +               }
53 +               else {
54                 if((hpath = getenv("HOME")) != NULL)
55                         g_snprintf(homename, sizeof homename, "%s/%s", hpath, RCNAME);
56 -
57 +               }
58 +               
59                 g_snprintf(syscfg, sizeof syscfg, PATH_CFG G_DIR_SEPARATOR_S "%s", RCNAME + 1);
60                 g_snprintf(whine, sizeof whine, _("Couldn't find any configuration file; checked\n"
61                                 "both \"%s\" and \"%s\".\n"
This page took 0.058198 seconds and 3 git commands to generate.