summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2011-02-25 21:10:44 +0100
committerChristian Ruppert <idl0r@gentoo.org>2011-02-25 21:10:44 +0100
commit2f5229064ec75704c257053510df376689dd10b0 (patch)
tree86da19d36618c31574eaa5563fbfa373212ea5e5 /src
parentUse the @ebuilds array instead of @files for ebuild related changes (diff)
downloadgentoolkit-2f5229064ec75704c257053510df376689dd10b0.tar.gz
gentoolkit-2f5229064ec75704c257053510df376689dd10b0.tar.bz2
gentoolkit-2f5229064ec75704c257053510df376689dd10b0.zip
Use update_cat_pn() and update_copyright() only once for the ChangeLog, right after loading it
Diffstat (limited to 'src')
-rwxr-xr-xsrc/echangelog/echangelog22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog
index 06fc33e..fe21729 100755
--- a/src/echangelog/echangelog
+++ b/src/echangelog/echangelog
@@ -282,13 +282,21 @@ if (-f 'ChangeLog') {
close(I);
$text =~ s/^\*.*//ms; # don't need the fake entry
-
- $text = update_cat_pn($text);
} else {
die "This should be run in a directory with ebuilds...\n";
}
}
+# Update the copyright year in the ChangeLog
+$text = update_copyright($text);
+
+# 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 (<*.ebuild>) {
+ $text = update_cat_pn($text);
+}
+
# Figure out what has changed around here
open C, $vcs{$vcs}{status}.' 2>&1 |' or die "Can't run ".$vcs{$vcs}{status}.": $!\n";
while (<C>) {
@@ -737,16 +745,6 @@ if (@new_versions) {
or die "Failed to insert new entry (3)\n";
}
-# 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);
-}
-
-# Update the copyright year in the ChangeLog
-$text = update_copyright($text);
-
# Write the new ChangeLog
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";