diff options
author | Michael Hanson <hansonorders@verizon.net> | 2010-12-07 01:42:07 (GMT) |
---|---|---|
committer | Michael Hanson <hansonorders@verizon.net> | 2010-12-07 01:42:07 (GMT) |
commit | f46714b9870abc1a1f41fe944159bc09b4cf33cb (patch) | |
tree | 2ffb0bd13d8e657e61723d5f1d9dbeb6f13e3eca /abs/extra/rpmextract/rpm2cpio | |
parent | 21f2b55e683c5f9eee3f4d5bdbf4d79745bc46a6 (diff) | |
download | linhes_pkgbuild-f46714b9870abc1a1f41fe944159bc09b4cf33cb.zip linhes_pkgbuild-f46714b9870abc1a1f41fe944159bc09b4cf33cb.tar.gz linhes_pkgbuild-f46714b9870abc1a1f41fe944159bc09b4cf33cb.tar.bz2 |
rpmextract: initial include for gsfonts
Diffstat (limited to 'abs/extra/rpmextract/rpm2cpio')
-rw-r--r-- | abs/extra/rpmextract/rpm2cpio | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/abs/extra/rpmextract/rpm2cpio b/abs/extra/rpmextract/rpm2cpio new file mode 100644 index 0000000..a0eba24 --- /dev/null +++ b/abs/extra/rpmextract/rpm2cpio @@ -0,0 +1,26 @@ +#!/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 |