1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/bash
set -e
test $# == 3
URL="http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles"
VER="$2"
UPTAR="clhep-$VER.tgz"
UPDIR="$VER/CLHEP"
ORIGTAR="$3"
ORIGDIR="clhep-$VER.orig"
DESTDIR="$(dirname "$ORIGTAR")"
test ! -f "$DESTDIR/$UPTAR" && wget "$URL/$UPTAR" -O "$DESTDIR/$UPTAR"
test -d "$VER" && rm -rf "$VER"
tar -xf "$DESTDIR/$UPTAR"
mv "$UPDIR" "$ORIGDIR"
test -e "$ORIGTAR" && rm -f "$ORIGTAR"
GZIP=-9 tar --remove-files -zcf "$ORIGTAR" "$ORIGDIR"
rmdir "$VER"
|