File: get-orig-source

package info (click to toggle)
clhep 2.1.4.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,012 kB
  • sloc: cpp: 50,094; sh: 6,694; makefile: 2,694; perl: 28
file content (29 lines) | stat: -rwxr-xr-x 493 bytes parent folder | download | duplicates (4)
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"