summaryrefslogtreecommitdiffstats
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
authorNathan Jones <nathanj@insightbb.com>2007-11-14 01:32:56 +0100
committerDan McGee <dan@archlinux.org>2007-11-14 03:59:02 +0100
commit46ec9e3548b5b567c7eb18c360f54a77b6313b12 (patch)
tree0fd80f989cf93916e68fbd3e54146eb6516d756e /src/pacman/pacman.c
parent70a91cbb22bb3ec88d518e2e6c43553c53cde318 (diff)
downloadpacman-46ec9e3548b5b567c7eb18c360f54a77b6313b12.tar.gz
pacman-46ec9e3548b5b567c7eb18c360f54a77b6313b12.tar.xz
Make it easier to ignore multiple packages.
This makes --ignore and --ignoregroup able to accept multiple packages/groups by separating each with a comma. For instance: pacman -Su --ignore kernel26,udev,glibc This was requested in the comments of FS#8054. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 9f0293f8..31d31da1 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -315,6 +315,8 @@ static int parseargs(int argc, char *argv[])
};
while((opt = getopt_long(argc, argv, "ARUFQSTr:b:vkhscVfmnoldepituwygz", opts, &option_index))) {
+ alpm_list_t *list = NULL, *item = NULL; /* lists for splitting strings */
+
if(opt < 0) {
break;
}
@@ -327,7 +329,13 @@ static int parseargs(int argc, char *argv[])
}
config->configfile = strndup(optarg, PATH_MAX);
break;
- case 1002: alpm_option_add_ignorepkg(strdup(optarg)); break;
+ case 1002:
+ list = strsplit(optarg, ',');
+ for(item = list; item; item = alpm_list_next(item)) {
+ alpm_option_add_ignorepkg((char *)alpm_list_getdata(item));
+ }
+ FREELIST(list);
+ break;
case 1003:
/* debug levels are made more 'human readable' than using a raw logmask
* here, error and warning are set in config_new, though perhaps a
@@ -371,7 +379,13 @@ static int parseargs(int argc, char *argv[])
}
config->have_logfile = 1;
break;
- case 1010: alpm_option_add_ignoregrp(strdup(optarg)); break;
+ case 1010:
+ list = strsplit(optarg, ',');
+ for(item = list; item; item = alpm_list_next(item)) {
+ alpm_option_add_ignoregrp((char *)alpm_list_getdata(item));
+ }
+ FREELIST(list);
+ break;
case 'A': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_ADD); break;
case 'F':
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_UPGRADE);