[Aptitude-devel] Bug#720750: aptitude: search returns different numbers of packages depending on sort order

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Tue Feb 4 22:49:42 UTC 2014


Control: tags -1 + pending

2014-02-03 Daniel Hartwig <mandyke at gmail.com>:
> The search results will now include duplicate packages where there are
> multiple search patterns matching the same package:
>
> $ ./aptitude search '?name(^emacs24)' '?name(^emacs24)'
> p   emacs24                         - GNU Emacs editor (with GTK+ user interface
> p   emacs24                         - GNU Emacs editor (with GTK+ user interface
> [...]
>
> (That example is obviously contrived, but it is quite common for
> multiple patterns to have overlapping matches.)

Funnily enough, it also depends on how the search patterns are given,
if in different argumensts or not...

$ ./src/aptitude search '?name(^emacs24$) ?name(^emacs24$)' -F '%p'
emacs24
emacs24:i386

$ ./src/aptitude search '?name(^emacs24$)' '?name(^emacs24$)' -F '%p'
emacs24
emacs24
emacs24:i386
emacs24:i386

With overlapping patterns...

$ ./src/aptitude search '?name(^emacs24$)
?and(?name(^emacs),?name(24$))' -F '%p'
emacs24
emacs24:i386

$ ./src/aptitude search '?name(^emacs24$)'
'?and(?name(^emacs),?name(24$))' -F '%p'
emacs24
emacs24
emacs24:i386
emacs24:i386


After the fix:

$ ./src/aptitude search '~n^emacs24$' '?and(~n^emacs,~n24$)' -F '%p'
emacs24
emacs24:i386

$ ./src/aptitude search '~n^emacs24$ ?and(~n^emacs,~n24$)' -F '%p'
emacs24
emacs24:i386


Fix:

http://anonscm.debian.org/gitweb/?p=aptitude/aptitude.git;a=commitdiff;h=435bcc75b3c2a3132ee4d6ca632346d6f8b6fa34


Cheers.
-- 
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>



More information about the Aptitude-devel mailing list