comparison examples/sci.sh @ 51:054cc00e23d2

examples: add sci.sh
author David Demelier <markand@malikania.fr>
date Wed, 17 Aug 2022 09:37:45 +0200
parents
children
comparison
equal deleted inserted replaced
50:b474f0985e39 51:054cc00e23d2
1 #!/bin/sh
2
3 set -e
4
5 readonly wrkdir="$(mktemp -d /tmp/sci-XXXXXX)"
6 readonly repo="http://hg.malikania.fr/sci"
7
8 trap "cleanup" INT TERM EXIT
9
10 cleanup()
11 {
12 rm -rf $wrkdir
13 }
14
15 if [ "$#" -ne 1 ]; then
16 echo "abort: $(basename $0) revision" 1>&2
17 exit 1
18 fi
19
20 echo "=> Cloning repository $repo (revision $1) into $wrkdir"
21 hg clone -r "$1" "$repo" "$wrkdir"
22 cd "$wrkdir"
23
24 echo "=> Building"
25 make