Charles Galpin wrote:
> ok, you sparked my memory! This was discussed on the list before, but a
> previous (quick) search didn't find the thread. after you mentioned cpio,
> I found it.
>
> >From a note from Chuck Mead on Sept 1 1999
> (http://www.moongroup.com/old/Redhat4/msg00127.html) you can do
>
> rpm2cpio your.rpm | cpio -i the_file_you_want
>
> However, his example was with a .src.rpm, and I just tried this (and
> failed) on a regular rpm. I say failed because even though I got no
> errors, and it appeared to have worked, no file was extracted. I even
> tried the --no-absolute-filenames switch, the full path to the file, just
> the filename, etc.
>
> anyone?
> charles
>
Could not stand it and since I am iced in here in tulsa ...
[bhughes@bretdell_linux cpiotest]$ cat instdocsonly
#!/bin/sh
# use rpm, rpm2cpio, perl and
# cpio to install the documentation files from a binary rpm
# files will be installed from current working directory directory
# Bret Hughes 12-26-00
#
#usage: instdocsonly rpmfilename
if ! [ $# = "1" ]; then
echo "usage: instdocsonly rpmfilename"
exit 4
fi
if ! [ -f $1 ]; then
echo "$1 not a regular file"
exit 6
fi
#create list of files to extract
tmpfile="/tmp/instdocsonly.tmp"
echo "temp file is $tmpfile"
rpm -qldp $1 >$tmpfile
# remove leading / from file names
# The rpm I tested with had all filenames absolute but the cpio file
# had all relative names
perl -pi -e 's/^\///g' $tmpfile
cat $tmpfile
rpm2cpio $1|cpio -i --make-directories -E $tmpfile
This obviously could use a few enhancments like options on where to install the
files and possibly removing them once installed but it is a start. Trouble is
that the rpm database won't know about these files but at least it will install
them. I never even thought about doing this but I will probably use it now :)
Bret
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list