diff -Nru libconfig-model-dpkg-perl-2.156/debian/changelog libconfig-model-dpkg-perl-2.157/debian/changelog --- libconfig-model-dpkg-perl-2.156/debian/changelog 2022-01-21 17:19:59.000000000 +0000 +++ libconfig-model-dpkg-perl-2.157/debian/changelog 2022-02-06 14:52:08.000000000 +0000 @@ -1,3 +1,13 @@ +libconfig-model-dpkg-perl (2.157) unstable; urgency=medium + + * fix update-my-copyright-year script: do not duplicate current year. + Thanks to gregoa for the bug report (Closes: #1004206) + * fix update-my-copyright-year: avoid spurious change notification + * copyright: update my copyright year with cme in dogfooding mode + * control: update cme build dep version + + -- Dominique Dumont Sun, 06 Feb 2022 15:52:08 +0100 + libconfig-model-dpkg-perl (2.156) unstable; urgency=medium * fix "cme run update-my-copyright-year" script diff -Nru libconfig-model-dpkg-perl-2.156/debian/control libconfig-model-dpkg-perl-2.157/debian/control --- libconfig-model-dpkg-perl-2.156/debian/control 2022-01-21 17:19:59.000000000 +0000 +++ libconfig-model-dpkg-perl-2.157/debian/control 2022-02-06 14:52:08.000000000 +0000 @@ -6,7 +6,7 @@ Priority: optional Build-Depends: debhelper-compat (= 13), libmodule-build-perl -Build-Depends-Indep: cme , +Build-Depends-Indep: cme (>= 1.037) , dh-sequence-bash-completion, libapp-cmd-perl , libparse-debcontrol-perl, diff -Nru libconfig-model-dpkg-perl-2.156/debian/copyright libconfig-model-dpkg-perl-2.157/debian/copyright --- libconfig-model-dpkg-perl-2.156/debian/copyright 2022-01-21 17:19:59.000000000 +0000 +++ libconfig-model-dpkg-perl-2.157/debian/copyright 2022-02-06 14:52:08.000000000 +0000 @@ -5,11 +5,11 @@ parts of Config::Model Files: * -Copyright: 2005-2019, Dominique Dumont +Copyright: 2005-2022, Dominique Dumont License: LGPL-2.1+ Files: lib/Dpkg/Copyright/Scanner.pm -Copyright: 2014-2019, Dominique Dumont +Copyright: 2014-2022, Dominique Dumont 2005-2012, Jonas Smedegaard License: LGPL-2.1+ Comment: Jonas has allowed me to relicense some GPL code copied from licensecheck2deb. diff -Nru libconfig-model-dpkg-perl-2.156/lib/Config/Model/scripts/update-my-copyright-year libconfig-model-dpkg-perl-2.157/lib/Config/Model/scripts/update-my-copyright-year --- libconfig-model-dpkg-perl-2.156/lib/Config/Model/scripts/update-my-copyright-year 2022-01-21 17:19:59.000000000 +0000 +++ libconfig-model-dpkg-perl-2.157/lib/Config/Model/scripts/update-my-copyright-year 2022-02-06 14:52:08.000000000 +0000 @@ -1,18 +1,29 @@ doc: update the copyright years that match $DEBFULLNAME app: dpkg-copyright ---- var -my @l = localtime; $var{year} = $l[5]+1900; -$var{oldyear} = $var{year} - 1; ---- -# $year can be overridden by command arguments ---- load -# add the new year -Files:~ Copyright=~"s/(\d+),?\s+$DEBFULLNAME/$1, $year, $DEBFULLNAME/g" -# create ranges with new year when needed -Files:~ Copyright=~"s/-$oldyear,\s*$year,?\s+$DEBFULLNAME/-$year, $DEBFULLNAME/g" -Files:~ Copyright=~"s/$oldyear,\s*$year,?\s+$DEBFULLNAME/$oldyear-$year, $DEBFULLNAME/g" +--- code +my @l = localtime; +my $year = $l[5]+1900; +my $oldyear = $year - 1; +my $name = $ENV{DEBFULLNAME}; + +# $root is provided by App::Cme::Command::run +foreach my $file_node ($root->fetch_element('Files')->fetch_all) { + my $cop = $file_node->fetch_element_value('Copyright'); + + # append current year + $cop =~ s/(\d+),?\s+$name/$1, $year, $name/g; + + # suppress duplicate current year (for idempotency) + $cop =~ s/$year, $year/$year/g; + + # create ranges with new year when needed + $cop =~ s/-$oldyear,\s*$year,?\s+$name/-$year, $name/g; + $cop =~ s/$oldyear,\s*$year,?\s+$name/$oldyear-$year, $name/g; + + $file_node->store_element_value(Copyright => $cop); +} --- commit: updated copyright year of $DEBFULLNAME diff -Nru libconfig-model-dpkg-perl-2.156/t/cme-scripts.t libconfig-model-dpkg-perl-2.157/t/cme-scripts.t --- libconfig-model-dpkg-perl-2.156/t/cme-scripts.t 2022-01-21 17:19:59.000000000 +0000 +++ libconfig-model-dpkg-perl-2.157/t/cme-scripts.t 2022-02-06 14:52:08.000000000 +0000 @@ -100,6 +100,7 @@ my $current_year = $l[5]+1900 ; my $old_year = $current_year - 1; $cop_lines =~ s/OLDYEAR/$old_year/eg; + $cop_lines =~ s/CURRENT_YEAR/$current_year/eg; # put copyright data in place $debian_dir->child("copyright")->spew_utf8($cop_lines); @@ -118,6 +119,9 @@ my $new_cop = <<"EOF"; Copyright: 2015-$current_year, Dominique Dumont 2015, $current_year, Dominique Dumont + $current_year, Dominique Dumont + 2014-$current_year, Dominique Dumont + 2015,$current_year, Dominique Dumont $old_year-$current_year, Dominique Dumont 2010, 2015, $current_year, Dominique Dumont 2015-2017, $old_year-$current_year, Dominique Dumont diff -Nru libconfig-model-dpkg-perl-2.156/t/examples/config-model-systemd/copyright libconfig-model-dpkg-perl-2.157/t/examples/config-model-systemd/copyright --- libconfig-model-dpkg-perl-2.156/t/examples/config-model-systemd/copyright 2022-01-21 17:19:59.000000000 +0000 +++ libconfig-model-dpkg-perl-2.157/t/examples/config-model-systemd/copyright 2022-02-06 14:52:08.000000000 +0000 @@ -6,6 +6,9 @@ Files: * Copyright: 2015-OLDYEAR, Dominique Dumont 2015, Dominique Dumont + CURRENT_YEAR, Dominique Dumont + 2014-CURRENT_YEAR, Dominique Dumont + 2015,CURRENT_YEAR, Dominique Dumont OLDYEAR, Dominique Dumont 2010, 2015, Dominique Dumont 2015-2017, OLDYEAR, Dominique Dumont