You are not logged in.

#1 2006-12-17 18:38:51

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

psearch - Gentoo's esearch Arch style [revision]

First and foremost, I really don't want to start any sort of Gentoo vs. Arch war--it is not my intention at all. I also don't want to start another "pacman needs color!" thread.

I do, however, want to acknowledge that different users have different desires. For some, pacman is perfect. For others, it'd be nice to have colored output and different output formats to make the search results more readable, especially if there are a lot of results. I originally wrote the pak script to remedy such things, but I think that it lacks in a lot of respects.

I have just finished writing psearch, a python script that allows Arch users to do some of the same things that esearch lets Gentoo users do. Some of the features are:

- Gives color output if you want it (you can turn it off if you don't)
- Can do a verbose search with a lot of package information, or a compact one that uses only one line per package (helpful if there are a lot of results)
- Searches AUR if you want.
- Allows a strict search. Pacman matches package names and descriptions for results. Psearch allows you to search package names only if you so desire.
- Search only a single repository, not all of them.
- Only search for packages that are installed
- Only search for packages that are not installed
- Only search for packages that are installed and a newer version is available.
- Reverse search results (again, helpful if there are a lot of results. This will show the first results last and the last results first).
- Omit a string. Ever do a search for KDE and get the 50+ localization packages in your results? You can omit those from the results.
- Using the --info argument, psearch will display the current version of pacman, the size of the pacman cache on your hard drive, and all repository names, number of available packages, and last update.
- Not happy with pacman's output format or the default psearch output format? Or you like pacman's output but wish it'd show the installed version? Use the --format argument and define your own output.

As you can see, there is a lot you can do to manipulate and/or refine a pacman search using psearch. I hope you can make use of it. You can find it in AUR hereif you'd like to give it a try.

Last edited by wrythe (2007-05-26 22:37:52)


psearch - manipulate and refine pacman searches

Offline

#2 2006-12-18 00:03:31

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: psearch - Gentoo's esearch Arch style [revision]

Can psearch do search with two or more words?

to search kde cd/dvd burning software:
$ psearch kde burn

Or is there any other package search that can do this? Omit is useful, but I would like to search two or more matches per package.

Offline

#3 2006-12-18 00:18:59

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

Purch wrote:

Can psearch do search with two or more words?

to search kde cd/dvd burning software:
$ psearch kde burn

Or is there any other package search that can do this? Omit is useful, but I would like to search two or more matches per package.

That's a good idea. I can see if I can implement it. You can, however, just grep the results (I used to do it in Gentoo a lot with esearch). You have to use the compact output though.

psearch -c kde | grep -i burn

psearch - manipulate and refine pacman searches

Offline

#4 2006-12-18 01:15:56

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

Purch wrote:

Can psearch do search with two or more words?

OK, I didn't think it would be too difficult, so I started toying with it right away (like I said before, it's a good idea). It appears to be working, though I haven't given it a lot of testing. There is a new version in AUR now that will let you search as many keywords as you want.

psearch keyword1 keyword2 keyword3 keyword4 # etc...

psearch - manipulate and refine pacman searches

Offline

#5 2006-12-18 15:39:50

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: psearch - Gentoo's esearch Arch style [revision]

Sweet, have to test it and big thanks  big_smile

Offline

#6 2007-01-07 22:20:43

lateralus_
Member
From: Belgium
Registered: 2007-01-07
Posts: 17

Re: psearch - Gentoo's esearch Arch style [revision]

Thanks for this application : I was just switching from gentoo to arch and psearch is always welcomed  wink

Is it possible to also include the homepage of the applications like in esearch ?


There are a lot of lies going around.... and half of them are true.
        -- Winston Churchill

Offline

#7 2007-01-07 23:26:54

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

lateralus_ wrote:

Thanks for this application : I was just switching from gentoo to arch and psearch is always welcomed  wink

Is it possible to also include the homepage of the applications like in esearch ?

Thanks, I'm glad you're enjoying it wink Pacman only stores package URLs for installed packages, so there is no way for psearch to display the URL for all packages. It's something that I wanted to include, but I haven't found a way around it yet.


psearch - manipulate and refine pacman searches

Offline

#8 2007-01-13 04:39:18

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

