Statistics
| Branch: | Tag: | Revision:

root / autotools / run-in-tempdir @ ef947a42

History | View | Annotate | Download (711 Bytes)

1 b959138f Michael Hanselmann
#!/bin/bash
2 b959138f Michael Hanselmann
3 b91e9518 Iustin Pop
# Helper for running things in a temporary directory; used for docs
4 b91e9518 Iustin Pop
# building, unittests, etc.
5 b91e9518 Iustin Pop
6 b959138f Michael Hanselmann
set -e
7 b959138f Michael Hanselmann
8 b959138f Michael Hanselmann
tmpdir=$(mktemp -d -t gntbuild.XXXXXXXX)
9 b959138f Michael Hanselmann
trap "rm -rf $tmpdir" EXIT
10 b959138f Michael Hanselmann
11 83846468 Iustin Pop
# fully copy items
12 83846468 Iustin Pop
cp -r autotools daemons scripts lib tools qa $tmpdir
13 3ade0e0e Michael Hanselmann
14 83846468 Iustin Pop
mkdir $tmpdir/doc
15 75b32fff Iustin Pop
ln -s $PWD/doc/examples $tmpdir/doc
16 3ade0e0e Michael Hanselmann
17 83846468 Iustin Pop
mkdir $tmpdir/test/
18 83846468 Iustin Pop
cp -r test/py $tmpdir/test/py
19 83846468 Iustin Pop
ln -s $PWD/test/data $tmpdir/test
20 83846468 Iustin Pop
ln -s $PWD/test/hs $tmpdir/test
21 83846468 Iustin Pop
22 b959138f Michael Hanselmann
mv $tmpdir/lib $tmpdir/ganeti
23 f6cbcc06 Michael Hanselmann
ln -T -s $tmpdir/ganeti $tmpdir/lib
24 f0f3a6df Iustin Pop
25 83846468 Iustin Pop
mkdir -p $tmpdir/src $tmpdir/test/hs
26 cefd4a4a Michele Tartara
for hfile in htools ganeti-confd mon-collector; do
27 3add7574 Iustin Pop
  if [ -e src/$hfile ]; then
28 3add7574 Iustin Pop
    ln -s $PWD/src/$hfile $tmpdir/src/
29 f0f3a6df Iustin Pop
  fi
30 f0f3a6df Iustin Pop
done
31 f0f3a6df Iustin Pop
32 577b170b Iustin Pop
cd $tmpdir && GANETI_TEMP_DIR="$tmpdir" "$@"