1 |
commit: 2f5229064ec75704c257053510df376689dd10b0 |
2 |
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 25 20:10:44 2011 +0000 |
4 |
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 25 20:10:44 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=2f522906 |
7 |
|
8 |
Use update_cat_pn() and update_copyright() only once for the ChangeLog, right after loading it |
9 |
|
10 |
--- |
11 |
src/echangelog/echangelog | 22 ++++++++++------------ |
12 |
1 files changed, 10 insertions(+), 12 deletions(-) |
13 |
|
14 |
diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog |
15 |
index 06fc33e..fe21729 100755 |
16 |
--- a/src/echangelog/echangelog |
17 |
+++ b/src/echangelog/echangelog |
18 |
@@ -282,13 +282,21 @@ if (-f 'ChangeLog') { |
19 |
close(I); |
20 |
|
21 |
$text =~ s/^\*.*//ms; # don't need the fake entry |
22 |
- |
23 |
- $text = update_cat_pn($text); |
24 |
} else { |
25 |
die "This should be run in a directory with ebuilds...\n"; |
26 |
} |
27 |
} |
28 |
|
29 |
+# Update the copyright year in the ChangeLog |
30 |
+$text = update_copyright($text); |
31 |
+ |
32 |
+# New packages and/or ones that have moved around often have stale data here. |
33 |
+# But only do that in places where ebuilds are around (as echangelog can be |
34 |
+# used in profiles/ and such places). |
35 |
+if (<*.ebuild>) { |
36 |
+ $text = update_cat_pn($text); |
37 |
+} |
38 |
+ |
39 |
# Figure out what has changed around here |
40 |
open C, $vcs{$vcs}{status}.' 2>&1 |' or die "Can't run ".$vcs{$vcs}{status}.": $!\n"; |
41 |
while (<C>) { |
42 |
@@ -737,16 +745,6 @@ if (@new_versions) { |
43 |
or die "Failed to insert new entry (3)\n"; |
44 |
} |
45 |
|
46 |
-# New packages and/or ones that have moved around often have stale data here. |
47 |
-# But only do that in places where ebuilds are around (as echangelog can be |
48 |
-# used in profiles/ and such places). |
49 |
-if (grep(/\.ebuild$/, @files)) { |
50 |
- $text = update_cat_pn($text); |
51 |
-} |
52 |
- |
53 |
-# Update the copyright year in the ChangeLog |
54 |
-$text = update_copyright($text); |
55 |
- |
56 |
# Write the new ChangeLog |
57 |
open O, '>ChangeLog.new' or die "Can't open ChangeLog.new for output: $!\n"; |
58 |
print O $text or die "Can't write ChangeLog.new: $!\n"; |