[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH]: transform_libtool_scripts.py

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 16 Dec 2010 22:08:14 +0000

Philip Martin <philip.martin_at_wandisco.com> writes:

> I don't know what the new script is doing differently from the old
> script. They both generate a whitespace separated list of libraries.
> The new script should have a more accurate list.

With some help from Stefan. The new script produces:

LD_PRELOAD=""
export LD_PRELOAD

and OpenBSD doesn't handle the empty list. The list is empty because
OpenBSD doesn't have .so files so the -f test removes all the libraries.
It appears to have .so.0.0 files.

It turns out that the old script was also broken on OpenBSD. It
produced:

LD_PRELOAD=""#
export LD_PRELOAD# The svn program cannot be directly executed until all the libtool

The # prevents the export line working which means the empty LD_PRELOAD
is not exported.

Here's a patch:

* build/generator/gen_make.py
  (write_transform_libtool_scripts): Look for .so.0 and .so.0.0, don't
   write LD_PRELOAD lines if empty.

Index: build/generator/gen_make.py
===================================================================
--- build/generator/gen_make.py (revision 1050098)
+++ build/generator/gen_make.py (working copy)
@@ -493,24 +493,34 @@
         case $LIB in
           *libsvn_test-*) continue ;;
         esac
- if [ -f $LIB ]; then
- if [ -z "$EXISTINGLIBS" ]; then
- EXISTINGLIBS="$LIB"
- else
- EXISTINGLIBS="$EXISTINGLIBS $LIB"
- fi
+ if [ ! -f $LIB ]; then
+ LIB=${LIB}.0
+ if [ ! -f $LIB ]; then
+ LIB=${LIB}.0
+ if [ ! -f $LIB ]; then
+ continue
+ fi
+ fi
         fi
+
+ if [ -z "$EXISTINGLIBS" ]; then
+ EXISTINGLIBS="$LIB"
+ else
+ EXISTINGLIBS="$EXISTINGLIBS $LIB"
+ fi
       done
- cat "$SCRIPT" |
- (
- read LINE
- echo "$LINE"
- echo "LD_PRELOAD=\\"$EXISTINGLIBS\\""
- echo "export LD_PRELOAD"
- cat
- ) < "$SCRIPT" > "$SCRIPT.new"
- mv -f "$SCRIPT.new" "$SCRIPT"
- chmod +x "$SCRIPT"
+ if [ ! -z "$EXISTINGLIBS" ]; then
+ cat "$SCRIPT" |
+ (
+ read LINE
+ echo "$LINE"
+ echo "LD_PRELOAD=\\"$EXISTINGLIBS\\""
+ echo "export LD_PRELOAD"
+ cat
+ ) < "$SCRIPT" > "$SCRIPT.new"
+ mv -f "$SCRIPT.new" "$SCRIPT"
+ chmod +x "$SCRIPT"
+ fi
     fi
   fi
 }

-- 
Philip
Received on 2010-12-16 23:08:55 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.