1 diff -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
5 tn_hash *ldconf_deafult(void)
9 char *etcpath = "/etc/poldek.conf";
11 - if ((homedir = getenv("HOME")) != NULL) {
12 + if ((config_dir = getenv("CONFIG_DIR")) != NULL) {
13 + char path[PATH_MAX];
15 + snprintf(path, sizeof(path), "%s/poldekrc", config_dir);
16 + if (access(path, R_OK) == 0)
17 + return ldconf(path);
19 + if ((homedir = getenv("HOME")) != NULL) {
22 snprintf(path, sizeof(path), "%s/.poldekrc", homedir);
23 if (access(path, R_OK) == 0)
28 if (access(etcpath, R_OK) == 0)
29 diff -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
38 - if ((homedir = getenv("HOME")) == NULL)
39 + if ((config_dir = getenv("CONFIG_DIR")) != NULL) {
42 + snprintf(path, sizeof(path), "%s/poldek-hold", config_dir);
43 + if (access(path, R_OK) != 0) /* backward compat */
44 + snprintf(path, sizeof(path), "%s/poldek_hold", config_dir);
49 + snprintf(path, sizeof(path), "%s/poldek-ignore", config_dir);
57 + if ((homedir = getenv("HOME")) == NULL)
62 - snprintf(path, sizeof(path), "%s/.poldek-hold", homedir);
63 - if (access(path, R_OK) != 0) /* backward compat */
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);
75 + snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
79 - snprintf(path, sizeof(path), "%s/.poldek-ignore", homedir);
92 if (access(path, R_OK) != 0)
94 diff -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
99 int shell_main(struct pkgset *ps, struct inst_s *inst, int skip_installed)
101 - char *line, *s, *home;
102 + char *line, *s, *home, *config_dir;
105 if (!isatty(fileno(stdout))) {
106 @@ -1240,12 +1240,19 @@
107 initialize_readline();
110 - if ((home = getenv("HOME"))) {
111 + if ((config_dir = getenv("CONFIG_DIR"))) {
112 + int len = strlen(config_dir) + strlen("/poldek_history") + 2;
113 + histfile = alloca(len);
114 + snprintf(histfile, len, "%s/poldek_history", config_dir);
115 + read_history(histfile);
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);
127 sigint_reached_cb = sigint_reached_fn;