Is there a way to extract just specific files from rpm package? What i'd like to do is try to fix an XFree issue where doing shutdown/reboot/login from KDE results in black console and the only way to get out of it is power down. I've found out it's XFree Radeon driver issue and Mandrake has already fix for it. I'd like to avoid installing their XFree rpm and try only their Radeon driver. Thx, Martin __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 04 May 2003 11:40 am, Martin wrote:
Is there a way to extract just specific files from rpm package?
I know it is possible because "I've done it once..." but not recently. As I recall, I used "mc" or "midnight commander" which is a text-mode filemanager. It seems to me that as you navigated "into" tar files and the like, it would expand them and let you do things like read the contents or copy elsewhere. It also dove into .rpm's the same way. As to current "gui" tools that do the same thing, I'm at a loss [but would like to know about one because every now and then I might want to do this, and I don't think "mc" installs "by default" anymore, so I probably don't have mc on whatever (new) machine I'm working on...] - -- Yet another Blog: http://osnut.homelinux.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment: http://osnut.homelinux.net/TomEmerson.asc iD8DBQE+tV96V/YHUqq2SwsRAqf4AJ9f3P1U8h9A34ldwYBSyfsCDk8WogCgjzKY 28A5uju3RDn5a845YVEL3Ro= =9HE6 -----END PGP SIGNATURE-----
On Sunday 04 May 2003 20:40, Martin wrote:
Is there a way to extract just specific files from rpm package?
from the command line, you could do something like rpm2cpio packagename.rpm | cpio -i --make-directories file_you're_looking_for if the file is in the rpm as /usr/X11R6/lib/whatever, that directory structure will be created in the current directory, and the file will be extracted there. I don't know if there's a way to force it to extract to the current directory, I don't use it very often
On Sun, 4 May 2003 11:40:16 -0700 (PDT)
Martin
Is there a way to extract just specific files from rpm package?
mc will use a "virtual filesystem" to let you pull files out of an rpm, but I usually use this script. It will rip an rpm into the current directory. It works great. ############################################### #!/usr/bin/perl use warnings; use strict; use Cwd; use File::Path; if ($#ARGV < 0){print<<'EOT'; Usage: rpmrip 1.rpm 2.rpm 3.rpm....... Will install the given rpm (or spm) into the current directory. EOT exit; } my $td=cwd(); ## make fake rpm database in current directory print "Creating rpm db directory $td/var/lib/rpm\n"; #system('mkdir','-p','var/lib/rpm'); mkpath ('var/lib/rpm'); print "Initializing rpm db\n"; system ('rpm','--root',$td,'--dbpath','/var/lib/rpm','--initdb'); foreach (@ARGV){ system ('rpm','--notriggers','--noscripts','--nodeps','--force', '--ignorearch','--ignoreos', '--relocate',"/=/$td",'--badreloc', '--define',"_dbpath $td/var/lib/rpm", '--define',"_topdir $td", '-Uvh', $_)} rmtree ('var',0,0); print 'Source spm\'s are in SOURCE, binary rpms are in dirs',"\n\n"; __END__ -- use Perl; #powerful programmable prestidigitation
On Monday 05 May 2003 00:17, zentara wrote:
rmtree ('var',0,0);
Considering that you don't care about the rpm database, and that you ignore the script, your perl script looks to me to be completely equivalent to rpm2cpio rpmname.rpm|cpio -i --make-directories Am I missing something?
On Mon, 5 May 2003 00:27:46 +0200
Anders Johansson
On Monday 05 May 2003 00:17, zentara wrote:
rmtree ('var',0,0);
Considering that you don't care about the rpm database, and that you ignore the script, your perl script looks to me to be completely equivalent to
rpm2cpio rpmname.rpm|cpio -i --make-directories
Am I missing something?
Nope. I just like using perl. It makes it easier to type in the command. The above line in a shell script could be put in a shell script with %1, but I havn't tested it. -- use Perl; #powerful programmable prestidigitation
Nice to see somebody from SuSE responding. It seems
like the fact Mandrake has fixed Radeon drive and SuSE
not didn't strike anybody yet so it pops up a
question whether SuSE already knows about it.
Would you mind to tell me if there is any risk using
other distro driver?
Martin
--- Christopher Mahmood
* zentara (zentara@zentara.net) [030504 15:16]:
#!/usr/bin/perl use warnings; use strict; use Cwd; use File::Path; :
Bletch. 'rpm2cpio foo.rpm | cpio -idv'
--
-ckm
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
__________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
participants (5)
-
Anders Johansson
-
Christopher Mahmood
-
Martin
-
Tom Emerson
-
zentara