On Saturday, 22 October 2022 12:09:30 CEST you wrote:
> Thank you. This does not throw an error, but does not work as expected
> either:
> (sid)ametzler@argenau:/tmp/GUILE-GNUTLS/guile-gnutls-3.7.9$ cat
> debian/fix.scanned.copyright ! Files:"*" Copyright=~"s/, Free Software$/,
> Free Software Foundation, Inc./"
> (sid)ametzler@argenau:/tmp/GUILE-GNUTLS/guile-gnutls-3.7.9$ >
> debian/copyright && cme update dpkg-copyright > /dev/null 2>&1
> (sid)ametzler@argenau:/tmp/GUILE-GNUTLS/guile-gnutls-3.7.9$ grep ', Free
> Software$' debian/copyright Copyright: 2007-2012, 2014-2016, 2019, 2021,
> 2022, Free Software
> Copyright: 2004, 2005, 2007-2009, 2011-2015, Free Software

Hmm, Looking at guile-gnutls copyright file [1],  I see that this entry is 
correct:

Files: *
Copyright: 1985, 1986, 1988, 1990-2021, Free Software Foundation, Inc.
License: GPL-3+

whereas the following entry is not:

Files: guile/modules/gnutls.in
Copyright: 2007-2012, 2014-2016, 2019, 2021, 2022, Free Software
License: LGPL-2.1+

So, I assume you want to apply the instruction specified in 
fix.scanned.copyright to change all copyright entries.

Which is not the case because 

"! Files:"*"Copyright=~"s/, Free Software$/, Free Software Foundation, Inc./"

applies *only* on:

Files: *
Copyright: 1985, 1986, 1988, 1990-2021, Free Software Foundation, Inc.
License: GPL-3+

If you want to fix all copyright entries, you should use the foreach_match 
instruction [2].

For instance, starting from [1], I can fix the wrong copyright entries with 
(note the Files argument is different):

$ cme modify dpkg-copyright '! Files:~/.*/ Copyright=~"s/, Free Software$/, 
Free Software Foundation, Inc./"'
Warning in 'Files:"build-aux/ltmain.sh" License short_name': licensecheck found 
an ambiguous license statement. Please:
- check the source code to find the actual license association
- override this value using "override-license" parameter in 
"debian/fill.copyright.blanks.yml" file.
See "Filling the blanks" section in Dpkg::Copyright::Scanner(3pm) man page for 
details  (this cannot be fixed with 'cme fix' command)
Offending value: '(GPL-2+ and/or GPL-3+) with Libtool exception'

Changes applied to dpkg-copyright configuration:
- Files:"guile/modules/gnutls.in" Copyright: '2007-2012, 2014-2016, 2019, 2021, 
2022, Free Software' -> '2007-2012, 2014-2016, 2019, 2021, 2022, Free Software 
Founda[...]'
- Files:"m4/ltoptions.m4
 m4/ltsugar.m4
 m4/lt~obsolete.m4" Copyright: '2004, 2005, 2007-2009, 2011-2015, Free 
Software' -> '2004, 2005, 2007-2009, 2011-2015, Free Software Foundation, [...]'

$ git diff
diff --git a/debian/copyright b/debian/copyright
index 17dcb21..9660ba5 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -78,7 +78,7 @@ Copyright: 1985, 1986, 1988, 1990-2018, Free Software 
Foundation, Inc.
 License: GPL-3+
 
 Files: guile/modules/gnutls.in
-Copyright: 2007-2012, 2014-2016, 2019, 2021, 2022, Free Software
+Copyright: 2007-2012, 2014-2016, 2019, 2021, 2022, Free Software Foundation, 
Inc.
 License: LGPL-2.1+
 
 Files: guile/modules/gnutls/build/*
@@ -108,7 +108,7 @@ License: LGPL-3+
 Files: m4/ltoptions.m4
   m4/ltsugar.m4
   m4/lt~obsolete.m4
-Copyright: 2004, 2005, 2007-2009, 2011-2015, Free Software
+Copyright: 2004, 2005, 2007-2009, 2011-2015, Free Software Foundation, Inc.
 License: FSFULLR
 

The following command also works fine if you want a more readable version:

$ cme modify dpkg-copyright '! Files:.foreach_match(.*) Copyright=~"s/, Free 
Software$/, Free Software Foundation, Inc./"'

.foreach_match(/.*/) also works.

You can use the instruction passed to cme modify command in 
debian/fix.scanned.copyright

HTH

[1] 
https://salsa.debian.org/gnutls-team/guile-gnutls/-/blob/main/debian/copyright
[2] 
https://metacpan.org/pod/Config::Model::Loader#xxx:.foreach_match(yy)-or-xxx:~yy

Reply via email to