ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/ylwrap
(Generate patch)

Comparing:
ircd-hybrid/ylwrap (file contents), Revision 1028 by michael, Sun Nov 8 13:03:38 2009 UTC vs.
ircd-hybrid-8/ylwrap (file contents), Revision 1375 by michael, Fri Apr 27 08:01:46 2012 UTC

# Line 1 | Line 1
1   #! /bin/sh
2   # ylwrap - wrapper for lex/yacc invocations.
3  
4 < scriptversion=2009-04-28.21; # UTC
4 > scriptversion=2011-08-25.18; # UTC
5  
6 < # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
7 < # 2007, 2009 Free Software Foundation, Inc.
6 > # Copyright (C) 1996-2012 Free Software Foundation, Inc.
7   #
8   # Written by Tom Tromey <tromey@cygnus.com>.
9   #
# Line 32 | Line 31 | scriptversion=2009-04-28.21; # UTC
31  
32   case "$1" in
33    '')
34 <    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
34 >    echo "$0: No files given.  Try '$0 --help' for more information." 1>&2
35      exit 1
36      ;;
37    --basedir)
# Line 99 | Line 98 | esac
98   # FIXME: add hostname here for parallel makes that run commands on
99   # other machines.  But that might take us over the 14-char limit.
100   dirname=ylwrap$$
101 < trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
101 > do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
102 > trap "ret=129; $do_exit" 1
103 > trap "ret=130; $do_exit" 2
104 > trap "ret=141; $do_exit" 13
105 > trap "ret=143; $do_exit" 15
106   mkdir $dirname || exit 1
107  
108   cd $dirname
# Line 125 | Line 128 | if test $ret -eq 0; then
128    # The directory holding the input.
129    input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
130    # Quote $INPUT_DIR so we can use it in a regexp.
131 <  # FIXME: really we should care about more than `.' and `\'.
131 >  # FIXME: really we should care about more than '.' and '\'.
132    input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
133  
134    while test "$#" -ne 0; do
# Line 133 | Line 136 | if test $ret -eq 0; then
136      # Handle y_tab.c and y_tab.h output by DOS
137      if test $y_tab_nodot = "yes"; then
138        if test $from = "y.tab.c"; then
139 <        from="y_tab.c"
139 >        from="y_tab.c"
140        else
141 <        if test $from = "y.tab.h"; then
142 <          from="y_tab.h"
143 <        fi
141 >        if test $from = "y.tab.h"; then
142 >          from="y_tab.h"
143 >        fi
144        fi
145      fi
146      if test -f "$from"; then
147        # If $2 is an absolute path name, then just use that,
148 <      # otherwise prepend `../'.
148 >      # otherwise prepend '../'.
149        case "$2" in
150 <        [\\/]* | ?:[\\/]*) target="$2";;
151 <        *) target="../$2";;
150 >        [\\/]* | ?:[\\/]*) target="$2";;
151 >        *) target="../$2";;
152        esac
153  
154        # We do not want to overwrite a header file if it hasn't
# Line 155 | Line 158 | if test $ret -eq 0; then
158        # Makefile.  Divert the output of all other files to a temporary
159        # file so we can compare them to existing versions.
160        if test $first = no; then
161 <        realtarget="$target"
162 <        target="tmp-`echo $target | sed s/.*[\\/]//g`"
161 >        realtarget="$target"
162 >        target="tmp-`echo $target | sed s/.*[\\/]//g`"
163        fi
164 <      # Edit out `#line' or `#' directives.
164 >      # Edit out '#line' or '#' directives.
165        #
166        # We don't want the resulting debug information to point at
167        # an absolute srcdir; it is better for it to just mention the
# Line 180 | Line 183 | if test $ret -eq 0; then
183  
184        # Check whether header files must be updated.
185        if test $first = no; then
186 <        if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
187 <          echo "$2" is unchanged
188 <          rm -f "$target"
189 <        else
186 >        if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
187 >          echo "$2" is unchanged
188 >          rm -f "$target"
189 >        else
190            echo updating "$2"
191            mv -f "$target" "$realtarget"
192          fi

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)