~ubuntu-branches/ubuntu/raring/libvirt/raring

« back to all changes in this revision

Viewing changes to run.in

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-11-19 10:41:02 UTC
  • mfrom: (1.2.15) (223.1.2 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121119104102-l6ewdppikysbzztu
Tags: 1.0.0-0ubuntu2
debian/patches/add-armhf-sysinfo-infomration.patch: Disable
to fix FTBFS on arm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -
 
2
# libvirt 'run' programs locally script
 
3
# Copyright (C) 2012 Red Hat, Inc.
 
4
#
 
5
# This program is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; either version 2 of the License, or
 
8
# (at your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful,
 
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
# GNU General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with this program; If not, see <http://www.gnu.org/licenses/>.
 
17
 
 
18
#----------------------------------------------------------------------
 
19
#
 
20
# With this script you can run libvirt programs without needing to
 
21
# install them first.  You just have to do for example:
 
22
#
 
23
#   ./run ./tools/virsh [args ...]
 
24
#
 
25
# If you are already in the tools/ subdirectory, then the following
 
26
# command will also work:
 
27
#
 
28
#   ../run ./virsh [...]
 
29
#
 
30
# You can also run the C programs under valgrind like this:
 
31
#
 
32
#   ./run valgrind [valgrind opts...] ./program
 
33
#
 
34
# or under gdb:
 
35
#
 
36
#   ./run gdb --args ./program
 
37
#
 
38
# This also works with sudo (eg. if you need root access for libvirt):
 
39
#
 
40
#   sudo ./run ./tools/virsh list --all
 
41
#
 
42
#----------------------------------------------------------------------
 
43
 
 
44
# Find this script.
 
45
b=@abs_builddir@
 
46
 
 
47
library_path="$b/src/.libs"
 
48
if [ -z "$LD_LIBRARY_PATH" ]; then
 
49
    LD_LIBRARY_PATH=$library_path
 
50
else
 
51
    LD_LIBRARY_PATH="$library_path:$LD_LIBRARY_PATH"
 
52
fi
 
53
export LD_LIBRARY_PATH
 
54
 
 
55
export LIBVIRT_DRIVER_DIR="$b/src/.libs"
 
56
export LIBVIRTD_PATH="$b/daemon/libvirtd"
 
57
 
 
58
# For Python.
 
59
export PYTHON=@PYTHON@
 
60
if [ -z "$PYTHONPATH" ]; then
 
61
    PYTHONPATH="$b/python:$b/python/.libs"
 
62
else
 
63
    PYTHONPATH="$b/python:$b/python/.libs:$PYTHONPATH"
 
64
fi
 
65
export PYTHONPATH
 
66
 
 
67
# This is a cheap way to find some use-after-free and uninitialized
 
68
# read problems when using glibc.
 
69
random_val="$(awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)"
 
70
export MALLOC_PERTURB_=$random_val
 
71
 
 
72
# Run the program.
 
73
exec $b/libtool --mode=execute "$@"