From 7000bf919812f3ed56969a86b4aebf90e98ec6a3 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 16 Oct 2015 20:28:27 -0400 Subject: pacman: add user hook directories Signed-off-by: Allan McRae --- src/pacman/pacman.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/pacman/pacman.c') 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 set an alternate architecture\n")); addlist(_(" --cachedir set an alternate package cache location\n")); + addlist(_(" --hookdir set an alternate hook location\n")); addlist(_(" --color colorize the output\n")); addlist(_(" --config 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)); -- cgit v1.2.3-54-g00ecf