Statistics
| Branch: | Tag: | Revision:

root / autotools / run-in-tempdir @ cefd4a4a

History | View | Annotate | Download (785 Bytes)

1
#!/bin/bash
2

    
3
# Helper for running things in a temporary directory; used for docs
4
# building, unittests, etc.
5

    
6
set -e
7

    
8
tmpdir=$(mktemp -d -t gntbuild.XXXXXXXX)
9
trap "rm -rf $tmpdir" EXIT
10

    
11
mkdir $tmpdir/doc
12

    
13
cp -r autotools daemons scripts lib tools test qa $tmpdir
14
cp -r doc/examples $tmpdir/doc
15

    
16
mv $tmpdir/lib $tmpdir/ganeti
17
ln -T -s $tmpdir/ganeti $tmpdir/lib
18

    
19
mkdir -p $tmpdir/htools $tmpdir/htest
20
for hfile in htools ganeti-confd mon-collector; do
21
  if [ -e htools/$hfile ]; then
22
    cp -p htools/$hfile $tmpdir/htools/
23
  fi
24
done
25

    
26
for hfile in hpc-htools test offline-test.sh cli-tests-defs.sh \
27
  hbal hscan hspace hinfo hcheck hail hpc-mon-collector; do
28
  if [ -e htest/$hfile ]; then
29
    cp -p htest/$hfile $tmpdir/htest/
30
  fi
31
done
32

    
33
cd $tmpdir && GANETI_TEMP_DIR="$tmpdir" "$@"