Bug 58101

Summary: Packages built on Tru64 Unix are "different"
Product: [Retired] Red Hat Linux Reporter: Chris Adams <linux>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-08 16:39:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Adams 2002-01-08 15:52:28 UTC
This is per a discussion on rpm-list.

Jeff Johnson posted an "rpm2cpio.sh" that should decode RPM packages (this is to
avoid the number of dependencies in the C version).  However, it does not decode
RPM packages built under Tru64 Unix, although the C version will.  The problem
is not the Tru64 toolset (rpm2cpio.sh running on Linux/x86 cannot decode a Tru64
package either).

Anyway, here is a pointer to an RPM built on Tru64:

http://www.iruntheinter.net/files/rpm/rpm-4.0.3-2.src.rpm

Comment 1 Jeff Johnson 2002-01-08 16:39:19 UTC
Hmmm, rpm2cpio.sh is reading the header 8b deeper than it should be.

That means that either
	1) the padding calculation in rpm2cpio.sh is broken.
	2) you've lost 8b from the signature/padding on Tru64.

Comment 2 Jeff Johnson 2002-01-08 16:59:14 UTC
Ah yes, modulo arithmetic to calculate the signature padding 
with expr(1) was broke.

Here's the patch for rpm2cpio.sh:

- o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \% 8 \) + 8`
+ o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`


Comment 3 Chris Adams 2002-01-08 17:14:46 UTC
BTW: if you change the last line to:

dd if=$pkg ibs=$o skip=1 2> /dev/null | gunzip

it (a) gets rid of the messages from dd and (b) changes the block size
to something bigger so it runs much faster (the odd block size shouldn't
hurt anything).

Also, I added a little error checking at the top:

pkg=$1
if [ "$pkg" = "" -o ! -e "$pkg" ]; then
        echo "no package supplied" 1>&2
        exit 1
fi

Thanks!

Comment 4 Jeff Johnson 2002-01-08 17:26:31 UTC
Thanks for the patch.

FWIW, the to rpm2cpio.sh script was written in a moment of pique
caused by one too many attacks from Debian/dpkg folk that
	The rpm package format cannot be read by common unix tools.
<shrug>