-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmksrcrelease.sh
executable file
·73 lines (59 loc) · 1.23 KB
/
mksrcrelease.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
force=no
die () {
echo "*** mksrcrelease.sh: $*" 1>&2
exit 1
}
[ -e src ] || die "can not find 'src', call from btor2tools base directory"
while [ $# -gt 0 ]
do
case $1 in
-h) echo "usage: mksrcrelease.sh [-h][-f]";exit 0;;
-f) force=yes;;
*) die "invalid command line option '$1'";;
esac
shift
done
LC_TIME="en_US.UTF-8"
export LC_TIME
date=`date +%y%m%d`
version=`cat VERSION`
gitid=`git rev-parse HEAD`
gitid_short=`git rev-parse --short=7 HEAD`
id="$version-$gitid_short-$date"
name=btor2tools-$id
dir="/tmp/$name"
if [ -d $dir ]
then
[ $force = no ] && die "$dir already exists, use '-f'"
fi
rm -rf $dir
mkdir $dir || exit 1
mkdir $dir/src || exit 1
cp -p \
AUTHORS \
VERSION \
LICENSE.txt \
README.md \
configure.sh \
makefile.in \
$dir/
cp -p --parents \
src/btor2parser/btor2parser.[ch] \
src/btorsim/btorsim.c \
src/btorsim/btorsimbv.[ch] \
src/btorsim/btorsimrng.[ch] \
src/util/btor2mem.h \
src/util/btor2stack.h \
src/catbtor.c \
$dir
cp -p -r --parents \
examples/btorsim/*.btor2 \
examples/btorsim/mc-witnesses \
examples/btorsim/run-examples.sh \
$dir
cd /tmp/
rm -f $name.tar.xz
tar Jcf $name.tar.xz $name
ls -l /tmp/$name.tar.xz | awk '{print $5, $NF}'
rm -rf $dir