An upgrade of psearch is now available in AUR. It now displays "local" packages (packages not associated with any defined repository), displays single package information (like pacman -Qi), and file owner information (like pacman -Qo). The package information is basically a colored version of what is displayed by doing a regular pacman -Qi; However, the file owner information is more verbose than a pacman -Qo.

For example,

# pacman -Qo /usr/bin/pacman
/usr/bin/pacman is owned by pacman 2.9.8-4

# psearch --owns /usr/bin/pacman
 > /usr/bin/pacman is owned by:
   Package name      : pacman
   Package version   : 2.9.8-4
   Packaged by       : Tobias Powalowski  <tpowa>
   Homepage          : http://www.archlinux.org/pacman
   License           : None
   Architecture      : i686
   Installed size    : 1.0 MB
   Build date        : Sun Dec 31 09:05:08 2006
   Install date      : Mon Jan  1 15:27:41 2007
   Reason installed  : Explicity installed
   Provides          : None
   Dependencies      : None
   Required by       : None
   Conflicts with    : None
   Description       : A .tar.gz based package manager with dependency support

Please let me know if there are any bugs in these new features or if you have any recommendations for new features or modifications.


psearch - manipulate and refine pacman searches

Offline

#9 2007-01-13 17:09:41

zen_guerrilla
Member
From: Greece
Registered: 2002-12-22
Posts: 259

Re: psearch - Gentoo's esearch Arch style [revision]

Nice tool, wrythe.

Offline

#10 2007-01-17 20:37:14

Mozz
Member
From: Finland
Registered: 2006-08-11
Posts: 22

Re: psearch - Gentoo's esearch Arch style [revision]

Thanks, this is very useful especially when searching from AUR.

Offline

#11 2007-02-10 20:34:13

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

Just fixed a bug that showed 'local' packages when using the --rep flag (oops, how embarassing wink)

Thanks again everyone for your feedback and support. Please don't hesitate to contact me or post here if you have any further bug encounters or suggestions.


psearch - manipulate and refine pacman searches

Offline

#12 2007-02-24 23:36:07

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

A few bug fixes concerning the --strict argument have been fixed (see AUR comment page for details). The use of ^ and $ in searches is now also supported.

P.S. Up to 16 votes! Thanks guys smile


psearch - manipulate and refine pacman searches

Offline

#13 2007-02-25 05:26:27

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: psearch - Gentoo's esearch Arch style [revision]

Thank you for this tool! And keep up your great work!

Offline

#14 2007-03-20 18:57:43

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

New build up in AUR

+ Fixed the PKGBUILD with the rest of Snowman's recommendations (thank you!). Also added 'pacman=2.9.8' as a dependency since the dev version of pacman3 is floating around.

+ Changed all 'white' colors to 'bold' in hopes of not interfering with users that use a light background in their terminal.

+ Added argument -X (--boldonly) to display no colors, but to keep bolded text (a feature request I saw for yaourt that I thought would be good to implement.)

+ Fixed a quirk with AUR searches that caused psearch to crap out if an AUR package had a funky version (this would specifically happen when searching key term 'beryl')

+ Cleaned up the code a bit. I've learned a thing or two more about Python since I first wrote this smile


psearch - manipulate and refine pacman searches

Offline

#15 2007-03-20 21:10:29

grizz
Member
Registered: 2007-03-14
Posts: 49
Website

Re: psearch - Gentoo's esearch Arch style [revision]

Great work smile


http://galeria.firlej.org 
Voiceless it cries,Wingless flutters,Toothless bites,Mouthless mutters.
http://grizz.pl

Offline

#16 2007-03-24 17:13:17

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

I removed the pacman version dependency from the PKGBUILD. I have tested it with pacman3 and it works fine. The only problem you may experience is extraneous results when using the --strict option since group names are printed alongside package name and version.


psearch - manipulate and refine pacman searches

Offline

#17 2007-05-14 16:48:39

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

+ Adapted psearch to pacman3. If a package belongs to a group, pacman3 will display the group name next to the package name; this caused some extraneous results when doing a "strict" search with psearch.

+ Changed some of the bold output to regular output (it just seemed like it was too much)

+ Changed the way package information is looked up and used using the "-p" argument.


psearch - manipulate and refine pacman searches

