diff options
-rw-r--r-- | lib/libalpm/db.c | 13 | ||||
-rw-r--r-- | scripts/repo-add.sh.in | 6 |
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 6749ab1e..6865cd5a 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -398,10 +398,10 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles) else if (desc && regexec(®, desc, 0, 0, 0) == 0) { matched = desc; } - /* check provides */ /* TODO: should we be doing this, and should we print something * differently when we do match it since it isn't currently printed? */ - else { + if(!matched) { + /* check provides */ for(k = alpm_pkg_get_provides(pkg); k; k = k->next) { if (regexec(®, k->data, 0, 0, 0) == 0) { matched = k->data; @@ -409,6 +409,15 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles) } } } + if(!matched) { + /* check groups */ + for(k = alpm_pkg_get_groups(pkg); k; k = k->next) { + if (regexec(®, k->data, 0, 0, 0) == 0) { + matched = k->data; + break; + } + } + } if(matched != NULL) { _alpm_log(PM_LOG_DEBUG, " search target '%s' matched '%s'\n", diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 7c12aaf2..5454fb0c 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -193,7 +193,7 @@ db_write_entry() # read info from the zipped package local line var val - for line in $(bsdtar -xOf "$pkgfile" .PKGINFO | + for line in $(bsdtar -xOqf "$pkgfile" .PKGINFO | grep -v '^#' | sed 's|\(\w*\)\s*=\s*\(.*\)|\1 \2|'); do # bash awesomeness here- var is always one word, val is everything else var=${line%% *} @@ -305,7 +305,7 @@ check_repo_db() fi if [ -f "$REPO_DB_FILE" ]; then - if ! (bsdtar -tf "$REPO_DB_FILE" | grep -q "/desc"); then + if ! bsdtar -tqf "$REPO_DB_FILE" '*/desc' 2>&1 >/dev/null; then error "$(gettext "Repository file '%s' is not a proper pacman database.")" "$REPO_DB_FILE" exit 1 fi @@ -351,7 +351,7 @@ add() fi pkgfile=$1 - if ! bsdtar -tf "$pkgfile" .PKGINFO 2>&1 >/dev/null; then + if ! bsdtar -tqf "$pkgfile" .PKGINFO 2>&1 >/dev/null; then error "$(gettext "'%s' is not a package file, skipping")" "$pkgfile" return 1 fi |