You are not logged in.

#1 2007-05-06 02:08:00

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Python and Pacman

I've decided to create a small app using Python that will query the pacman mirrors, say 3 times a day.
If there are upgrades an Icon on the task bar will go red (need to upgrade), if there are none will go green (up to date). Clicking the icon when red will start a "pacman -Syu".
As you can see, it is nothing "too complicated", but from the get go I realize I need to better understand how pacman internals work.
Where can I find such information? Also, any advise, ideas, etc. before I get going are welcome.
Thanks in advance.

R.

Last edited by ralvez (2007-05-06 02:10:23)

Offline

#2 2007-05-06 09:28:38

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Python and Pacman

Maybe take a look at the source.

Offline

#3 2007-05-06 09:43:33

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Python and Pacman

i think there's one already, but i can't remember it's name. check the AUR.

Offline

#4 2007-05-06 11:00:47

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 606

Re: Python and Pacman

http://bbs.archlinux.org/viewtopic.php?t=14849

One of them has the features you plan.


Ability is nothing without opportunity.

Offline

#5 2007-05-09 18:55:25

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Python and Pacman

Xerxes2 made a nice python reimplementation called libpypac. I don't believe he kept it up to date, but it might be a starting point. There's a project page on GNA.

Dusty

Offline

#6 2007-05-10 02:24:20

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: Python and Pacman

Thank you all for all your input.
I've got to the point in which the program is functional and I get info about what packages are available for upgrade.
I've looked at the other projects but I have taken a somehow different approach. Mind you I'm a programmer by choice and an engineer by trade and I cannot see anything go to waste lol so this is what I did.

I used pacman, which is a necessary package anyways, and using python's subprocess I piped data right out of the pacman -Syu screen, sending a "n" (no answer to the question of upgrade y/n) and then re-piped the data output to (at least for now) the screen.

At this point in time I can display the data in conky, but as I indicated before, my goal is to have an icon on the tray turn red when upgrades are detected and by touching the icon (probably with a too-tip ) I should be able to see the available upgrades.
Then by clicking the icon the upgrade should be preformed and the icon should then turn green.

I'll report on the progress and when the software is ready I'll share, it if there is interest on such tray tool, with the community.

Thanks again

R.

Offline

#7 2007-05-10 04:34:52

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Python and Pacman

ralvez wrote:

I used pacman, which is a necessary package anyways, and using python's subprocess I piped data right out of the pacman -Syu screen, sending a "n" (no answer to the question of upgrade y/n) and then re-piped the data output to (at least for now) the screen.

For what it's worth, pacman 3 has a way to simply view the packages that will be upgraded (without it prompting you about installing, replaces, etc).
pacman -Sy && pacman -Qu


I am a gated community.

Offline

Board footer

Powered by FluxBB