LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   finding out package installation status/deps through api? (https://www.linuxquestions.org/questions/debian-26/finding-out-package-installation-status-deps-through-api-721336/)

grayFalcon 04-24-2009 01:35 AM

finding out package installation status/deps through api?
 
Hello everybody!

I have been unable to find anything through google (though most likely just because I don't know what to search for), so... is there any kind of API I could use to get info about installed packages on the system? I want to build a package tree dynamically based on user input, so just querying dpkg a lot of times is kinda out of the question. So, where do I best start looking?

I know that I could just read the code for debfoster (since it does this too and is quite short), but I rather wouldn't... there's exactly 10 words of comments for 500 lines of code in one relevant source file that I looked at, which is not exactly encouraging ;)

Thanks a lot in advance for any directions,
greets,
-grayFalcon

aus9 04-24-2009 07:21 AM

I am assuming by API you mean gui..graphical?

if so try Debian Package Search

Code:

apt-get install packagesearch

grayFalcon 04-24-2009 07:50 AM

Uh... no, actually by API I mean "Application Programming Interface". What I'm looking for is a library that would allow me to do what I described from C (or python, or perl... I don't really care as long as it's not Java ;) ).

Greets,
-grayFalcon

grayFalcon 04-25-2009 04:22 PM

Solved, kinda
 
Ech, well, I just mustered up the courage and delved into the debfoster code... and lo and behold, it was not as bad as I had anticipated.

In short, it reads all the information from /var/lib/dpkg/status. Not exactly what I had hoped for, but it does contain all the information I need I guess.

Greets,
-grayFalcon


All times are GMT -5. The time now is 03:14 PM.