Statistics
| Branch: | Tag: | Revision:

root / autotools / run-in-tempdir @ 3add7574

History | View | Annotate | Download (796 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 3ade0e0e Michael Hanselmann
mkdir $tmpdir/doc
12 3ade0e0e Michael Hanselmann
13 a0c3e726 Michael Hanselmann
cp -r autotools daemons scripts lib tools test qa $tmpdir
14 75b32fff Iustin Pop
ln -s $PWD/doc/examples $tmpdir/doc
15 3ade0e0e Michael Hanselmann
16 b959138f Michael Hanselmann
mv $tmpdir/lib $tmpdir/ganeti
17 f6cbcc06 Michael Hanselmann
ln -T -s $tmpdir/ganeti $tmpdir/lib
18 f0f3a6df Iustin Pop
19 3add7574 Iustin Pop
mkdir -p $tmpdir/src $tmpdir/htest
20 cefd4a4a Michele Tartara
for hfile in htools ganeti-confd mon-collector; do
21 3add7574 Iustin Pop
  if [ -e src/$hfile ]; then
22 3add7574 Iustin Pop
    ln -s $PWD/src/$hfile $tmpdir/src/
23 f0f3a6df Iustin Pop
  fi
24 f0f3a6df Iustin Pop
done
25 f0f3a6df Iustin Pop
26 189b51fa Iustin Pop
for hfile in hpc-htools test offline-test.sh cli-tests-defs.sh \
27 3504d6c8 Guido Trotter
  hbal hscan hspace hinfo hcheck hail hroller hpc-mon-collector; do
28 f0f3a6df Iustin Pop
  if [ -e htest/$hfile ]; then
29 75b32fff Iustin Pop
    ln -s $PWD/htest/$hfile $tmpdir/htest/
30 04d15e63 Iustin Pop
  fi
31 04d15e63 Iustin Pop
done
32 b959138f Michael Hanselmann
33 577b170b Iustin Pop
cd $tmpdir && GANETI_TEMP_DIR="$tmpdir" "$@"