From: Richard W.M. Jones Date: Sat, 16 Apr 2011 06:28:47 +0000 (+0100) Subject: Remove local LIBGUESTFS_PATH detection from guestfish and guestmount. X-Git-Tag: 1.11.1~2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=33a2c184e12c0bdbf061a9f36c87d76c28444712;p=libguestfs.git Remove local LIBGUESTFS_PATH detection from guestfish and guestmount. Remove the hack that let you run ./fish/guestfish or ./fuse/guestmount. You now have to do: ./run ./fish/guestfish or ./run ./fuse/guestmount to run these programs without installing. --- diff --git a/README b/README index 3960b61..2722035 100644 --- a/README +++ b/README @@ -113,16 +113,18 @@ this command as root: 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: +You can run guestfish, guestmount and 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 ./fish/guestfish [usual guestfish args ...] ./run ./inspector/virt-inspector [usual virt-inspector args ...] -If you are already in the inspector/ subdirectory, then the following +If you are already in the fish/ subdirectory, then the following command will also work: - ../run ./virt-inspector [...] + ../run ./guestfish [...] You can also make a symlink (note: NOT a hard link) from your $PATH to the run script, eg: diff --git a/contrib/guestfsd-in-wine.sh b/contrib/guestfsd-in-wine.sh index 85146eb..bc9d87b 100755 --- a/contrib/guestfsd-in-wine.sh +++ b/contrib/guestfsd-in-wine.sh @@ -60,11 +60,7 @@ guestfsd=daemon/guestfsd.exe # # For example from the top build directory: # -# LIBGUESTFS_QEMU=contrib/guestfsd-in-wine.sh fish/guestfish -# -# You might also need to set the environment variable LIBGUESTFS_PATH -# to point to an appliance. The appliance will never be used, but -# libguestfs needs to find one. +# LIBGUESTFS_QEMU=contrib/guestfsd-in-wine.sh ./run ./fish/guestfish # # Another suggested environment variable is LIBGUESTFS_DEBUG=1 which # will give you must more detail about what is going on. Also look at diff --git a/fish/fish.c b/fish/fish.c index d6fed36..a57472f 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -220,19 +220,6 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } - /* If developing, add ./appliance to the path. Note that libtools - * interferes with this because uninstalled guestfish is a shell - * script that runs the real program with an absolute path. Detect - * that too. - * - * BUT if LIBGUESTFS_PATH environment variable is already set by - * the user, then don't override it. - */ - if (getenv ("LIBGUESTFS_PATH") == NULL && - argv[0] && - (argv[0][0] != '/' || strstr (argv[0], "/.libs/lt-") != NULL)) - guestfs_set_path (g, "appliance:" GUESTFS_DEFAULT_PATH); - /* CAUTION: we are careful to modify argv[0] here, only after * using it just above. * diff --git a/fuse/guestmount.c b/fuse/guestmount.c index 8d483b3..1e3b5db 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -1034,19 +1034,6 @@ main (int argc, char *argv[]) */ ADD_FUSE_ARG ("-s"); - /* If developing, add ./appliance to the path. Note that libtools - * interferes with this because uninstalled guestfish is a shell - * script that runs the real program with an absolute path. Detect - * that too. - * - * BUT if LIBGUESTFS_PATH environment variable is already set by - * the user, then don't override it. - */ - if (getenv ("LIBGUESTFS_PATH") == NULL && - argv[0] && - (argv[0][0] != '/' || strstr (argv[0], "/.libs/lt-") != NULL)) - guestfs_set_path (g, "appliance:" GUESTFS_DEFAULT_PATH); - for (;;) { c = getopt_long (argc, argv, options, long_options, &option_index); if (c == -1) break; diff --git a/images/guest-aux/make-debian-img.sh b/images/guest-aux/make-debian-img.sh index 2170cec..9a01e93 100755 --- a/images/guest-aux/make-debian-img.sh +++ b/images/guest-aux/make-debian-img.sh @@ -31,7 +31,7 @@ LABEL=BOOT /boot ext2 default 0 0 EOF # Create a disk image. -../fish/guestfish <<'EOF' +../run ../fish/guestfish <<'EOF' sparse debian.img.tmp 512M run diff --git a/images/guest-aux/make-fedora-img.sh b/images/guest-aux/make-fedora-img.sh index 8f198f6..0e064b4 100755 --- a/images/guest-aux/make-fedora-img.sh +++ b/images/guest-aux/make-fedora-img.sh @@ -31,7 +31,7 @@ LABEL=ROOT / ext2 default 0 0 EOF # Create a disk image. -../fish/guestfish <<'EOF' +../run ../fish/guestfish <<'EOF' sparse fedora.img.tmp 512M run diff --git a/images/guest-aux/make-ubuntu-img.sh b/images/guest-aux/make-ubuntu-img.sh index f008c76..4ddb40a 100755 --- a/images/guest-aux/make-ubuntu-img.sh +++ b/images/guest-aux/make-ubuntu-img.sh @@ -36,7 +36,7 @@ DISTRIB_DESCRIPTION="Ubuntu 10.10 (Phony Pharaoh)" EOF # Create a disk image. -../fish/guestfish <<'EOF' +../run ../fish/guestfish <<'EOF' sparse ubuntu.img.tmp 512M run diff --git a/images/guest-aux/make-windows-img.sh b/images/guest-aux/make-windows-img.sh index f659f4b..3acb2b7 100755 --- a/images/guest-aux/make-windows-img.sh +++ b/images/guest-aux/make-windows-img.sh @@ -25,7 +25,7 @@ set -e # ntfs-3g/ntfsprogs then we cannot create a Windows phony image. # Nothing actually uses windows.img in the standard build so we can # just 'touch' it and emit a warning. -if ! ../fish/guestfish -a /dev/null run : available "ntfs3g ntfsprogs"; then +if ! ../run ../fish/guestfish -a /dev/null run : available "ntfs3g ntfsprogs"; then echo "***" echo "Warning: cannot create windows.img because there is no NTFS" echo "support in this build of libguestfs. Just touching the output" @@ -36,7 +36,7 @@ if ! ../fish/guestfish -a /dev/null run : available "ntfs3g ntfsprogs"; then fi # Create a disk image. -../fish/guestfish <<'EOF' +../run ../fish/guestfish <<'EOF' sparse windows.img.tmp 512M run