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

Comparing ircd-hybrid-8/ylwrap (file contents):
Revision 1257 by michael, Sun Jan 15 06:28:46 2012 UTC vs.
Revision 1425 by michael, Wed Jun 6 08:44:22 2012 UTC

# Line 3 | Line 3
3  
4   scriptversion=2011-08-25.18; # UTC
5  
6 < # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
7 < # 2007, 2009, 2010, 2011 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=2011-08-25.18; # 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 63 | Line 62 | EOF
62      ;;
63   esac
64  
65 + get_dirname ()
66 + {
67 +  case $1 in
68 +    */*|*\\*) printf '%s\n' "$1" | sed -e 's,\([\\/]\)[^\\/]*$,\1,';;
69 +    # Otherwise,  we want the empty string (not ".").
70 +  esac
71 + }
72 +
73 + quote_for_sed ()
74 + {
75 +  # FIXME: really we should care about more than '.' and '\'.
76 +  sed -e 's,[\\.],\\&,g'
77 + }
78  
79   # The input.
80   input="$1"
81   shift
82 + # We'll later need for a correct munging of "#line" directives.
83 + input_sub_rx=`get_dirname "$input" | quote_for_sed`
84   case "$input" in
85    [\\/]* | ?:[\\/]*)
86      # Absolute path; do nothing.
# Line 126 | Line 140 | if test $ret -eq 0; then
140      y_tab_nodot="yes"
141    fi
142  
143 <  # The directory holding the input.
130 <  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
131 <  # Quote $INPUT_DIR so we can use it in a regexp.
132 <  # FIXME: really we should care about more than `.' and `\'.
133 <  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
143 >  input_rx=`get_dirname "$input" | quote_for_sed`
144  
145    while test "$#" -ne 0; do
146      from="$1"
# Line 146 | Line 156 | if test $ret -eq 0; then
156      fi
157      if test -f "$from"; then
158        # If $2 is an absolute path name, then just use that,
159 <      # otherwise prepend `../'.
159 >      # otherwise prepend '../'.
160        case "$2" in
161          [\\/]* | ?:[\\/]*) target="$2";;
162          *) target="../$2";;
# Line 162 | Line 172 | if test $ret -eq 0; then
172          realtarget="$target"
173          target="tmp-`echo $target | sed s/.*[\\/]//g`"
174        fi
175 <      # Edit out `#line' or `#' directives.
166 <      #
175 >      # Munge "#line" or "#" directives.
176        # We don't want the resulting debug information to point at
177 <      # an absolute srcdir; it is better for it to just mention the
169 <      # .y file with no path.
170 <      #
177 >      # an absolute srcdir.
178        # We want to use the real output file name, not yy.lex.c for
179        # instance.
173      #
180        # We want the include guards to be adjusted too.
181        FROM=`echo "$from" | sed \
182              -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
# Line 179 | Line 185 | if test $ret -eq 0; then
185              -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
186              -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
187  
188 <      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
188 >      sed -e "/^#/!b" -e "s,$input_rx,$input_sub_rx," -e "s,$from,$2," \
189            -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
190  
191        # Check whether header files must be updated.

Diff Legend

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