Offline

#18 2007-05-26 22:39:09

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

psearch has been completely rewritten. AUR searches are now performed using python modules, not wget. Searches are also done by accessing pacman's database directly. This means that no `pacman` command is performed whatsoever. Results can be a little faster or slower at times because of this, but  the speed difference is negligible either way. The biggest speed difference is AUR searches -- much faster now.

+ --listfiles command added (like pacman -Ql <package>)

+ --allpackages command added (like pacman -Sl <repository>)

+ --group command added (like pacman -Sg <group>)

Please let me know if you run into any bugs. Seeing as this is a very new and fresh version, I'm sure there are some lurking out there somewhere.


psearch - manipulate and refine pacman searches

Offline

#19 2007-06-06 04:52:46

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

Another pretty big update. Psearch is now a Python module with a supplementary script. This means that you can either create your own script and let the module do the dirty work, or continue to use the psearch script itself.


psearch - manipulate and refine pacman searches

Offline

#20 2007-07-30 09:43:40

gour
Member
From: Croatia
Registered: 2007-07-28
Posts: 67

Re: psearch - Gentoo's esearch Arch style [revision]

Hi!

wrythe wrote:

Thanks, I'm glad you're enjoying it wink Pacman only stores package URLs for installed packages, so there is no way for psearch to display the URL for all packages. It's something that I wanted to include, but I haven't found a way around it yet.

2nd day with Arch (after 5 years with Gentoo) and I'm already enjoying psearch big_smile

However, I'd also like to see URL, but I do not find a way to get it even for installed packages hmm

Do I miss something?

Sincerely,
Gour

Offline

#21 2007-08-23 16:26:42

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

gour wrote:

Hi!

wrythe wrote:

Thanks, I'm glad you're enjoying it wink Pacman only stores package URLs for installed packages, so there is no way for psearch to display the URL for all packages. It's something that I wanted to include, but I haven't found a way around it yet.

2nd day with Arch (after 5 years with Gentoo) and I'm already enjoying psearch big_smile

However, I'd also like to see URL, but I do not find a way to get it even for installed packages hmm

Do I miss something?

Sincerely,
Gour

Sorry for the super late reply. I've been kind of out of the loop lately. Anyway, since I couldn't get the URL to work with all packages I just decided to leave the feature out. Maybe I'll add it for installed packages in the next update. The psearch module will pull the URL for installed packages, so if you want to make your own script then that information is available, I just haven't incorporated it in the default script.


psearch - manipulate and refine pacman searches

Offline

#22 2007-08-30 05:39:11

gour
Member
From: Croatia
Registered: 2007-07-28
Posts: 67

Re: psearch - Gentoo's esearch Arch style [revision]

wrythe wrote:

Sorry for the super late reply. I've been kind of out of the loop lately. Anyway, since I couldn't get the URL to work with all packages I just decided to leave the feature out. Maybe I'll add it for installed packages in the next update. The psearch module will pull the URL for installed packages, so if you want to make your own script then that information is available, I just haven't incorporated it in the default script.

Thank you for reply.

Yes, I'd like to see that feature in psearch, at least for installed packages - it reminds me on the old days spent with eix & Gentoo big_smile


Sincerely,
Gour

Offline

#23 2007-08-30 13:27:20

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: psearch - Gentoo's esearch Arch style [revision]

Wow! This is a very useful tool for me, thanks a lot! smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#24 2007-09-01 22:06:21

wrythe
Member
From: Seattle, WA
Registered: 2006-08-15
Posts: 80

Re: psearch - Gentoo's esearch Arch style [revision]

gour wrote:

Yes, I'd like to see that feature in psearch, at least for installed packages - it reminds me on the old days spent with eix & Gentoo big_smile

Just updated it. URLs are now displayed for installed packages.


psearch - manipulate and refine pacman searches

Offline

#25 2007-09-02 06:23:55

gour
Member
From: Croatia
Registered: 2007-07-28
Posts: 67

Re: psearch - Gentoo's esearch Arch style [revision]

wrythe wrote:

Just updated it. URLs are now displayed for installed packages.

Thanks a lot wink

Did I miss AUR feed or it was not announced?


Sincerely,
Gour

Offline

Board footer

Powered by FluxBB