automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ylwrap issues


From: Tim Van Holder
Subject: ylwrap issues
Date: Sun, 10 Jun 2001 19:31:14 +0200

I'm in the process of autoconfiscating the lclint source
tree (partly as an effort to support open source, partly
to force myself to learn automake), and ran into problems
with ylwrap.

First off, automake sets YLWRAP to $(srcdir)/ylwrap if
no config dir was set; this should be $(top_srcdir), as
that's where automake installs it.
Further, the script itself isn't DOS-path-friendly.

A patch for both issues follows; there is one major caveat
though - in order to quote DOS paths properly, echo must
not expand escapes.  In my case, bash's echo builtin
expands backslash-escapes by default and needs -E to
prevent that, so the patch below uses echo -E.  I'm not
sure whether this is portable though; I'm probably better
off compiling my bash with this behaviour disabled.

2001-06-10  Tim Van Holder  <address@hidden>

        * automake.in: Set YLWRAP to $(top_srcdir)/ylwrap when
        there is no configuration dir set up.
        * lib/ylwrap: Support DOS-style paths.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1137
diff -u -r1.1137 automake.in
--- automake.in 2001/06/09 00:34:28     1.1137
+++ automake.in 2001/06/10 17:20:29
@@ -5027,7 +5027,7 @@
     }
     else
     {
-       &define_variable ('YLWRAP', '$(srcdir)/ylwrap');
+       &define_variable ('YLWRAP', '$(top_srcdir)/ylwrap');
     }
 }
 
Index: lib/ylwrap
===================================================================
RCS file: /cvs/automake/automake/lib/ylwrap,v
retrieving revision 1.16
diff -u -r1.16 ylwrap
--- ylwrap      2001/05/15 03:33:20     1.16
+++ ylwrap      2001/06/10 17:20:31
@@ -31,8 +31,8 @@
 shift
 # Make any relative path in $prog absolute.
 case "$prog" in
- /* | [A-Za-z]:*) ;;
- */*) prog="`pwd`/$prog" ;;
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog="`pwd`/$prog" ;;
 esac
 
 # We also have to accept options here and append them to the program.
@@ -54,7 +54,7 @@
 input="$1"
 shift
 case "$input" in
- /* | [A-Za-z]:*)
+ [\\/]* | ?:[\\/]*)
     # Absolute path; do nothing.
     ;;
  *)
@@ -64,12 +64,11 @@
 esac
 
 # The directory holding the input.
-input_dir="`echo $input | sed -e 's,/[^/]*$,,'`"
-# Quote $INPUT_DIR so we can use it in a regexp.
-# FIXME: really we should care about more than `.'.
-input_rx="`echo $input_dir | sed -e 's,\.,\\\.,g'`"
+input_dir=`echo -E $input | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
 
-echo "got $input_rx"
+# Quote $INPUT_DIR so we can use it in a regexp.
+# FIXME: really we should care about more than `.' and `\'.
+input_rx=`echo -E $input_dir | sed -e 's,\.,\\\.,g' -e 's,\\\,\\\\,g'`
 
 pairlist=
 while test "$#" -ne 0; do
@@ -120,7 +119,7 @@
          # If $2 is an absolute path name, then just use that,
          # otherwise prepend `../'.
          case "$2" in
-          /* | [A-Za-z]:*) target="$2";;
+          [\\/]* | ?:[\\/]*) target="$2";;
           *) target="../$2";;
         esac
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]