X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=cat%2Frun-cat-locally;h=9467ad6afd5e5d0f592ac090a5693e7d568f0421;hb=189a2f3075aa7073b608409382bd55cfa375f458;hp=bba2c08834669c38339ba08928eef84637376e5b;hpb=bdf7a27a790ff26664f91d95239ec33c5467bfeb;p=libguestfs.git diff --git a/cat/run-cat-locally b/cat/run-cat-locally index bba2c08..9467ad6 100755 --- a/cat/run-cat-locally +++ b/cat/run-cat-locally @@ -1,5 +1,4 @@ #!/usr/bin/perl -# virt-cat # Copyright (C) 2009 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify @@ -16,9 +15,10 @@ # 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-cat in place -# without needing to do 'make install' first. You can also run virt-cat -# by creating a symlink to this script and putting it in your path. +# 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 ...] @@ -31,10 +31,11 @@ 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); + my $link = readlink($path) or die "readlink: $path: $!"; if(File::Spec->file_name_is_absolute($link)) { $path = $link; } else { @@ -47,6 +48,6 @@ $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'; -exec('perl', $path.'/cat/virt-cat.pl', @ARGV); +#print (join " ", ("$path/$tool/virt-$tool", @ARGV), "\n"); +exec("$path/$tool/virt-$tool", @ARGV);