Closed rmarquis closed 7 years ago
Even stranger for me...
./expac -S '%r/%n-%v' "expac>7"
extra/expac-8-1
extra/expac-8-1
extra/expac-8-1
extra/expac-8-1
extra/expac-8-1
extra/expac-8-1
extra/expac-8-1
extra/expac-8-1
It seems to have something to do with the number of enabled repos which might indicate a bug in your patch somewhere.
Also, it's a shame that your patch makes "search_exact" not so exact anymore...
Ah, I see. You want alpm_find_satisfier
not alpm_dbs_find_satisfier
.
$ ./expac -S '%r/%n-%v' "expac>7"
extra/expac-8-1
Ultimately, this would be a 1 line change.
diff --git a/expac.c b/expac.c
index d4d51fe..1222d0a 100644
--- a/expac.c
+++ b/expac.c
@@ -649,7 +649,7 @@ static alpm_list_t *search_exact(alpm_list_t *dblist, alpm_list_t *targets)
continue;
}
- pkg = alpm_db_get_pkg(repo, pkgname);
+ pkg = alpm_find_satisfier(alpm_db_get_pkgcache(repo), pkgname);
if(pkg == NULL) {
continue;
}
The real question is whether or not the semantics are appropriate.
Ah, thanks!
The real question is whether or not the semantics are appropriate.
I guess so. I always thought the behavior of expac was somewhat mimicking pacman, so I saw the above as a "missing feature". I might have been wrong here.
If you want to keep the behavior as strictly exact, maybe an optional flag would be appropriate? I'd consider that somewhat feature creep though, since I don't think the purpose of the original behavior has actually changed.
I'm closing this ticket - pacsift actually provides a similar feature, so no need to change semantics here.
Consider the following:
Using expac:
It would be useful to have a similar versining support in expac, as this might avoid the need to do some extra check separately before using expac. Hopefully this is in the scope of expac.
In my local fork, I've replaced
alpm_db_get_pkg()
withalpm_find_dbs_satisfier()
when searching for exact packages, which gives the following results:It works, but for
-S
, the output is doubled - and I cannot find out the reason. Any idea?I've tried passing
r->next
instead ofr
, but while the issue is fixed with-S
, this breaks-Q
.