summaryrefslogtreecommitdiff
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-10-16 20:28:27 -0400
committerAllan McRae <allan@archlinux.org>2015-10-18 10:59:23 +1000
commit7000bf919812f3ed56969a86b4aebf90e98ec6a3 (patch)
tree0cbf71072c97a77a5a65d8f15c7b508f078313d5 /src/pacman/pacman.c
parente8e872c8f93ba13f67b882d64c16606973f0ff67 (diff)
downloadpacman-7000bf919812f3ed56969a86b4aebf90e98ec6a3.tar.xz
pacman: add user hook directories
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index c680067c..d777663d 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -210,6 +210,7 @@ static void usage(int op, const char * const myname)
addlist(_(" -v, --verbose be verbose\n"));
addlist(_(" --arch <arch> set an alternate architecture\n"));
addlist(_(" --cachedir <dir> set an alternate package cache location\n"));
+ addlist(_(" --hookdir <dir> set an alternate hook location\n"));
addlist(_(" --color <when> colorize the output\n"));
addlist(_(" --config <path> set an alternate configuration file\n"));
addlist(_(" --debug display debug messages\n"));
@@ -463,6 +464,9 @@ static int parsearg_global(int opt)
free(config->gpgdir);
config->gpgdir = strdup(optarg);
break;
+ case OP_HOOKDIR:
+ config->hookdirs = alpm_list_add(config->hookdirs, strdup(optarg));
+ break;
case OP_LOGFILE:
free(config->logfile);
config->logfile = strndup(optarg, PATH_MAX);
@@ -959,6 +963,7 @@ static int parseargs(int argc, char *argv[])
{"noscriptlet", no_argument, 0, OP_NOSCRIPTLET},
{"ask", required_argument, 0, OP_ASK},
{"cachedir", required_argument, 0, OP_CACHEDIR},
+ {"hookdir", required_argument, 0, OP_HOOKDIR},
{"asdeps", no_argument, 0, OP_ASDEPS},
{"logfile", required_argument, 0, OP_LOGFILE},
{"ignoregroup", required_argument, 0, OP_IGNOREGROUP},
@@ -1274,6 +1279,11 @@ int main(int argc, char *argv[])
printf("%s ", (const char *)j->data);
}
printf("\n");
+ printf("Hook Dirs : ");
+ for(j = alpm_option_get_hookdirs(config->handle); j; j = alpm_list_next(j)) {
+ printf("%s ", (const char *)j->data);
+ }
+ printf("\n");
printf("Lock File : %s\n", alpm_option_get_lockfile(config->handle));
printf("Log File : %s\n", alpm_option_get_logfile(config->handle));
printf("GPG Dir : %s\n", alpm_option_get_gpgdir(config->handle));