LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-25-2011, 08:46 AM   #1
Arighna
LQ Newbie
 
Registered: May 2011
Posts: 16

Rep: Reputation: Disabled
Source code to get the location of installed files after rpm installation


The rpm command to get all the list of all installed file location after rpm installation is rpm -ql <rpm file-name>

But can anybody help me out by providing me the source codes for doing the same?
 
Old 07-25-2011, 11:49 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
Have a look at the rpm sources, I'd say.
 
Old 07-25-2011, 01:32 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Usually no source code is installed. And there is no rpm command to list files
in a source code package. ( For very good reasons.)
The 'ls -R' command will do. .. After it is unpacked.

Please specify your Linux OS, like Fedora 15, CentOS 6.0, Mandriva 2010 etc.
if you want further information.

..
 
Old 07-25-2011, 02:44 PM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
I understood the OP to want to know what the source code for rpm looks like -the part which lists the files installed by by rpm -I mean accessing the rpm database. Of course, the source code for rpm contains the code which does that. One could also look at the code for other package management systems. For slackware it's not even source code since it is all done with shell script. For debian packages it would be apt-get, etc. But since rpm was mentioned the that seemed the logical place to recommend. No matter which system, the code will be reflect the format of the package database. rpm maintains a 'binary' database, I believe. pkgtools(slackware), has a simple flat-file format with one file for each package. I'm not really sure about apt-get, but it seems likely that some of the code might be written in perl.
 
Old 07-26-2011, 04:15 AM   #5
Arighna
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gnashley View Post
Have a look at the rpm sources, I'd say.
Looking at the sources din't help me much, i'd say..i need the source code for the rpm -ql <rpm file-name>
 
Old 07-26-2011, 04:16 AM   #6
Arighna
LQ Newbie
 
Registered: May 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gnashley View Post
I understood the OP to want to know what the source code for rpm looks like -the part which lists the files installed by by rpm -I mean accessing the rpm database. Of course, the source code for rpm contains the code which does that. One could also look at the code for other package management systems. For slackware it's not even source code since it is all done with shell script. For debian packages it would be apt-get, etc. But since rpm was mentioned the that seemed the logical place to recommend. No matter which system, the code will be reflect the format of the package database. rpm maintains a 'binary' database, I believe. pkgtools(slackware), has a simple flat-file format with one file for each package. I'm not really sure about apt-get, but it seems likely that some of the code might be written in perl.
Can u plz get me the source codes for it, as i can see that you have properly understood my requirement.
 
Old 07-26-2011, 06:38 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,749

Rep: Reputation: 461Reputation: 461Reputation: 461Reputation: 461Reputation: 461
It's in the repository of your distro -even if I get it, you still don't have it.
Just search the web for 'rpm source', or 'rpm srpm'. The sources may be contained in a file with the extension 'srpm' or src.rpm.

Here's one page where you can find many versions:
http://fr2.rpmfind.net/linux/rpm2htm...submit=Search+...

For fedora 15:
ftp://fr2.rpmfind.net/linux/fedora/u...9.fc15.src.rpm

For Mandriva:
ftp://fr2.rpmfind.net/linux/Mandriva...2011.0.src.rpm
 
Old 07-26-2011, 06:55 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Example source code : rpm-4.4.6.tar.gz
ftp://ftp.uni-kassel.de/Mirrors/ftp....m-4.4.6.tar.gz

Reading some of the 7000 files may answer your question.


If you just want a list of files from a non installed rpm package,
the less command can be used : less name.rpm
Or use the lesspipe / lesspipe.sh / lessfile command.

..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is there a standard location for downloading source code? sneakyimp Linux - Server 6 02-18-2011 06:24 PM
Find Installed Location of RPM Package in Unix suman5u Linux - Newbie 2 03-26-2010 04:28 AM
Installed location of RPM vibhor_agarwalin Linux - General 9 04-12-2009 11:55 PM
what is the file location of Redhat source code?? nazib Linux - General 1 02-26-2005 03:18 AM
Location of kernel source code mhl Mandriva 2 11-30-2003 05:02 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration