Merge pull request #128 from Ypnose/master

New package: rpmextract-1.0-1
This commit is contained in:
Juan RP 2013-08-17 05:02:35 -07:00
commit f2c95869c1
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#!/bin/bash
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

View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ "$1" = "" -o ! -e "$1" ]; then
echo "no package supplied" 1>&2
exit 1
fi
rpm2cpio $1 | bsdtar -xf -

View File

@ -0,0 +1,24 @@
# Template file for 'rpmextract'
pkgname=rpmextract
version=1.0
revision=1
short_desc="Script to convert or extract RPM archives (contains rpm2cpio)"
maintainer="Ypnose <linuxienATlegtuxDOTorg>"
license="GPL"
homepage="http://www.archlinux.org"
nofetch=yes
noextract=yes
do_install() {
vinstall ${FILESDIR}/rpm2cpio 755 usr/bin
vinstall ${FILESDIR}/rpmextract 755 usr/bin
}
rpmextract_package() {
depends="bash bsdtar coreutils"
noarch="yes"
pkg_install() {
vmove usr
}
}