bug-gnulib
[Top][All Lists]
Advanced

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

Re: updating copyright years


From: Jim Meyering
Subject: Re: updating copyright years
Date: Tue, 04 Aug 2009 16:26:31 +0200

Jim Meyering wrote:

> Joel E. Denny wrote:
>> On Tue, 4 Aug 2009, Jim Meyering wrote:
>>
>>> Thanks for all of that.
>>> I've pushed that as well as your other three change sets,
>>> and one more change:
>>
>> Thanks.  Unfortunately, my email client ate the \r\n sequences in the DOS
>> EOL test.  Sorry about that.  The attached patch adds them back.
>>
>> From f7aecbdf27eea1a0a6eb0960dbb34627ff56ccb6 Mon Sep 17 00:00:00 2001
>> From: Joel E. Denny <address@hidden>
>> Date: Tue, 4 Aug 2009 09:37:54 -0400
>> Subject: [PATCH] update-copyright-tests: correctly test EOL=\r\n handling
>>
>> * tests/test-update-copyright.sh: Add back the \r on each line,
>> and add a comment saying it shouldn't be removed.
>
> Thanks, but I couldn't easily apply that, using git-am:
>
>   $ git am j
>   Applying: update-copyright-tests: correctly test EOL=\r\n handling
>   /gnulib/.git/rebase-apply/patch:31: trailing whitespace.
>   Rem \r\n on each line is intentional; don't change-->
>   /gnulib/.git/rebase-apply/patch:32: trailing whitespace.
>   Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
>   /gnulib/.git/rebase-apply/patch:33: trailing whitespace.
>   Rem 98, 1999, 2000, 2001, 2002, 2003,  2004, 2005, 2006, 2007, 2008,
>   /gnulib/.git/rebase-apply/patch:34: trailing whitespace.
>   Rem 2009 Free Software Foundation, Inc.
>   /gnulib/.git/rebase-apply/patch:44: trailing whitespace.
>   Rem \r\n on each line is intentional; don't change-->
>   warning: squelched 3 whitespace errors
>   warning: 8 lines add whitespace errors.
>
> and besides, mixing line endings in version-controlled
> files is not sustainable, since some editors tend to
> correct such anomalies.
>
> So how about this instead?

That was mistakenly on top of your change.
Here's a clean version that also uses \015 rather than
tr's slightly less portable \r.

>From 7ef1309415c41e2a3c361a80854d3866d310a87e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 4 Aug 2009 16:25:12 +0200
Subject: [PATCH] update-copyright-tests: correctly test EOL=\r\n handling

* tests/test-update-copyright.sh: Put \r at the end of some lines
for the dos-eol tests.  Based on a patch by Joel E. Denny.
---
 ChangeLog                      |    4 ++++
 tests/test-update-copyright.sh |   17 +++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8797352..f08df79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-08-04  Jim Meyering  <address@hidden>

+       update-copyright-tests: correctly test EOL=\r\n handling
+       * tests/test-update-copyright.sh: Put \r at the end of some lines
+       for the dos-eol tests.  Based on a patch by Joel E. Denny.
+
        maint.mk: make update-copyright exclusion list more configurable
        * top/maint.mk (update-copyright): Default to excluding COPYING,
        but allow an override, in case someone does want to update that file.
diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
index b72abbb..d8f0d0c 100755
--- a/tests/test-update-copyright.sh
+++ b/tests/test-update-copyright.sh
@@ -290,20 +290,21 @@ rm $TMP*
 ## --------- ##

 TMP=$TMP_BASE-dos-eol
-cat > $TMP <<EOF
-Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-Rem 98, 1999, 2000, 2001, 2002, 2003,  2004, 2005, 2006, 2007, 2008,
-Rem 2009 Free Software Foundation, Inc.
+tr @ '\015' > $TMP <<\EOF
+Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+Rem 98, 1999, 2000, 2001, 2002, 2003,  2004, 2005, 2006, 2007, 2008,@
+Rem 2009 Free Software Foundation, Inc.@
 EOF
 UPDATE_COPYRIGHT_YEAR=2010 \
   update-copyright $TMP 1> $TMP-stdout 2> $TMP-stderr
 diff -u /dev/null $TMP-stdout || exit 1
 diff -u /dev/null $TMP-stderr || exit 1
-diff -u - $TMP <<EOF || exit 1
-Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,
-Rem 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-Rem 2009-2010 Free Software Foundation, Inc.
+tr @ '\015' > $TMP-exp <<\EOF
+Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 98,@
+Rem 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,@
+Rem 2009-2010 Free Software Foundation, Inc.@
 EOF
+diff -u $TMP-exp $TMP || exit 1
 rm $TMP*

 exit 0
--
1.6.4.70.g9c084




reply via email to

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