summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-02-04 16:53:51 +0000
committerjbj <devnull@localhost>2002-02-04 16:53:51 +0000
commit696c5d9d67e4bde344b921c94ffad5a8ad075ce8 (patch)
treea697b8b6e4ea2c9bc3e88f017ff1bc7ec852f886 /scripts
parent81d60b470679acaab73d37f6a2f3f2dc6b3cba60 (diff)
downloadrpm-696c5d9d67e4bde344b921c94ffad5a8ad075ce8.tar.gz
rpm-696c5d9d67e4bde344b921c94ffad5a8ad075ce8.tar.bz2
rpm-696c5d9d67e4bde344b921c94ffad5a8ad075ce8.zip
rollback changes from 4.0.4.
CVS patchset: 5297 CVS date: 2002/02/04 16:53:51
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am6
-rwxr-xr-xscripts/rpm2cpio.sh26
2 files changed, 29 insertions, 3 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 9ab7864e9..721090539 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -9,7 +9,7 @@ EXTRA_DIST = \
find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl \
find-requires.perl get_magic.pl getpo.sh http.req \
magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi \
- rpm.daily rpm.log rpm.xinetd \
+ rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \
sql.prov sql.req tcl.req trpm u_pkg.sh \
vpkg-provides.sh vpkg-provides2.sh
@@ -25,6 +25,6 @@ config_SCRIPTS = \
find-lang.sh find-prov.pl find-req.pl cpanflute find-provides.perl \
find-requires.perl get_magic.pl getpo.sh http.req \
magic.prov magic.req perl.prov perl.req rpmdiff rpmdiff.cgi \
- rpm.daily rpm.log rpm.xinetd \
- sql.prov sql.req tcl.req u_pkg.sh \
+ rpm.daily rpm.log rpm.xinetd rpm2cpio.sh \
+ sql.prov sql.req tcl.req trpm u_pkg.sh \
vpkg-provides.sh vpkg-provides2.sh
diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh
new file mode 100755
index 000000000..a9269c70b
--- /dev/null
+++ b/scripts/rpm2cpio.sh
@@ -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 | gunzip