[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about how "aptitude search" is used



On Wed, Apr 16, 2008 at 08:02:21 -0700, Andrew Sackville-West wrote:
> On Tue, Apr 15, 2008 at 09:57:48PM -0700, Daniel Burrows wrote:
> > On Wed, Apr 16, 2008 at 12:38:46AM +0900, Osamu Aoki was heard to say:
> ...
> 
> > > You need to tell in NEWS file that local scripts need to add "~n" before
> > > serch string to make it act as before under the new version.
> > 
> >   My question was: are there any such local scripts?  It seems possible
> > to me that someone might have written a script that uses aptitude this
> > way, but I had trouble coming up with an actual reason I'd do that,
> > especially since the output from "aptitude search" is notably bad for
> > scripting.
> > 
> 
> I've hesitated to respond for just this issue. I can't come up with
> any good reason to script an aptitude search. Mainly because, what the
> heck would you do with the output in a script? If you parse the output
> to find a particular package, that sort of implies that you already
> know what the package is and could just (install|hold|purge|whatever)
> it anyway without bothering to search for it. 
> 
> I'm sure now I'll be called out and several will pipe up with myriad
> uses for aptitude search in a script... but that would be good as it's
> what you want.
> 
> IOW, IMO, I think you're pretty safe to move ahead. Probably a direct
> email to Florian Kuzler would suffice since he seems to be the master
> of arbitrarily complex aptitude search expressions....

You are exaggerating greatly, but anyway, here are my two cents:

I don't use aptitude search commands in any scripts. If somebody does,
then I would expect those to be specialized queries for which people
will take care to specify all the operators (e.g. the "~i!~M" example
posted earlier). Everyone uses "apt-cache search -n" for simple searches
in package names anyway, because it is faster, right? A reason to prefer
aptitude in that case might be that someone wants to make their script
simpler by letting aptitude's output formatting options do some work
that would otherwise have to be done by piping the output to sed or awk.
My feeling is that such a person would be likely to specify "~n"
explicitly anyway in their scripts, even though it is currently not
necessary.

-- 
Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |


Reply to: