From 8b1de0dda4e5688f511868a17a20b45c4738f6f5 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 12 Sep 2006 18:03:59 +0000 Subject: [PATCH] - automate creation of a derived tarball with no dlcompat bits --- make-no-dlcompat-tarball.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 make-no-dlcompat-tarball.sh diff --git a/make-no-dlcompat-tarball.sh b/make-no-dlcompat-tarball.sh new file mode 100755 index 0000000..0f2239a --- /dev/null +++ b/make-no-dlcompat-tarball.sh @@ -0,0 +1,36 @@ +#!/bin/bash -e + +tmppath=`mktemp -d ${TMPDIR:-/tmp}/make-no-dlcompat-tarball-XXXXXX` +if test -z "$tmppath" ; then + echo Error creating temporary directory. + exit 1 +fi +trap "rm -fr $tmppath" EXIT + +initialdir=`pwd` + +for tarball in ${initialdir}/cyrus-sasl-*.tar.{gz,bz2} ; do + if ! test -s "$tarball" ; then + continue + fi + rm -fr $tmppath/* + pushd $tmppath > /dev/null + case "$tarball" in + *nodlcompat*) + : Do nothing. + ;; + *.gz) + gzip -dc "$tarball" | tar xf - + rm -fr cyrus-sasl-*/dlcompat + tar cf - * | gzip -c > \ + $initialdir/`basename $tarball .tar.gz`-nodlcompat.tar.gz + ;; + *.bz2) + bzip2 -dc "$tarball" | tar xf - + rm -fr cyrus-sasl-*/dlcompat + tar cf - * | bzip2 -c > \ + $initialdir/`basename $tarball .tar.bz2`-nodlcompat.tar.bz2 + ;; + esac + popd > /dev/null +done