[ From: <[EMAIL PROTECTED]> 11:49:33 (+0000) 07-10-1999 ]
[ Subject: [ilug-cal] RPM to tgz ]
It seems there is a utility to convert .rpm archives to .tar.gz.
That's just what I have been looking for, in order to use some
packages that come in .rpm format on my Slackware sytem.
Does anyone know where I can pick up a copy of this utility?
Actually you have everything that you need to do that in your system
already. You need 'cpio' and 'dd' to accomplish that. Run the
attached script and see if it runs on your system. If you do not
have 'rpmoffset' on your system, let me know and I will send you a
copy.
-amlan
.
-------------------------------------------------------------------
#!/bin/sh
if [ "$TMPDIR" = "" ]; then
TMPDIR=/tmp
fi
if [ "$1" = "" ]; then
echo "rpm2targz: Converts RPM format to standard GNU tar + GNU zip format."
echo " (view converted packages with \"less\", install and remove"
echo " with \"installpkg\", \"removepkg\", \"pkgtool\", or manually"
echo " with \"tar\")"
echo
echo "Usage: rpm2targz <file.rpm>"
echo " (Outputs \"file.tar.gz\")"
exit 1;
fi
for i in $* ; do
if [ ! "$1" = "$*" ]; then
echo "Processing file: $i"
fi
rm -rf $TMPDIR/rpm2targz$$ # clear the way, just in case of mischief
mkdir $TMPDIR/rpm2targz$$
ofn=`basename $i .rpm`.cpio
dd ibs=`rpmoffset < $i` skip=1 if=$i 2> /dev/null | gzip -dc >
$TMPDIR/rpm2targz$$/$ofn
( cd $TMPDIR/rpm2targz$$
cpio --extract --preserve-modification-time --make-directories < $ofn 1> /dev/null
2>
rm -f $ofn
find . -type d -perm 700 -exec chmod 755 {} \;
tar czf - . ) > `basename $i .rpm`.tar.gz
( cd $TMPDIR ; rm -rf rpm2targz$$ )
done
--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/help/faq_list.html