diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-12-08 08:17:41 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-12-08 08:17:41 +0000 |
commit | 716e9ef09591318c415137a521d6391df4c0c955 (patch) | |
tree | a3de7bfa9a345ae1cb2a23f5c9d5f21b1443baf6 /src | |
parent | fc361cc1116b23ec4154bca5e59f562a746b80e6 (diff) |
A few minor updates so --root works again.
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/conf.c | 1 | ||||
-rw-r--r-- | src/pacman/conf.h | 2 | ||||
-rw-r--r-- | src/pacman/pacman.c | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c index ef380580..a429690e 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -53,6 +53,7 @@ int config_free(config_t *config) return(-1); } + FREE(config->root); FREE(config->configfile); FREELIST(config->op_s_ignore); free(config); diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 79f9c0ec..a4bac015 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -23,7 +23,7 @@ typedef struct __config_t { /* command line options */ - const char *root; + char *root; const char *dbpath; const char *cachedir; char *configfile; diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index d99ddc04..0f55ec43 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -356,10 +356,12 @@ static int parseargs(int argc, char *argv[]) config->flags |= PM_TRANS_FLAG_PRINTURIS; break; case 'r': + printf("setting root path=%s\n", optarg); if(realpath(optarg, root) == NULL) { perror(_("bad root path")); return(1); } + config->root = strdup(root); break; case 's': config->op_s_search = 1; @@ -488,7 +490,7 @@ int main(int argc, char *argv[]) #endif if(config->root == NULL) { - config->root = PM_ROOT; + config->root = strdup(PM_ROOT); } /* initialize pm library */ |