automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.12-83-g9


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.12-83-g91ac5d2
Date: Sat, 19 May 2012 12:08:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=91ac5d2cf4ad0f1b28776d06a713118a4b191a47

The branch, maint has been updated
       via  91ac5d2cf4ad0f1b28776d06a713118a4b191a47 (commit)
       via  b6359a5f310160c8a4a2e8e8c0105408412ce400 (commit)
       via  0ce63a38ab7c87502504ba7d2319886d4f4a7d15 (commit)
      from  7b142a7b363a49be43ff861abc2dca5af9593f9d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 91ac5d2cf4ad0f1b28776d06a713118a4b191a47
Merge: 7b142a7 b6359a5
Author: Stefano Lattarini <address@hidden>
Date:   Sat May 19 13:22:12 2012 +0200

    Merge branch 'ylwrap-line-filename' into maint
    
    * ylwrap-line-filename:
      ylwrap: preserve subdirectories in "#line" munging
      ylwrap: preparatory refactoring

commit b6359a5f310160c8a4a2e8e8c0105408412ce400
Author: Nikolai Weibull <address@hidden>
Date:   Wed May 16 18:16:41 2012 +0200

    ylwrap: preserve subdirectories in "#line" munging
    
    If Automake is used in non-recursive mode and one of the inputs is a
    yacc file, for example, "src/grammar.y", ylwrap will remove too many
    directories from the output file when it adjusts the paths in it.
    This results in #line directives referring to "grammar.y" instead of
    "src/grammar.y".
    
    This is a result of $input_rx simply taking all the directory
    components of the absolute input path and removing them.
    
    One solution is to store the path passed to ylwrap and replace
    $input_rx with it.  This is what we do.
    
    Suggestion and initial patch (without tests) by Nikolai Weibull:
    <http://lists.gnu.org/archive/html/automake/2012-05/msg00013.html>
    Final patch by Stefano Lattarini.
    
    * lib/ylwrap ($input_sub_rx): New.
    When munging the #line directives, substitute '$input_rx' with it,
    instead of stripping it altogether.
    Adjust comments.
    * t/yacc-line.sh, t/lex-line: Adjust and extend.
    * NEWS, THANKS: Update.
    
    Copyright-paperwork-exempt: yes
    Co-authored-by: Stefano Lattarini <address@hidden>
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 0ce63a38ab7c87502504ba7d2319886d4f4a7d15
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 16 17:35:05 2012 +0200

    ylwrap: preparatory refactoring
    
    This commit should cause no semantic change in the ylwrap behaviour.
    It will only be needed in light of a future change.  See:
    <http://lists.gnu.org/archive/html/automake/2012-05/msg00013.html>
    
    * lib/ylwrap (get_dirname, quote_for_sed): New functions, factoring
    out some non-trivial code.  Use them where appropriate.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 NEWS           |    9 +++++++++
 THANKS         |    1 +
 lib/ylwrap     |   31 +++++++++++++++++++------------
 t/lex-line.sh  |   29 ++++++++++++++++++++---------
 t/yacc-line.sh |   28 ++++++++++++++++++++--------
 5 files changed, 69 insertions(+), 29 deletions(-)

diff --git a/NEWS b/NEWS
index d0575e6..944f7f9 100644
--- a/NEWS
+++ b/NEWS
@@ -103,6 +103,15 @@ Bugs fixed in 1.12.1:
   - Several inefficiencies and poor performances in the implementation
     of the parallel-tests 'check' and 'recheck' targets have been fixed.
 
+  - The post-processing of output "#line" directives done the ylwrap
+    script is more faithful w.r.t. files in a subdirectory; for example,
+    if the processed file is "src/grammar.y", ylwrap will correctly
+    produce directives like:
+        #line 7 "src/grammar.y"
+    rather than like
+        #line 7 "grammar.y"
+    as it did before.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 New in 1.12:
diff --git a/THANKS b/THANKS
index b98b2b7..0824c4f 100644
--- a/THANKS
+++ b/THANKS
@@ -269,6 +269,7 @@ Nicolas Joly                    address@hidden
 Nicolas Thiery                  address@hidden
 NightStrike                     address@hidden
 Nik A. Melchior                 address@hidden
+Nikolai Weibull                 address@hidden
 NISHIDA Keisuke                 address@hidden
 Noah Friedman                   address@hidden
 Norman Gray                     address@hidden
diff --git a/lib/ylwrap b/lib/ylwrap
index 36543da..6879d8d 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -62,10 +62,25 @@ EOF
     ;;
 esac
 
