summaryrefslogtreecommitdiff
path: root/src/pacman
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-10-30 22:38:56 -0400
committerDave Reisner <dreisner@archlinux.org>2011-11-13 14:19:16 -0500
commit10241a6d766fcebb3dbc930facb3c1b2c6ab4992 (patch)
tree89d2ac8b1e3092749d1d9a3044c73f9ade2448e1 /src/pacman
parent902305f1633298ff0ef7cd2bfbed0e91aae91646 (diff)
add fnmatch support for HoldPkg
Adds test remove031. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'src/pacman')
-rw-r--r--src/pacman/remove.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index e63b5c42..73a583c9 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -20,6 +20,7 @@
#include "config.h"
+#include <fnmatch.h>
#include <stdlib.h>
#include <stdio.h>
@@ -31,6 +32,11 @@
#include "util.h"
#include "conf.h"
+static int fnmatch_cmp(const void *pattern, const void *string)
+{
+ return fnmatch(pattern, string, 0);
+}
+
static int remove_target(const char *target)
{
alpm_pkg_t *pkg;
@@ -134,7 +140,7 @@ int pacman_remove(alpm_list_t *targets)
int holdpkg = 0;
for(i = alpm_trans_get_remove(config->handle); i; i = alpm_list_next(i)) {
alpm_pkg_t *pkg = i->data;
- if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) {
+ if(alpm_list_find(config->holdpkg, alpm_pkg_get_name(pkg), fnmatch_cmp)) {
pm_printf(ALPM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"),
alpm_pkg_get_name(pkg));
holdpkg = 1;