You are not logged in.

#1 2006-03-20 15:52:45

RobK
Member
Registered: 2005-12-07
Posts: 121

PKGBUILD for rpmextract

Can someone post the PKGBUILD for rpmextract.  I can't get it off the web site .  When I click View CVS entries on http://www.archlinux.org/packages.php?id=6479, I get an internal server error.

I can't use ABS since I am away from my arch machine.  I am trying to do some work offsite.

Thanks

Rob

Offline

#2 2006-03-20 16:14:53

shbang
Member
Registered: 2005-10-03
Posts: 76

Re: PKGBUILD for rpmextract

PKGBUILD:
# $Id: PKGBUILD,v 1.1 2005/04/02 17:12:08 tpowa Exp $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>

pkgname=rpmextract
pkgver=0
pkgrel=1
pkgdesc="This script extracts rpm archives"
source=(rpmextract.sh)
url="http://www.archlinux.org"
depends=('bash' 'gzip' 'bzip2' 'cpio')
build() {
install -D -m755 $startdir/src/rpmextract.sh $startdir/pkg/usr/bin/rpmextract.sh
}
md5sums=('532c5c877a8f25897e0e60852130bb6e')

rpmextract.sh:
#!/bin/sh

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

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=$o skip=1 2>/dev/null | gunzip | cpio -idmuv || dd if=$pkg ibs=$o skip=1 2>/dev/null | bzip2 -d | cpio -idmuv

Offline

#3 2006-03-20 16:37:45

RobK
Member
Registered: 2005-12-07
Posts: 121

Re: PKGBUILD for rpmextract

Thanks.  For some reason the MD5sum check does not pass for the rpmextract.sh file.  Did you add any spacing etc?

Rob

Offline

#4 2006-03-20 16:59:26

shbang
Member
Registered: 2005-10-03
Posts: 76

Re: PKGBUILD for rpmextract

copy and paste (gvim) from /var/abs/extra/system/rpmextract

Offline

#5 2006-03-20 17:06:06

shbang
Member
Registered: 2005-10-03
Posts: 76

Re: PKGBUILD for rpmextract

the indentation is different in the if statement

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

should be 4 spaces before echo and 3 spaces before exit

when I paste this and submit the spaces get stripped

Offline

#6 2006-03-20 21:43:00

RobK
Member
Registered: 2005-12-07
Posts: 121

Re: PKGBUILD for rpmextract

Thanks.  That did it.  Now it passes the MD5 validation.

Rob

Offline

Board footer

Powered by FluxBB