]> git.pld-linux.org Git - packages/poldek.git/blame - poldek-etc_dir.patch
- _pld_alt_arch definition must be at the top
[packages/poldek.git] / poldek-etc_dir.patch
CommitLineData
f28c907c 1diff -Nru poldek-0.18.1/conf.c poldek-0.18.1.new/conf.c
2--- poldek-0.18.1/conf.c Fri Oct 18 16:19:42 2002
3+++ poldek-0.18.1.new/conf.c Mon Mar 10 07:39:16 2003
4@@ -374,14 +374,23 @@
5 tn_hash *ldconf_deafult(void)
6 {
7 char *homedir;
8+ char *etc_dir;
9 char *etcpath = "/etc/poldek.conf";
10
11- if ((homedir = getenv("HOME")) != NULL) {
de1099c4 12+ if ((etc_dir = getenv("HOME_ETC")) != NULL) {
f28c907c 13+ char path[PATH_MAX];
14+
de1099c4 15+ snprintf(path, sizeof(path), "%s/.poldekrc", etc_dir);
f28c907c 16+ if (access(path, R_OK) == 0)
17+ return ldconf(path);
18+ } else {
19+ if ((homedir = getenv("HOME")) != NULL) {
20 char path[PATH_MAX];
21
22 snprintf(path, sizeof(path), "%s/.poldekrc", homedir);
23 if (access(path, R_OK) == 0)
24 return ldconf(path);
25+ }
26 }
27
28 if (access(etcpath, R_OK) == 0)
29diff -Nru poldek-0.18.1/pkgscore.c poldek-0.18.1.new/pkgscore.c
30--- poldek-0.18.1/pkgscore.c Fri Nov 22 17:08:53 2002
31+++ poldek-0.18.1.new/pkgscore.c Mon Mar 10 07:44:02 2003
32@@ -40,26 +40,46 @@
33
34 if (fpath == NULL) {
35 char *homedir;
36+ char *etc_dir;
37
38- if ((homedir = getenv("HOME")) == NULL)
de1099c4 39+ if ((etc_dir = getenv("HOME_ETC")) != NULL) {
f28c907c 40+ switch (type) {
41+ case PKG_HELD:
de1099c4 42+ snprintf(path, sizeof(path), "%s/.poldek-hold", etc_dir);
f28c907c 43+ if (access(path, R_OK) != 0) /* backward compat */
de1099c4 44+ snprintf(path, sizeof(path), "%s/.poldek_hold", etc_dir);
f28c907c 45+
46+ break;
47+
48+ case PKG_IGNORED:
de1099c4 49+ snprintf(path, sizeof(path), "%s/.poldek-ignore", etc_dir);
f28c907c 50+ break;
51+
52+ default:
53+ n_assert(0);
54+ break;
55+ }
56+ } else {
57+ if ((homedir = getenv("HOME")) == NULL)
58 return NULL;
59
60- switch (type) {
61- case PKG_HELD:
62- snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
63- if (access(path, R_OK) != 0) /* backward compat */
64+ switch (type) {
65+ case PKG_HELD:
66+ snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
67+ if (access(path, R_OK) != 0) /* backward compat */
68 snprintf(path, sizeof(path), "%s/.poldek_hold", homedir);
69-
70- break;
71+
72+ break;
73+
74+ case PKG_IGNORED:
75+ snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
76+ break;
77
78- case PKG_IGNORED:
79- snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
80- break;
81-
82- default:
83- n_assert(0);
84- break;
85- }
86+ default:
87+ n_assert(0);
88+ break;
89+ }
90+ }
91
92 if (access(path, R_OK) != 0)
93 return patterns;
94diff -Nru poldek-0.18.1/shell/shell.c poldek-0.18.1.new/shell/shell.c
95--- poldek-0.18.1/shell/shell.c Tue Oct 29 16:55:58 2002
96+++ poldek-0.18.1.new/shell/shell.c Mon Mar 10 07:50:21 2003
97@@ -1226,7 +1226,7 @@
98
99 int shell_main(struct pkgset *ps, struct inst_s *inst, int skip_installed)
100 {
101- char *line, *s, *home;
102+ char *line, *s, *home, *etc_dir;
103
104
105 if (!isatty(fileno(stdout))) {
106@@ -1240,12 +1240,19 @@
107 initialize_readline();
108 histfile = NULL;
109
110- if ((home = getenv("HOME"))) {
de1099c4
JB
111+ if ((etc_dir = getenv("HOME_ETC"))) {
112+ int len = strlen(etc_dir) + strlen("/.poldek_history") + 2;
f28c907c 113+ histfile = alloca(len);
de1099c4 114+ snprintf(histfile, len, "%s/.poldek_history", etc_dir);
f28c907c 115+ read_history(histfile);
116+ } else {
117+ if ((home = getenv("HOME"))) {
118 int len = strlen(home) + strlen("/.poldek_history") + 2;
119 histfile = alloca(len);
120 snprintf(histfile, len, "%s/.poldek_history", home);
121 read_history(histfile);
122- }
123+ }
124+ }
125
126 sigint_init();
127 sigint_reached_cb = sigint_reached_fn;
This page took 0.060653 seconds and 4 git commands to generate.