Re: Aptitude ?narrow search
On Mon, May 03, 2010 at 11:15:27AM +0300, Panayiotis Karabassis was heard to say: > On 05/03/2010 01:28 AM, Daniel Burrows wrote: > >>To illustrate suppose I want to search for package where a single > >>version matches "~A^unstable$", "A^stable$" and "~i". A search > >>where we expect no results. Yet: > >> > > Why do you expect no results? The three examples you posted below > >look to me like they ought to be returned by that search. > > > So I am getting the results because a single installed version > belongs to both stable and unstable (what I want), or, because an > installed version from stable also has a version from unstable? I am > still a little confused about ?narrows. Each of the packages you listed has a version that's installed and that belongs to both stable and unstable (check packages.debian.org). > aptitude search '~S ~A^unstable$ ~S A^stable$ ~i' > > Does this do a search for installed versions from stable and then > narrows the search to versions from unstable? Or does it do a > search for installed versions from stable *implicitly widens the > match* and then searches for versions from unstable? This appears to be a bit confusing, and the documentation is wrong. ?narrow matches all the versions of a package against its first term. Then it takes its second term and matches it against the versions the first term matched. So in the above line, you find a package in which a version from unstable and from stable is installed. The documentation is wrong because it claims this is identical to what ?any-version does. Incidentally, I recommend using ?any-version for what you're trying to do above; it should do the same thing, but the behavior is more obvious. You can see the difference if you do this: ?narrow(?true, ?and(~A^testing$, ~i)) That will do the same thing as: ?and(~A^testing$, ~i) On the other hand, it's not easy to find examples where ?narrow behaves oddly -- you need to have a filter that matches several versions at once, and all the examples I came up with were contrived (like the one above). If you want a lot more detail about how search works, you can add -o 'aptitude::cmdline::debug-search=true' to the command-line. You'll want to save the output to a file or pipe it through less. Daniel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20100503140640.ga14...@emurlahn.burrows.local
Re: Aptitude ?narrow search
Hi! On 05/03/2010 01:28 AM, Daniel Burrows wrote: To illustrate suppose I want to search for package where a single version matches "~A^unstable$", "A^stable$" and "~i". A search where we expect no results. Yet: Why do you expect no results? The three examples you posted below look to me like they ought to be returned by that search. So I am getting the results because a single installed version belongs to both stable and unstable (what I want), or, because an installed version from stable also has a version from unstable? I am still a little confused about ?narrows. aptitude search '~S ~A^unstable$ ~S A^stable$ ~i' Does this do a search for installed versions from stable and then narrows the search to versions from unstable? Or does it do a search for installed versions from stable *implicitly widens the match* and then searches for versions from unstable? Thanks, Panayiotis -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4bde861f.9020...@gmail.com
Re: Aptitude ?narrow search
On Sun, May 02, 2010 at 12:07:02PM +0300, Panayiotis Karabassis was heard to say: > Hi! Is it possible to combine multiple filters in a ?narrow aptitude search. > For example to search for package where a single version matches all > of ?A, ?B and ?C. Yes. > To illustrate suppose I want to search for package where a single > version matches "~A^unstable$", "A^stable$" and "~i". A search > where we expect no results. Yet: Why do you expect no results? The three examples you posted below look to me like they ought to be returned by that search. Daniel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/2010050808.ga10...@emurlahn.burrows.local
Aptitude ?narrow search
Hi! Is it possible to combine multiple filters in a ?narrow aptitude search. For example to search for package where a single version matches all of ?A, ?B and ?C. To illustrate suppose I want to search for package where a single version matches "~A^unstable$", "A^stable$" and "~i". A search where we expect no results. Yet: $ aptitude search '~S (~A^unstable$~A^stable$) ~i' [...] i time- The GNU time program for measuring cpu res i A tsocks - transparent network access through a SOCKS i twm - Tab window manager $ aptitude search '~S ~A^unstable$ ~S ~A^stable$ ~i' [...] i time- The GNU time program for measuring cpu res i A tsocks - transparent network access through a SOCKS i twm - Tab window manager Thanks, Panayiotis -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4bdd40b6.3040...@gmail.com