Matthew Booth
2011-Nov-23 16:35 UTC
[Libguestfs] [PATCH] run script: Don't overwrite LD_LIBRARY_PATH and PERL5LIB
This change allows the run scripts of virt-v2v and libguestfs to be chained. --- run.in | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/run.in b/run.in index 9388398..7cef715 100755 --- a/run.in +++ b/run.in @@ -37,9 +37,19 @@ b=@abs_builddir@ export TMPDIR="$b" # 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" +if [ -z "$LD_LIBRARY_PATH" ]; then + LD_LIBRARY_PATH="$b/src/.libs" +else + LD_LIBRARY_PATH="$b/src/.libs:$LD_LIBRARY_PATH" +fi +if [ -z "$PERL5LIB" ]; then + PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch" +else + PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch:$PERL5LIB" +fi +LIBGUESTFS_PATH="$b/appliance" + +export LD_LIBRARY_PATH PERL5LIB LIBGUESTFS_PATH # Do we have libtool? If we have it then we can use it to make # running valgrind simpler. However don't depend on it. -- 1.7.6.4
Richard W.M. Jones
2011-Nov-24 11:53 UTC
[Libguestfs] [PATCH] run script: Don't overwrite LD_LIBRARY_PATH and PERL5LIB
On Wed, Nov 23, 2011 at 04:35:10PM +0000, Matthew Booth wrote:> This change allows the run scripts of virt-v2v and libguestfs to be chained. > --- > run.in | 16 +++++++++++++--- > 1 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/run.in b/run.in > index 9388398..7cef715 100755 > --- a/run.in > +++ b/run.in > @@ -37,9 +37,19 @@ b=@abs_builddir@ > export TMPDIR="$b" > > # 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" > +if [ -z "$LD_LIBRARY_PATH" ]; then > + LD_LIBRARY_PATH="$b/src/.libs" > +else > + LD_LIBRARY_PATH="$b/src/.libs:$LD_LIBRARY_PATH" > +fi > +if [ -z "$PERL5LIB" ]; then > + PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch" > +else > + PERL5LIB="$b/perl/blib/lib:$b/perl/blib/arch:$PERL5LIB" > +fi > +LIBGUESTFS_PATH="$b/appliance" > + > +export LD_LIBRARY_PATH PERL5LIB LIBGUESTFS_PATH > > # Do we have libtool? If we have it then we can use it to make > # running valgrind simpler. However don't depend on it.ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Reasonably Related Threads
- [PATCH] Prepend local library path to LD_LIBRARY_PATH for tests, instead of replacing it
- GObject bindings
- Various fixes from building libguestfs for Debian
- [PATCH 1/2] Revert "perl: Fix build and test to work with separated builds."
- [Bug 102106] New: xorg crashes when running gscan2pdf (libgtk2-perl) test case