bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] no new tabs please (was: normalize leading and remove t


From: Paul Eggert
Subject: Re: [Bug-gnulib] no new tabs please (was: normalize leading and remove trailing white space from imported files)
Date: 13 Aug 2003 13:32:58 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:

> But please don't introduce tabs in files that didn't have them!

You're right, I was too enthusiastic in trying to merge.  Sorry.  I
undid most of yesterday's changes as follows.  There's no point to
removing trailing white space, if we're not going to bother with
normalizing other stuff, so I removed that too.

2003-08-13  Paul Eggert  <address@hidden>

        * config/srclist-update: Change update back to the old behavior,
        leaving whitespace alone.
        Use one 'sed' command rather than a pipeline.
        (fixlicense): Now a variable, not a function.
        (remove_trailing_blanks): Remove.
        (fixfile): Don't invoke unexpand or cat, or remove trailing blanks.

        * config/config.guess, config/config.sub, config/install-sh,
        config/missing, config/texinfo.tex: Undo previous
        (whitespace-only) change.
        * lib/argp-help.c, lib/argp-parse.c, lib/config.charset, lib/getopt.h:
        Undo previous (whitespace-only) change.
        * m4/gettext.m4, m4/iconv.m4, m4/intdiv0.m4,
        m4/inttypes-pri.m4, m4/lib-link.m4, m4/lib-prefix.m4,
        m4/longdouble.m4, m4/po.m4, m4/progtest.m4, m4/signed.m4: Undo
        previous (whitespace-only) change.

[Lots of boring "go-back-to-previous version" whitespace-only
 patches suppressed.]
Index: srclist-update
===================================================================
RCS file: /cvsroot/gnulib/gnulib/config/srclist-update,v
retrieving revision 1.12
retrieving revision 1.13
diff -p -u -r1.12 -r1.13
--- srclist-update      13 Aug 2003 07:04:57 -0000      1.12
+++ srclist-update      13 Aug 2003 20:23:14 -0000      1.13
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: srclist-update,v 1.12 2003/08/13 07:04:57 eggert Exp $
+# $Id: srclist-update,v 1.13 2003/08/13 20:23:14 eggert Exp $
 #
 # Check for files in directory $1 being up to date, according to the
 # list on stdin.  Don't actually make any changes, just show the diffs.
@@ -41,12 +41,8 @@ test -r $mydir/srclistvars.sh && . $mydi
 
 
 # 
-# $1 is input, output to stdout with gpl.
-#
-fixlicense() \
-{
-    sed '
-
+# sed command to fix the license to be GPL.
+fixlicense='
   /^\([[:space:]]*#[[:space:]]*\)Th[ei][ s].* is free 
software/,/^[[:space:]]*#.*USA\./c\
 #      This program is free software; you can redistribute it and/or modify\
 #      it under the terms of the GNU General Public License as published by\
@@ -76,35 +72,27 @@ fixlicense() \
    You should have received a copy of the GNU General Public License along\
    with this program; if not, write to the Free Software Foundation,\
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-' $1
-}
-
-
+'
 
 # sed command to remove lines containing $Id lines.
 # Quote the $Id so that CVS does not expand it in this script.
 remove_id_lines='/[$]Id:.*[$]/d'
 
-# sed command to remove trailing blanks.
-# Do not use [[:space:]] in this pattern, as that would kill formfeeds.
-remove_trailing_blanks='s/[     ][      ]*$//'
-
 # $1 is input file, $2 is output.
 # Remove $Id lines, since they'll differ between source locations.
 # If $options contains "gpl", change the license to be the standard
 # GPL.  We use this for libc files, et al.
-# Also, normalize white space simple-mindedly.
 #
 fixfile() \
 {
+  sed_command="$remove_id_lines"
+
   case " $options " in
   *' gpl '*)
-    fixlicense $1;;
-  *)
-    cat $1;;
-  esac \
-  | unexpand \
-  | sed "$remove_id_lines; $remove_trailing_blanks" >$2
+    sed_command="$sed_command; $fixlicense";;
+  esac
+
+  sed "$sed_command" $1 >$2
 }
 
 




reply via email to

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