From: vapier Date: Sun, 15 Feb 2009 20:19:58 +0000 (-0000) Subject: always update the first line that includes the category/package as it isnt uncommon... X-Git-Tag: gentoolkit-0.2.4.3^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8492fbc1374d8596101c580903a1dc4210179143;p=gentoolkit.git always update the first line that includes the category/package as it isnt uncommon for this to fall out of date (as with package moves) svn path=/; revision=543 --- diff --git a/trunk/src/echangelog/echangelog b/trunk/src/echangelog/echangelog index f1c5188..830b662 100755 --- a/trunk/src/echangelog/echangelog +++ b/trunk/src/echangelog/echangelog @@ -74,13 +74,7 @@ if (-f 'ChangeLog') { or die "Can't open $new/skel.ChangeLog for input: $!\n"; { local $/ = undef; $text = ; } close I; - my ($cwd) = getcwd(); - $cwd =~ m|.*/(\w+-\w+\|virtual)/([^/]+)| - or die "Can't figure out category/package.. sorry!\n"; - my ($category, $package_name) = ($1, $2); $text =~ s/^\*.*//ms; # don't need the fake entry - $text =~ s//$category/; - $text =~ s//$package_name/; } else { die "This should be run in a directory with ebuilds...\n"; } @@ -450,6 +444,23 @@ if (@new_versions) { or die "Failed to insert new entry (3)\n"; } +sub update_cat_pn { + my ($t) = @_; + my ($cwd) = getcwd(); + $cwd =~ m|.*/(\w+-\w+\|virtual)/([^/]+)| + or die "Can't figure out category/package.. sorry!\n"; + my ($category, $package_name) = ($1, $2); + $t =~ s/^(# ChangeLog for).*/$1 $category\/$package_name/; + return $t; +} + +# New packages and/or ones that have moved around often have stale data here. +# But only do that in places where ebuilds are around (as echangelog can be +# used in profiles/ and such places). +if (grep(/\.ebuild$/, @files)) { + $text = update_cat_pn($text); +} + sub update_copyright { my ($t) = @_; (my $year = $date) =~ s/.* //;