From: andrew at starmedia.net (Andrew Csillag)
Date: Fri, 16 Apr 1999 15:57:57 GMT
Subject: Bug with makesetup on FreeBSD
Message-ID: <37175E05.4CF3C68@starmedia.net>
Content-Length: 1499
X-UID: 1511                                                  

makesetup in Python 1.5.1 and 1.5.2 bombs on lines in the Setup file
that use backslash continuation to break a module spec across lines on
FreeBSD.

FreeBSD's /bin/sh is the culprit.  It's read function doesn't continue
reading a line if the last char is a backslash.  For example:
input being:
somemodule  somemodule.c \
       -lsomelib
doing a read line only gets the first line and makesetup barfs on line
154 with invalid word on \ (as opposed to bash (or other sh's) that get
"somemodule  somemodule.c -lsomelib" back from read).

This patch to this works with both FreeBSD's sh and bash.  What it does
is this:
While the last char of $line is a \, read another line and glue it to
the original minus the \.

*** makesetup  Fri Apr 16 11:43:55 1999
--- makesetup  Fri Apr 16 11:43:12 1999
***************
*** 104,107 ****
--- 104,115 ----
        while read line
        do
+               #to handle backslashes for sh's that don't automatically
+               #continue a read when the last char is a backslash
+               while echo $line | grep '\\$' > /dev/null
+               do
+                       read extraline
+                       line=`echo $line| sed s/.$//`$extraline
+               done
+ 
                # Output DEFS in reverse order so first definition
overrides
                case $line in

Cheers,
Drew Csillag
-- 
"There are two major products that come out of Berkeley: 
LSD and UNIX. We don't believe this to be a coincidence." 
- Jeremy S. Anderson




