[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-sourceinstall] patch to allow alternate location for .sourceinstall
From: |
Brian Gough |
Subject: |
[bug-sourceinstall] patch to allow alternate location for .sourceinstall |
Date: |
Sat, 05 Dec 2009 22:21:31 +0000 |
User-agent: |
Wanderlust/2.14.0 (Africa) Emacs/22.2 Mule/5.0 (SAKAKI) |
I think it could be useful to allow the user to set an alternative
location for the .sourceinstall directory. The patch below gives the
environment variable SOURCEINSTALL priority over HOME if it is set,
otherwise the behavior is the same.
Index: srcinst.c
===================================================================
RCS file: /sources/sourceinstall/sourceinstall2/libsrcinst/srcinst.c,v
retrieving revision 1.24
diff -u -r1.24 srcinst.c
--- srcinst.c 8 Dec 2007 15:51:29 -0000 1.24
+++ srcinst.c 5 Dec 2009 22:05:14 -0000
@@ -433,10 +437,14 @@
memset(_srcinst_state.files, 0, sizeof(char *) * SRCINST_FILE_N);
memset(_srcinst_state.dirs, 0, sizeof(char *) * SRCINST_DIR_N);
- if (!(h = getenv("HOME"))) {
- srcinst_warning(SRCINST_ERR_CORE, _("cannot find env variable HOME"),
- 0);
- return 0;
+ if (h = getenv("SOURCEINSTALL")) {
+ /* use SOURCEINSTALL environment variable */
+ } else if (h = getenv("HOME")) {
+ /* use HOME environment variable */
+ } else {
+ srcinst_warning(SRCINST_ERR_CORE, _("cannot find env variable HOME"),
+ 0);
+ return 0;
}
if (!getcwd(buffer, SRCINST_BUFSIZE)) {
- [bug-sourceinstall] patch to allow alternate location for .sourceinstall,
Brian Gough <=