summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvapier <vapier@gentoo.org>2009-02-15 20:19:58 +0000
committervapier <vapier@gentoo.org>2009-02-15 20:19:58 +0000
commit8492fbc1374d8596101c580903a1dc4210179143 (patch)
tree192d5b1a8f3d721a8696cad55e0bf892d98d3e52
parentfix copyright to start at 1999 as that is what all the skels start with (diff)
downloadgentoolkit-8492fbc1374d8596101c580903a1dc4210179143.tar.gz
gentoolkit-8492fbc1374d8596101c580903a1dc4210179143.tar.bz2
gentoolkit-8492fbc1374d8596101c580903a1dc4210179143.zip
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
-rwxr-xr-xtrunk/src/echangelog/echangelog23
1 files changed, 17 insertions, 6 deletions
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 = <I>; }
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>/$category/;
- $text =~ s/<PACKAGE_NAME>/$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/.* //;