+get_dirname ()
+{
+  case $1 in
+    */*|*\\*) printf '%s\n' "$1" | sed -e 's,\([\\/]\)[^\\/]*$,\1,';;
+    # Otherwise,  we want the empty string (not ".").
+  esac
+}
+
+quote_for_sed ()
+{
+  # FIXME: really we should care about more than '.' and '\'.
+  sed -e 's,[\\.],\\&,g'
+}
 
 # The input.
 input="$1"
 shift
+# We'll later need for a correct munging of "#line" directives.
+input_sub_rx=`get_dirname "$input" | quote_for_sed`
 case "$input" in
   [\\/]* | ?:[\\/]*)
     # Absolute path; do nothing.
@@ -125,11 +140,7 @@ if test $ret -eq 0; then
     y_tab_nodot="yes"
   fi
 
-  # The directory holding the input.
-  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
-  # Quote $INPUT_DIR so we can use it in a regexp.
-  # FIXME: really we should care about more than '.' and '\'.
-  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+  input_rx=`get_dirname "$input" | quote_for_sed`
 
   while test "$#" -ne 0; do
     from="$1"
@@ -161,15 +172,11 @@ if test $ret -eq 0; then
         realtarget="$target"
         target="tmp-`echo $target | sed s/.*[\\/]//g`"
       fi
-      # Edit out '#line' or '#' directives.
-      #
+      # Munge "#line" or "#" directives.
       # We don't want the resulting debug information to point at
-      # an absolute srcdir; it is better for it to just mention the
-      # .y file with no path.
-      #
+      # an absolute srcdir.
       # We want to use the real output file name, not yy.lex.c for
       # instance.
-      #
       # We want the include guards to be adjusted too.
       FROM=`echo "$from" | sed \
             -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
@@ -178,7 +185,7 @@ if test $ret -eq 0; then
             -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
             -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
 
-      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+      sed -e "/^#/!b" -e "s,$input_rx,$input_sub_rx," -e "s,$from,$2," \
           -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
 
       # Check whether header files must be updated.
diff --git a/t/lex-line.sh b/t/lex-line.sh
index f690e7e..a95faf3 100755
--- a/t/lex-line.sh
+++ b/t/lex-line.sh
@@ -104,18 +104,29 @@ for vpath in : false; do
 
   # For debugging,
   ls -l . sub sub/dir
-  $FGREP '.l' $c_outputs
+  $EGREP 'line|\.l' $c_outputs
 
-  # Adjusted "#line" should not contain reference to the builddir.
-  $EGREP '#.*line.*(build|\.\.).*\.l' $c_outputs && Exit 1
+  grep '#.*line.*build.*\.l' $c_outputs && Exit 1
+  # Adjusted "#line" should not contain reference to the absolute
+  # srcdir.
+  $EGREP '#.*line *"?/.*\.l' $c_outputs && Exit 1
   # Adjusted "#line" should not contain reference to the default
   # output file names, e.g., 'lex.yy.c'.
-  $EGREP '#.*line.*lex\.yy' $c_outputs && Exit 1
-  # Don't be excessively strict in grepping, to avoid spurious failures.
-  grep '#.*line.*zardoz\.l' zardoz.c
-  grep '#.*line.*quux\.l' bar-quux.c
-  grep '#.*line.*zardoz\.l' sub/foo-zardoz.c
-  grep '#.*line.*quux\.l' sub/dir/quux.c
+  grep '#.*line.*lex\.yy' $c_outputs && Exit 1
+  # Look out for a silly regression.
+  grep "#.*\.l.*\.l" $c_outputs && Exit 1
+  if $vpath; then
+    grep '#.*line.*"\.\./zardoz\.l"' zardoz.c
+    grep '#.*line.*"\.\./dir/quux\.l"' bar-quux.c
+    grep '#.*line.*"\.\./\.\./sub/zardoz\.l"' sub/foo-zardoz.c
+    grep '#.*line.*"\.\./\.\./sub/dir/quux\.l"' sub/dir/quux.c
+  else
+    grep '#.*line.*"zardoz\.l"' zardoz.c
+    grep '#.*line.*"dir/quux\.l"' bar-quux.c
+    grep '#.*line.*"zardoz\.l"' sub/foo-zardoz.c
+    grep '#.*line.*"dir/quux\.l"' sub/dir/quux.c
+  fi
+
   cd $srcdir
 
 done
diff --git a/t/yacc-line.sh b/t/yacc-line.sh
index 090b72b..d122157 100755
--- a/t/yacc-line.sh
+++ b/t/yacc-line.sh
@@ -94,18 +94,30 @@ for vpath in : false; do
 
   # For debugging,
   ls -l . sub sub/dir
-  $FGREP '.y' $c_outputs
+  $EGREP 'line|\.y' $c_outputs
 
   # Adjusted "#line" should not contain reference to the builddir.
-  $EGREP '#.*line.*(build|\.\.).*\.y' $c_outputs && Exit 1
+  grep '#.*line.*build.*\.y' $c_outputs && Exit 1
+  # Adjusted "#line" should not contain reference to the absolute
+  # srcdir.
+  $EGREP '#.*line *"?/.*\.y' $c_outputs && Exit 1
   # Adjusted "#line" should not contain reference to the default
   # output file names, e.g., 'y.tab.c' and 'y.tab.h'.
-  $EGREP '#.*line.*y\.tab\.' $c_outputs && Exit 1
-  # Don't be excessively strict in grepping, to avoid spurious failures.
-  grep '#.*line.*zardoz\.y' zardoz.c
-  grep '#.*line.*quux\.y' bar-quux.c
-  grep '#.*line.*zardoz\.y' sub/foo-zardoz.c
-  grep '#.*line.*quux\.y' sub/dir/quux.c
+  grep '#.*line.*y\.tab\.' $c_outputs && Exit 1
+  # Look out for a silly regression.
+  grep "#.*\.y.*\.y" $c_outputs && Exit 1
+  if $vpath; then
+    grep '#.*line.*"\.\./zardoz\.y"' zardoz.c
+    grep '#.*line.*"\.\./dir/quux\.y"' bar-quux.c
+    grep '#.*line.*"\.\./\.\./sub/zardoz\.y"' sub/foo-zardoz.c
+    grep '#.*line.*"\.\./\.\./sub/dir/quux\.y"' sub/dir/quux.c
+  else
+    grep '#.*line.*"zardoz\.y"' zardoz.c
+    grep '#.*line.*"dir/quux\.y"' bar-quux.c
+    grep '#.*line.*"zardoz\.y"' sub/foo-zardoz.c
+    grep '#.*line.*"dir/quux\.y"' sub/dir/quux.c
+  fi
+
   cd $srcdir
 
 done


hooks/post-receive
-- 
GNU Automake



reply via email to

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