Statistics
| Branch: | Tag: | Revision:

root / autotools / run-in-tempdir @ 25cdf177

History | View | Annotate | Download (534 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 f774bd03 Michael Hanselmann
cp -r autotools daemons scripts lib tools test $tmpdir
12 b959138f Michael Hanselmann
mv $tmpdir/lib $tmpdir/ganeti
13 f6cbcc06 Michael Hanselmann
ln -T -s $tmpdir/ganeti $tmpdir/lib
14 b91e9518 Iustin Pop
mkdir -p $tmpdir/htools
15 25cdf177 Iustin Pop
for htest in htools htools-hpc test offline-test.sh cli-tests-defs.sh; do
16 04d15e63 Iustin Pop
  if [ -e htools/$htest ]; then
17 04d15e63 Iustin Pop
    cp -p htools/$htest $tmpdir/htools/
18 04d15e63 Iustin Pop
  fi
19 04d15e63 Iustin Pop
done
20 b959138f Michael Hanselmann
21 577b170b Iustin Pop
cd $tmpdir && GANETI_TEMP_DIR="$tmpdir" "$@"