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

Re: RFE: rpm2cpio should not need db3



On Thu, Jan 03, 2002 at 12:03:36AM -0800, Eric Backus wrote:
> 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.

<shrug>

> 
> 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?

yes

> 
> 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.
> 

legacy+laziness

> 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.

'Tain't hard to find a linux box with rpm2cpio and copy the payload back
to HP-UX.

> 
> 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.

Which is why I wrote the script.

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@jbj.org	(jbj@redhat.com)
Chapel Hill, NC





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