summaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
authoragriffis <agriffis@gentoo.org>2005-04-27 23:30:41 +0000
committeragriffis <agriffis@gentoo.org>2005-04-27 23:30:41 +0000
commit05dc14f1d04b12d38a83ff21dc0f5f54b9864e57 (patch)
tree349e930ab82b67d2d7bcc7f3a43d900d12b2d219 /trunk/src
parent98deced6e470cf42b65558d75163c3150d8e8043 (diff)
downloadgentoolkit-05dc14f1d04b12d38a83ff21dc0f5f54b9864e57.tar.gz
* more changes for #90326; report all trivial files if no significant
changes can be found svn path=/; revision=211
Diffstat (limited to 'trunk/src')
-rw-r--r--trunk/src/echangelog/ChangeLog4
-rw-r--r--trunk/src/echangelog/echangelog55
2 files changed, 38 insertions, 21 deletions
diff --git a/trunk/src/echangelog/ChangeLog b/trunk/src/echangelog/ChangeLog
index d5215eb..ffafb66 100644
--- a/trunk/src/echangelog/ChangeLog
+++ b/trunk/src/echangelog/ChangeLog
@@ -1,3 +1,7 @@
+27 Apr 2005 Aron Griffis <agriffis@gentoo.org>
+ * more changes for #90326; report all trivial files if no significant
+ changes can be found
+
26 Apr 2005 Aron Griffis <agriffis@gentoo.org>
* detect conflicts explicitly
* report ChangeLog in the list of files if it's the only file that is
diff --git a/trunk/src/echangelog/echangelog b/trunk/src/echangelog/echangelog
index f8c795a..a06115c 100644
--- a/trunk/src/echangelog/echangelog
+++ b/trunk/src/echangelog/echangelog
@@ -19,13 +19,8 @@ $Text::Wrap::columns = 77;
$Text::Wrap::unexpand = 0;
# Global variables
-my (@files) = ();
-my (@ebuilds) = ();
-my (@conflicts) = ();
-my (@unknown) = ();
+my (@files, @ebuilds, @conflicts, @trivial, @unknown, @new_versions, %actions);
my ($input, $editor, $entry, $user, $date, $text, $version, $year);
-my (@new_versions) = ();
-my (%actions) = ();
# Read the current ChangeLog
if (-f 'ChangeLog') {
@@ -54,13 +49,28 @@ if (-f 'ChangeLog') {
# Figure out what has changed around here
open C, 'cvs -fn up 2>&1 |' or die "Can't run cvs -fn up: $!\n";
while (<C>) {
- /ChangeLog/ and next;
- /^\? (\S+)/ and do { push @unknown, $1; next; };
- /^C (\S+)/ and do { push @conflicts, $1; next; };
- /^([ARM]) (\S+)/ or next;
- push @files, $2;
- ($actions{$2} = $1) =~ tr/ARM/+-/d;
+ if (/^C (\S+)/) {
+ push @conflicts, $1;
+ next;
+ } elsif (/^\? (\S+)/) {
+ push @unknown, $1;
+ $actions{$1} = '+';
+ next;
+ } elsif (/^([ARM]) (\S+)/) {
+ push @files, $2;
+ ($actions{$2} = $1) =~ tr/ARM/+-/d;
+ }
}
+
+# Separate out the trivial files for now
+@files = grep {
+ !/files.digest|Manifest|ChangeLog/ or do { push @trivial, $_; 0; }
+} @files;
+@unknown = grep {
+ !/files.digest|Manifest|ChangeLog/ or do { push @trivial, $_; 0; }
+} @unknown;
+
+# Don't allow any conflicts
if (@conflicts) {
print STDERR <<EOT;
Cvs reports the following conflicts. Please resolve them before
@@ -69,7 +79,9 @@ EOT
print STDERR map "C $_\n", @conflicts;
exit 1;
}
-@unknown = grep !/files.digest|Manifest/, @unknown;
+
+# Don't allow unknown files (other than the trivial files that were separated
+# out above)
if (@unknown) {
print STDERR <<EOT;
Cvs reports the following unknown files. Please use "cvs add" before
@@ -216,11 +228,12 @@ close C;
# Allow ChangeLog entries with no changed files, but give a fat warning
unless (@files) {
print STDERR "**\n";
- print STDERR "** NOTE: No changed files found. Normally echangelog should\n";
- print STDERR "** be run after all affected files have been added and/or\n";
+ print STDERR "** NOTE: No non-trivial changed files found. Normally echangelog\n";
+ print STDERR "** should be run after all affected files have been added and/or\n";
print STDERR "** modified. Did you forget to cvs add?\n";
print STDERR "**\n";
- @files = qw/ChangeLog/; # per request from Donnie Berkholz
+ @files = sort sortfunc @trivial;
+ @files = qw/ChangeLog/ unless @files; # last resort to put something in the list
}
# Get the input from the cmdline, editor or stdin
@@ -231,7 +244,7 @@ if ($ARGV[0]) {
$editor = defined($ENV{'ECHANGELOG_EDITOR'}) ? $ENV{'ECHANGELOG_EDITOR'} :
$ENV{'EDITOR'} || undef;
if ($editor) {
- system("$editor .#ChangeLog");
+ system("$editor ChangeLog.new");
if ($? != 0) {
# This usually happens when the editor got forcefully killed; and
# the terminal is probably messed up: so we reset things.
@@ -239,16 +252,16 @@ if ($ARGV[0]) {
print STDERR "Editor died! Reverting to stdin method.\n";
undef $editor;
} else {
- if (open I, "<.#ChangeLog") {
+ if (open I, "<ChangeLog.new") {
local $/ = undef;
$input = <I>;
close I;
} else {
- print STDERR "Error opening .#ChangeLog: $!\n";
+ print STDERR "Error opening ChangeLog.new: $!\n";
print STDERR "Reverting to stdin method.\n";
undef $editor;
}
- unlink '.#ChangeLog';
+ unlink 'ChangeLog.new';
}
}
unless ($editor) {
@@ -275,7 +288,7 @@ unless ($user = $ENV{'ECHANGELOG_USER'}) {
die "Please set ECHANGELOG_USER or run as non-root\n" if $user =~ /<root@/;
$date = strftime("%d %b %Y", gmtime);
$entry = "$date; $user ";
-$entry .= join ', ', map "$actions{$_}$_", grep !/files.digest|Manifest/, @files;
+$entry .= join ', ', map "$actions{$_}$_", @files;
$entry .= ':';
$entry = Text::Wrap::fill(' ', ' ', $entry); # does not append a \n
$entry .= "\n$input"; # append user input