Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=8ded1e12bca5236809415664bd707c208fce0022

commit 8ded1e12bca5236809415664bd707c208fce0022
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date:   Mon Nov 26 00:46:38 2007 +0100

syncpkg(): handle regexs for -S
ie -S openoffice.*hu will install openoffice.org-dict-hu and
openoffice.org-i18n-hu for example

diff --git a/src/pacman-g2/sync.c b/src/pacman-g2/sync.c
index 114cbb3..c1915f9 100644
--- a/src/pacman-g2/sync.c
+++ b/src/pacman-g2/sync.c
@@ -400,6 +400,24 @@ int syncpkg(list_t *targets)
FREELIST(pkgs);
}
}
+                               /* targ is not a group, see if it's a regex */
+                               for(j = pmc_syncs; j; j = j->next) {
+                                       PM_DB *db = j->data;
+                                       PM_LIST *k;
+                                       for(k = pacman_db_getpkgcache(db); k; k 
= pacman_list_next(k)) {
+                                               PM_PKG *p = 
pacman_list_getdata(k);
+                                               char *pkgname = 
pacman_pkg_getinfo(p, PM_PKG_NAME);
+                                               int match = 
pacman_reg_match(pkgname, targ);
+                                               if(match == -1) {
+                                                       ERR(NL, _("could not 
add target '%s': %s\n"), targ, pacman_strerror(pm_errno));
+                                                       retval = 1;
+                                                       goto cleanup;
+                                               } else if(match) {
+                                                       found++;
+                                                       targets = 
list_add(targets, strdup(pkgname));
+                                               }
+                                       }
+                               }
if(!found) {
/* targ not found in sync db, searching for providers... */
PM_LIST *k = NULL;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to