From 940f759859b4920c991d7084f1519cb1f94fb3f1 Mon Sep 17 00:00:00 2001 From: idl0r Date: Mon, 17 May 2010 10:33:09 +0000 Subject: [PATCH] echangelog: Update copyright in other files too (except binaries and diff/patches), bug 285520. svn path=/trunk/gentoolkit-dev/; revision=783 --- ChangeLog | 4 ++++ src/echangelog/echangelog | 31 ++++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39965ec..1abf820 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-05-17: Christian Ruppert + * echangelog: Update copyright in other files too (except binaries and + diff/patches), bug 285520. + 2010-04-18: Christian Ruppert src/echangelog/echangelog: Fix bazaar MOVED/MODIFIED, thanks to Serkan Kaba , bug 315931. diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog index a43acd4..b08b2ea 100755 --- a/src/echangelog/echangelog +++ b/src/echangelog/echangelog @@ -208,6 +208,16 @@ sub mypush(\@@) { } } +sub update_copyright { + my ($t) = @_; + (my $year = $date) =~ s/.* //; + + $t =~ s/^# Copyright \d+(?= )/$&-$year/m or + $t =~ s/^(# Copyright) \d+-(\d+)/$1 1999-$year/m; + + return $t; +} + GetOptions( 'help' => \$opt_help, 'no-strict' => \$opt_nostrict, @@ -733,16 +743,6 @@ if (grep(/\.ebuild$/, @files)) { $text = update_cat_pn($text); } -sub update_copyright { - my ($t) = @_; - (my $year = $date) =~ s/.* //; - - $t =~ s/^# Copyright \d+(?= )/$&-$year/m or - $t =~ s/^(# Copyright) \d+-(\d+)/$1 1999-$year/m; - - return $t; -} - # Update the copyright year in the ChangeLog $text = update_copyright($text); @@ -751,11 +751,12 @@ open O, '>ChangeLog.new' or die "Can't open ChangeLog.new for output: $!\n"; print O $text or die "Can't write ChangeLog.new: $!\n"; close O or die "Can't close ChangeLog.new: $!\n"; -# Update affected ebuild copyright dates. There is no reason to update the -# copyright lines on ebuilds that haven't changed. I verified this with an IP -# lawyer. -for my $e (grep /\.ebuild$/, @files) { - if (-s $e) { + +# Update affected ebuilds and some other files copyright dates. There is no reason to update the +# copyright lines on ebuilds that haven't changed. I verified this with an IP +# lawyer. (patches/diffs and binary files are excluded) +for my $e (grep(!/\.(patch|diff)$/, @files)) { + if (-s $e && ! -B $e) { my ($etext, $netext); open E, "<$e" or warn("Can't read $e to update copyright year\n"), next; -- 2.26.2