You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tde-common-other/release/xdelta

36 lines
950 B

#!/bin/bash
test -z "$1" && { echo "parameter oldtarball required"; exit 1; }
test -z "$2" && { echo "parameter newtarball required"; exit 1; }
cleanupfiles=""
if test `basename $1 .bz2` != $1; then
echo "bunzip2 $1"
bunzip2 -c $1 > `basename $1 .bz2`
cleanupfiles="$cleanupfiles `basename $1 .bz2`"
fi
if test `basename $2 .bz2` != $2; then
echo "bunzip2 $2"
bunzip2 -c $2 > `basename $2 .bz2`
cleanupfiles="$cleanupfiles `basename $2 .bz2`"
fi
oldtarball=`basename $1 .bz2`
newtarball=`basename $2 .bz2`
package=`echo $newtarball | sed -e 's,-[^-]*$,,'`
oldversion=`basename $oldtarball .tar | sed -e s,$package-,,`
newversion=`basename $newtarball .tar | sed -e s,$package-,,`
diffname="$package-$oldversion-$newversion.tar.xdelta"
echo "xdelta $oldtarball $newtarball $diffname"
xdelta delta -9 -m 64M $oldtarball $newtarball $diffname
if test -n "$cleanupfiles"; then
echo "rm -f $cleanupfiles"
rm -f $cleanupfiles
fi