[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: RFE: rpm2cpio should not need db3



Jeff Johnson wrote:

> So use the attached shell script <shrug>
> 
> 73 de Jeff
> 
==============================================================================
> #!/bin/sh
> 
> pkg=$1
> 
> leadsize=96
> o=`expr $leadsize + 8`
> set `od -j $o -N 8 -t u1 $pkg`
> il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
> dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
> # echo "sig il: $il dl: $dl"
> 
> sigsize=`expr 8 + 16 \* $il + $dl`
> o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \% 8 \) + 8`
> set `od -j $o -N 8 -t u1 $pkg`
> il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
> dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
> # echo "hdr il: $il dl: $dl"
> 
> hdrsize=`expr 8 + 16 \* $il + $dl`
> o=`expr $o + $hdrsize`
> 
> dd if=$pkg ibs=1 skip=$o | gunzip


First, I'd like to say that the need for a script like that indicates that 
it would have been better if RedHat hadn't invented a new binary archive 
format.  Water under the bridge, but that's always bugged me.

Second, does this always work?  With all versions of RPM?  For both source 
and binary RPMs?  For nosource and noarch RPMs?  For all styles of 
signatures?

Third, if this script works, why not ship it?  I suppose you'll say that's 
what rpm2cpio is, but rpm2cpio requires a whole lot of stuff that isn't 
always available.

This reminds me of the time when a friend who didn't run Linux at all 
wanted to look through Linux source code.  He bought a couple RedHat CDs 
thinking he'd be able to browse the source.  But he had access only to 
machines running either Windows or HP-UX, neither of which understood the 
RPM files.  He came to me, the closest person around who ran Linux, looking 
for help.  I tried valiantly to get rpm2cpio to compile on HP-UX, but in 
the end was unsuccessful (and I've got plenty of experience getting 
packages to work under HP-UX).  There were just too many dependencies that 
I couldn't track down.

You could say, perhaps correctly, that this is more a problem with HP-UX 
than with rpm2cpio, but if we'd had access to a simple script like that my 
friend might today be running RedHat instead of Windows and HP-UX.

-- 
                        Eric Backus <eric_backus@agilent.com>
                        PGP:  B6 CC EC B2 CD A4 79 A8  1C BF 19 96 69 EE E5 CC
                        GPG: 1567 EB6E D580 7CCD 13FB  34EC A51C C498 7F7F 9944





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []