Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Perl script for fast package queries. [UPDATE]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
52midnight
Apprentice
Apprentice


Joined: 20 Mar 2012
Posts: 176
Location: Brisbane AU

PostPosted: Tue Mar 26, 2013 9:19 pm    Post subject: Perl script for fast package queries. [UPDATE] Reply with quote

Gentoo provides gentoolkit and portage-utils which, along with the many options of emerge, consitute a package management system. All run rather slowly on my old hardware, and lack features that I wanted, so I've written a Perl script to fill my needs. It does the following:

- Creates and displays text listfiles of all packages in /usr/portage/, /usr/portage/packages/ and /var/db/pkg/.
- Displays group lists for the same directories.
- Searches for a package name in the lists.
- Creates an HTML synopsis of /var/log/emerge.log with human-readable times and durations.
- Fetches and parses a Znurt Category page into a brief HTML list with clickable links to each Znurt package page.

I've found it very useful during installation and setup of new Gentoo partitions, and thought others might find it equally so. If you'd like to try it, go to:

http://52midnight.com/gentoo/code/g.html

I'm in the final debugging stages, to it's a good time to report any bugs or suggest improvements (within reason - I'm an avid practitioner of the Three Perl Virtues; laziness, impatience, and hubris).

Edit 2014-02-19: Amended URL to new location.


Last edited by 52midnight on Tue Feb 18, 2014 8:00 pm; edited 3 times in total
Back to top
View user's profile Send private message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Wed Mar 27, 2013 1:30 am    Post subject: Re: Perl script for fast package queries. Reply with quote

52midnight wrote:
I'm an avid practitioner of the Three Perl Virtues; laziness, impatience, and hubris).


You would be a great addition to the Perl Team, seriously, they could use your help, ping tove on #gentoo-perl :)
_________________
http://dev.gentoo.org/~dabbott/
Back to top
View user's profile Send private message
52midnight
Apprentice
Apprentice


Joined: 20 Mar 2012
Posts: 176
Location: Brisbane AU

PostPosted: Wed Mar 27, 2013 1:43 am    Post subject: Reply with quote

Thanks for the accolade, but at the risk of destroying my new-found celebrity, I'm not sure how to do that. Is it an IRC channel, or a twitter account?

Be happy to help out; my new Gentoo installation is a delight, and immediately more productive than the trusty PCLOS system I've been using for years.

Edit a few minutes later. Think I've got it figured. Logged in at freenode.org to #gentoo-perl and found a 'tove' in the users' list, though whether he's a scion of the infamous Slithy family I'm unsure. Awaiting response.


Last edited by 52midnight on Thu Mar 28, 2013 10:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Wed Mar 27, 2013 2:18 am    Post subject: Reply with quote

52midnight,

Very nice - thanks for sharing :D
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
52midnight
Apprentice
Apprentice


Joined: 20 Mar 2012
Posts: 176
Location: Brisbane AU

PostPosted: Thu Mar 28, 2013 10:13 pm    Post subject: Reply with quote

For those who've downloaded it, I've uploaded updates to the script and instructions with bug fixes and improvements. Works OK as far as I can tell.

I won't bother this forum with any more changes; if you've anything further, please email or PM me. Thanks to all interested and who contributed to its development.
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Mon Feb 17, 2014 6:25 am    Post subject: Re: Perl script for fast package queries. [UPDATE] Reply with quote

52midnight wrote:
Gentoo provides gentoolkit and portage-utils which, along with the many options of emerge, consitute a package management system. All run rather slowly on my old hardware, and lack features that I wanted, so I've written a Perl script to fill my needs. It does the following:

- Creates and displays text listfiles of all packages in /usr/portage/, /usr/portage/packages/ and /var/db/pkg/.
- Displays group lists for the same directories.
- Searches for a package name in the lists.
- Creates an HTML synopsis of /var/log/emerge.log with human-readable times and durations.
- Fetches and parses a Znurt Category page into a brief HTML list with clickable links to each Znurt package page.

I've found it very useful during installation and setup of new Gentoo partitions, and thought others might find it equally so. If you'd like to try it, go to:

http://52midnight.com/gentoo/code/g.html

I'm in the final debugging stages, to it's a good time to report any bugs or suggest improvements (within reason - I'm an avid practitioner of the Three Perl Virtues; laziness, impatience, and hubris).


You still working on this / using it?
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
52midnight
Apprentice
Apprentice


Joined: 20 Mar 2012
Posts: 176
Location: Brisbane AU

PostPosted: Mon Feb 17, 2014 10:46 pm    Post subject: Reply with quote

> You still working on this / using it?

Use it regularly. The URL has changed:

http://52midnight.com/gentoo/code/g.html
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Mon Feb 17, 2014 11:41 pm    Post subject: Reply with quote

Okay, I was curious if you want a simpler way to access Znurt. I could do an XML export if you wanted, for example.
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
52midnight
Apprentice
Apprentice


Joined: 20 Mar 2012
Posts: 176
Location: Brisbane AU

PostPosted: Tue Feb 18, 2014 12:00 am    Post subject: Reply with quote

> Okay, I was curious if you want a simpler way to access Znurt. I could do an XML export if you wanted, for example.

Znurt is very useful, but way too much eye-candy for my taste. The -x option exec's another script that takes a Portage group name as input, uses wget to pull down the requisite Znurt page, and parses its links into a simple HTML page in a predefined directory. Didn't include it because it's hard-coded to my own dir structure. It you've an XML solution that's useful, I'd be happy to compare notes.
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Tue Feb 18, 2014 12:18 am    Post subject: Reply with quote

52midnight wrote:
> Okay, I was curious if you want a simpler way to access Znurt. I could do an XML export if you wanted, for example.

Znurt is very useful, but way too much eye-candy for my taste. The -x option exec's another script that takes a Portage group name as input, uses wget to pull down the requisite Znurt page, and parses its links into a simple HTML page in a predefined directory. Didn't include it because it's hard-coded to my own dir structure. It you've an XML solution that's useful, I'd be happy to compare notes.


Sorry, I wasn't clear ... do you want a cleaner XML output *from Znurt*. If so, lmk what you're looking for and I can probably hack it together.

I'd been thinking about dumping out static XML files for a while anyway ... or maybe JSON .. that'd be easier.
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
52midnight
Apprentice
Apprentice


Joined: 20 Mar 2012
Posts: 176
Location: Brisbane AU

PostPosted: Tue Feb 18, 2014 2:22 am    Post subject: Reply with quote

I'm a dedicated practitioner of the Three Perl Virtues: laziness, impatience, and hubris. XML is one of those things I admire as an elegant and necessary solution, but I've never used it myself. JSON is an unknown. If anyone else reading this is interested, please post; for myself, I'll thank you for your offer, but I'm happy with what I've got.
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Tue Feb 18, 2014 2:28 am    Post subject: Reply with quote

52midnight wrote:
I'm a dedicated practitioner of the Three Perl Virtues: laziness, impatience, and hubris. XML is one of those things I admire as an elegant and necessary solution, but I've never used it myself. JSON is an unknown. If anyone else reading this is interested, please post; for myself, I'll thank you for your offer, but I'm happy with what I've got.


WORKSFORME :)
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum