Remove ad-hoc run*locally scripts, replace with './run'
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 15 Apr 2011 20:43:20 +0000 (21:43 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 16 Apr 2011 07:32:44 +0000 (08:32 +0100)
Remove all the run*locally scripts and replace with a single top level
./run shell script.

19 files changed:
Makefile.am
README
cat/Makefile.am
cat/run-cat-locally [deleted file]
cat/run-filesystems-locally [deleted file]
cat/run-ls-locally [deleted file]
df/Makefile.am
df/run-df-locally [deleted file]
inspector/Makefile.am
inspector/run-inspector-locally [deleted file]
rescue/Makefile.am
rescue/run-rescue-locally [deleted file]
resize/Makefile.am
resize/run-resize-locally [deleted file]
run [new file with mode: 0755]
test-tool/Makefile.am
test-tool/run-test-tool-locally [deleted file]
tools/Makefile.am
tools/run-locally [deleted file]

index 3d629e9..fcd190a 100644 (file)
@@ -105,7 +105,8 @@ EXTRA_DIST = \
        autogen.sh \
        bugs-in-changelog.sh \
        update-bugs.sh \
        autogen.sh \
        bugs-in-changelog.sh \
        update-bugs.sh \
-       logo/fish.svg logo/fish.png
+       logo/fish.svg logo/fish.png \
+       run
 
 # Recipes web page.
 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
 
 # Recipes web page.
 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
@@ -205,7 +206,7 @@ CLEANFILES = \
 # is NOT a substitute for proper testing!
 
 quickcheck:
 # is NOT a substitute for proper testing!
 
 quickcheck:
-       test-tool/run-test-tool-locally
+       ./run test-tool/libguestfs-test-tool
 
 # Make binary distribution.
 
 
 # Make binary distribution.
 
diff --git a/README b/README
index 4abc045..3960b61 100644 (file)
--- a/README
+++ b/README
@@ -113,6 +113,34 @@ this command as root:
 
   make install
 
 
   make install
 
+You can run the virt tools without needing to install, using the "run"
+script in the top directory.  This script sets up some environment
+variables.  For example:
+
+  ./run ./inspector/virt-inspector [usual virt-inspector args ...]
+
+If you are already in the inspector/ subdirectory, then the following
+command will also work:
+
+  ../run ./virt-inspector [...]
+
+You can also make a symlink (note: NOT a hard link) from your $PATH to
+the run script, eg:
+
+  cd ~/bin
+  ln -s ~/libguestfs/run libguestfs-run
+  cd ~/libguestfs
+  libguestfs-run ./inspector/virt-inspector [...]
+
+You can also run the C programs under valgrind like this:
+
+  ./run valgrind [valgrind opts...] ./cat/virt-cat [virt-cat opts...]
+
+This also works with sudo (eg. if you need root access for libvirt or
+to access a block device):
+
+  sudo ./run ./cat/virt-cat -d LinuxGuest /etc/passwd
+
 
 qemu
 ----------------------------------------------------------------------
 
 qemu
 ----------------------------------------------------------------------
index d7bc7e8..a049a61 100644 (file)
 include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
 include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
-       run-cat-locally \
        test-virt-cat.sh \
        virt-cat.pod \
        test-virt-cat.sh \
        virt-cat.pod \
-       run-filesystems-locally \
        test-virt-filesystems.sh \
        virt-filesystems.pod \
        test-virt-filesystems.sh \
        virt-filesystems.pod \
-       run-ls-locally \
        test-virt-ls.sh \
        virt-ls.pod
 
        test-virt-ls.sh \
        virt-ls.pod
 
diff --git a/cat/run-cat-locally b/cat/run-cat-locally
deleted file mode 100755 (executable)
index 9467ad6..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-cat-locally [usual virt-cat args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-my $tool = "cat";
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-#print (join " ", ("$path/$tool/virt-$tool", @ARGV), "\n");
-exec("$path/$tool/virt-$tool", @ARGV);
diff --git a/cat/run-filesystems-locally b/cat/run-filesystems-locally
deleted file mode 100755 (executable)
index 316cc6d..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-filesystems-locally [usual virt-filesystems args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-#print (join " ", ("$path/cat/virt-filesystems", @ARGV), "\n");
-exec("$path/cat/virt-filesystems", @ARGV);
diff --git a/cat/run-ls-locally b/cat/run-ls-locally
deleted file mode 100755 (executable)
index adc2cb6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-ls-locally [usual virt-ls args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-#print (join " ", ("$path/cat/virt-ls", @ARGV), "\n");
-exec("$path/cat/virt-ls", @ARGV);
index 81c190f..69c6140 100644 (file)
@@ -19,7 +19,6 @@ include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
        README \
 
 EXTRA_DIST = \
        README \
-       run-df-locally \
        test-virt-df.sh \
        virt-df.pod
 
        test-virt-df.sh \
        virt-df.pod
 
diff --git a/df/run-df-locally b/df/run-df-locally
deleted file mode 100755 (executable)
index 2456ab5..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-df-locally [usual virt-df args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-#print (join " ", ("$path/df/virt-df", @ARGV), "\n");
-exec("$path/df/virt-df", @ARGV);
index 435ba87..8024f98 100644 (file)
@@ -33,7 +33,6 @@ EXAMPLE_XML = \
        example-windows-xp-cd.xml
 
 EXTRA_DIST = \
        example-windows-xp-cd.xml
 
 EXTRA_DIST = \
-       run-inspector-locally \
        virt-inspector.pod
 
 CLEANFILES = stamp-virt-inspector.pod
        virt-inspector.pod
 
 CLEANFILES = stamp-virt-inspector.pod
@@ -101,17 +100,18 @@ endif
 
 example-debian.xml:
        rm -f $@ $@-t
 
 example-debian.xml:
        rm -f $@ $@-t
-       ./run-inspector-locally ../images/debian.img > $@-t
+       ../run $(builddir)/virt-inspector ../images/debian.img > $@-t
        mv $@-t $@
 example-fedora.xml:
        rm -f $@ $@-t
        mv $@-t $@
 example-fedora.xml:
        rm -f $@ $@-t
-       ./run-inspector-locally ../images/fedora.img > $@-t
+       ../run $(builddir)/virt-inspector ../images/fedora.img > $@-t
        mv $@-t $@
 example-ubuntu.xml:
        rm -f $@ $@-t
        mv $@-t $@
 example-ubuntu.xml:
        rm -f $@ $@-t
-       ./run-inspector-locally ../images/ubuntu.img > $@-t
+       ../run $(builddir)/virt-inspector ../images/ubuntu.img > $@-t
        mv $@-t $@
 example-windows.xml:
        rm -f $@ $@-t
        mv $@-t $@
 example-windows.xml:
        rm -f $@ $@-t
-       ./run-inspector-locally ../images/windows.img | fgrep -v '<uuid>' > $@-t
+       ../run $(builddir)/virt-inspector ../images/windows.img | \
+           fgrep -v '<uuid>' > $@-t
        mv $@-t $@
        mv $@-t $@
diff --git a/inspector/run-inspector-locally b/inspector/run-inspector-locally
deleted file mode 100755 (executable)
index e5c9f4a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/perl
-# libguestfs inspector
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-inspector in place
-# without needing to do 'make install' first. You can also run virt-inspector
-# by creating a symlink to this script and putting it in your path.
-#
-# Use it like this:
-#   ./run-inspector-locally [usual virt-inspector args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-exec($path.'/inspector/virt-inspector', @ARGV);
index a490341..0032a23 100644 (file)
@@ -18,7 +18,6 @@
 include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
 include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
-       run-rescue-locally \
        virt-rescue.pod
 
 CLEANFILES = stamp-virt-rescue.pod
        virt-rescue.pod
 
 CLEANFILES = stamp-virt-rescue.pod
diff --git a/rescue/run-rescue-locally b/rescue/run-rescue-locally
deleted file mode 100755 (executable)
index 95f3cc4..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-rescue-locally [usual virt-rescue args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-#print (join " ", ("$path/rescue/virt-rescue", @ARGV), "\n");
-exec("$path/rescue/virt-rescue", @ARGV);
index 838c78d..f3e6aff 100644 (file)
@@ -19,7 +19,6 @@ include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
        $(SOURCES) \
 
 EXTRA_DIST = \
        $(SOURCES) \
-       run-resize-locally \
        virt-resize.pod \
        test-virt-resize.sh
 
        virt-resize.pod \
        test-virt-resize.sh
 
diff --git a/resize/run-resize-locally b/resize/run-resize-locally
deleted file mode 100755 (executable)
index 0d840dd..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009-2011 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-resize-locally [usual virt-resize args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-my $tool = "resize";
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-#print (join " ", ("$path/$tool/virt-$tool", @ARGV), "\n");
-exec("$path/$tool/virt-$tool", @ARGV);
diff --git a/run b/run
new file mode 100755 (executable)
index 0000000..04152b1
--- /dev/null
+++ b/run
@@ -0,0 +1,42 @@
+#!/bin/bash -
+# libguestfs 'run' programs locally script
+# Copyright (C) 2011 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#----------------------------------------------------------------------
+
+# With this script you can run all the virt tools without needing to
+# install them first.  You just have to do for example:
+#
+#   ./run ./inspector/virt-inspector [args ...]
+#
+# This works for any C, OCaml or Perl virt tools in the libguestfs
+# distribution.  Also you can make a symbolic link to this 'run'
+# script from anywhere (eg. $HOME/bin/run) if you wish.
+
+#----------------------------------------------------------------------
+
+# Find this script.
+run=$(readlink -f "$0")
+b=$(dirname "$run")
+
+# Set local environment relative to this script.
+export LD_LIBRARY_PATH="$b/src/.libs"
+export LIBGUESTFS_PATH="$b/appliance"
+export PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch"
+
+# Run the program.
+libtool --mode=execute "$@"
index 5ce2164..1ed0820 100644 (file)
@@ -17,7 +17,7 @@
 
 include $(top_srcdir)/subdir-rules.mk
 
 
 include $(top_srcdir)/subdir-rules.mk
 
-EXTRA_DIST = libguestfs-test-tool.pod run-test-tool-locally
+EXTRA_DIST = libguestfs-test-tool.pod
 
 CLEANFILES =
 
 
 CLEANFILES =
 
diff --git a/test-tool/run-test-tool-locally b/test-tool/run-test-tool-locally
deleted file mode 100755 (executable)
index 21df4c5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2010-2011 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run
-# libguestfs-test-tool in place without needing to do 'make install'
-# first.  You can also run the test tool by creating a symlink to this
-# script and putting it in your path.
-#
-# Normal use is like this:
-#   ./run-test-tool-locally
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-my $tool = shift @ARGV;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-
-exec("$path/test-tool/libguestfs-test-tool",
-     "$path/test-tool/libguestfs-test-tool",
-     @ARGV);
index 806f244..6441333 100644 (file)
@@ -26,7 +26,6 @@ tools = \
        win-reg
 
 EXTRA_DIST = \
        win-reg
 
 EXTRA_DIST = \
-       run-locally \
        $(tools:%=virt-%) \
        test-virt-*.sh
 
        $(tools:%=virt-%) \
        test-virt-*.sh
 
diff --git a/tools/run-locally b/tools/run-locally
deleted file mode 100755 (executable)
index cb3dca8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/perl
-# Copyright (C) 2009 Red Hat Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# This script sets up the environment so you can run virt-* tools in
-# place without needing to do 'make install' first. You can also run
-# the tools by creating a symlink to this script and putting it in
-# your path.
-#
-# Use it like this:
-#   ./run-locally tool [usual virt-tool args ...]
-# eg:
-#   ./run-locally cat domname /etc/passwd
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-my $tool = shift @ARGV;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
-    my $link = readlink($path) or die "readlink: $path: $!";
-    if(File::Spec->file_name_is_absolute($link)) {
-        $path = $link;
-    } else {
-        $path = File::Spec->catfile(dirname($path), $link);
-    }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
-$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
-$ENV{PERL5LIB}        = $path.'/perl/blib/lib:'.$path.'/perl/blib/arch';
-
-#print (join " ", ("$path/tools/virt-$tool", @ARGV), "\n");
-exec('perl', "$path/tools/virt-$tool", @ARGV);