Re: Copyright year update

2024-01-05 Thread Eric Blake
On Mon, Jan 01, 2024 at 04:58:20PM -0800, Paul Eggert wrote:
> On 2024-01-01 16:08, Bernhard Voelker wrote:
> > That commit broke the 'update-copyright' tests, because the test script
> > got messed up.
> 
> Thanks for reporting that. Turing would have been amused by update-copyright
> modifying its own test, and then failing the modified test. I installed the
> attached to immunize the test against the program it tests.

> +++ b/tests/test-update-copyright.sh
> @@ -76,46 +76,53 @@ perl -e 'require 5.8.0' || {
>  UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
>  export UPDATE_COPYRIGHT_MAX_LINE_LENGTH
>  
> +# This assignment to 'ight' is is so that data can contain strings

duplicate 'is'

> +# like "Copy$ight 2024 Free Software Foundation, Inc." without being
> +# mistakenly updated by "cd .. && make update-copyright".
> +ight=right

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org




Re: Copyright year update

2024-01-02 Thread Bernhard Voelker

On 1/2/24 01:58, Paul Eggert wrote:

On 2024-01-01 16:08, Bernhard Voelker wrote:

That commit broke the 'update-copyright' tests, because the test script
got messed up.


Thanks for reporting that. Turing would have been amused by
update-copyright modifying its own test, and then failing the modified
test.


He, he, at least we were in good luck: :-)
the test was modified in a way that it failed ... 'update-copyright' could as 
well
have rendered its own test teeth-less, and then the self-defeating change would
have been unnoticed.


I installed the attached to immunize the test against the program
it tests.


Thanks!

Have a nice day,
Berny



Re: Copyright year update

2024-01-01 Thread Simon Josefsson via Gnulib discussion list
Paul Eggert  writes:

> On 2024-01-01 16:08, Bernhard Voelker wrote:
>> That commit broke the 'update-copyright' tests, because the test script
>> got messed up.
>
> Thanks for reporting that. Turing would have been amused by
> update-copyright modifying its own test, and then failing the modified 
> test. I installed the attached to immunize the test against the
> program it tests.

Indeed =)  Thanks for report Bernhard and patch Paul!

/Simon


signature.asc
Description: PGP signature


Re: Copyright year update

2024-01-01 Thread Paul Eggert

On 2024-01-01 16:08, Bernhard Voelker wrote:

That commit broke the 'update-copyright' tests, because the test script
got messed up.


Thanks for reporting that. Turing would have been amused by 
update-copyright modifying its own test, and then failing the modified 
test. I installed the attached to immunize the test against the program 
it tests.From d57daa5979535178a57789403506270b6311cc85 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Mon, 1 Jan 2024 16:51:51 -0800
Subject: [PATCH] update-copyright-tests: immunize against self

Problem reported by Bernhard Voelker in:
https://lists.gnu.org/r/bug-gnulib/2024-01/msg3.html
* tests/test-update-copyright.sh (ight): New var.
Use it in tests, to prevent update-copyright from
messing with the test data.
---
 ChangeLog  |   9 ++
 tests/test-update-copyright.sh | 187 ++---
 2 files changed, 109 insertions(+), 87 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af3cf23a6c..fc728584f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-01  Paul Eggert  
+
+	update-copyright-tests: immunize against self
+	Problem reported by Bernhard Voelker in:
+	https://lists.gnu.org/r/bug-gnulib/2024-01/msg3.html
+	* tests/test-update-copyright.sh (ight): New var.
+	Use it in tests, to prevent update-copyright from
+	messing with the test data.
+
 2023-12-29  Paul Eggert  
 
 	tests: don’t skip if LONG_MAX < pid
diff --git a/tests/test-update-copyright.sh b/tests/test-update-copyright.sh
index ff7a6b2770..a465617527 100755
--- a/tests/test-update-copyright.sh
+++ b/tests/test-update-copyright.sh
@@ -76,46 +76,53 @@ perl -e 'require 5.8.0' || {
 UPDATE_COPYRIGHT_MAX_LINE_LENGTH=72
 export UPDATE_COPYRIGHT_MAX_LINE_LENGTH
 
+# This assignment to 'ight' is is so that data can contain strings
+# like "Copy$ight 2024 Free Software Foundation, Inc." without being
+# mistakenly updated by "cd .. && make update-copyright".
+ight=right
+
 ## - ##
 ## Examples from documentation.  ##
 ## - ##
 
 TMP=$TMP_BASE-ex
 cat > $TMP-1 < $TMP-2 < $TMP-3 < $TMP-4 < $TMP-5 < $TMP-6 < $TMP-7 < $TMP-8 < $TMP.1 < $TMP.2 < $TMP.3 < $TMP.4 < $TMP < $TMP < $TMP < $TMP < $TMP < $TMP < $TMP <<\EOF
-Rem Copyright (C) 87, 88, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+tr @ '\015' > $TMP < $TMP-stdout 2> $TMP-stderr
 compare /dev/null $TMP-stdout || exit 1
 compare /dev/null $TMP-stderr || exit 1
-tr @ '\015' > $TMP-exp <<\EOF
-Rem Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,@
+tr @ '\015' > $TMP-exp < $TMP < $TMP.star < $TMP.space < $TMP.single-line < $TMP.single-line-wrapped < $TMP.extra-text-star < $TMP.extra-text-space < $TMP.two-digit-final-is-substr-of-first < $TMP-stdout 2> $TMP-stderr
 compare /dev/null $TMP-stdout || exit 1
 compare /dev/null $TMP-stderr || exit 1
 compare - $TMP.star <

Re: Copyright year update

2024-01-01 Thread Bernhard Voelker

On 1/1/24 10:33, Simon Josefsson via Gnulib discussion list wrote:

Happy hew year!

I was greeted with the seasonal

copyright_check
./gnulib/lib/version-etc.c
maint.mk: out of date copyright in ./gnulib/lib/version-etc.c; update it

in several projects, and did a copyright year bump.


Happy New Year.

That commit broke the 'update-copyright' tests, because the test script
got messed up.

  tests/test-update-copyright.sh| 26 +++

Try:
  $ ./gnulib-tool --test --dir /tmp/x --with-tests update-copyright

  $ cat /tmp/x/build/gltests/test-update-copyright.sh.log
  --- - 2024-01-02 00:37:20.557069138 +0100
  +++ update-copyright.test-ex-22024-01-02 00:37:20.547552987 +0100
  @@ -1 +1,3 @@
  -# Copyright (C) 2009-2024 Free Software Foundation, Inc.
  +# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
  +# 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2009 Free Software
  +# Foundation, Inc.
  FAIL test-update-copyright.sh (exit status: 1)

We should revert the change for that file, but I guess this is not
sufficient: the change to consider not only the first Copyright line
seems to interfere here.

It's late already, so I didn't check further.

Have a nice day,
Berny



Copyright year update

2024-01-01 Thread Simon Josefsson via Gnulib discussion list
Happy hew year!

I was greeted with the seasonal

copyright_check
./gnulib/lib/version-etc.c
maint.mk: out of date copyright in ./gnulib/lib/version-etc.c; update it

in several projects, and did a copyright year bump.

/Simon


signature.asc
Description: PGP signature