$input =~ s/^/ /gm; # add indentation
# Prepend the user info to the input
-$user = $ENV{'ECHANGELOG_USER'} ||
- sprintf("%s <%s\@gentoo.org>", (getpwuid($<))[6,0]);
+unless ($user = $ENV{'ECHANGELOG_USER'}) {
+ my ($fullname, $username) = (getpwuid($<))[6,0];
+ $fullname =~ s/,.*//; # remove GECOS, bug 80011
+ $user = sprintf "%s <%s\@gentoo.org>", $fullname, $username;
+}
# Make sure that we didn't get "root"
die "Please set ECHANGELOG_USER or run as non-root\n" if $user =~ /<root@/;
$date = strftime("%d %b %Y", localtime);
# front of a dated entry), so it needs to be replaced with a
# double carriage-return. This helps to normalize the spacing in
# the ChangeLogs.
-#
-# NOTE: The first two branches here are disabled via '&& 0'
-# because they use the new but unsanctioned ChangeLog format.
-if (0 && !defined $version) { # <--- NOTE disabled via '0'
- # Changing a patch or something, not an ebuild, so put the entry
- # after the first *version line (really guessing)
- $text =~ s/^( \*.*? ) # find the *version line
- \s*\n(?=\ \ \d|\*|\z) # suck up trailing whitespace
- /$1\n\n$entry\n\n/mx
- or die "Failed to insert new entry (1)\n";
-} elsif (0 && $versions{$version} > -1) { # <--- NOTE disabled via '0'
- # Insert after the *version line
- $text =~ s/^( \*\Q$version\E ) # find the *version line = $1
- (?:\.|\.ebuild)? # some poorly formed entries
- \s+ ( \(.*\) ) # (date) = $2
- \s*\n(?=\ \ \d|\*|\z) # suck up trailing whitespace
- /$1 $2\n\n$entry\n\n/mx
- or die "Failed to insert new entry (2)\n";
-} elsif (!defined $version || $versions{$version} > -1) {
+if (!defined $version || $versions{$version} > -1) {
# Changing an existing patch or ebuild, no new version marker
# required
$text =~ s/^( .*? ) # grab header
print O $text or die "Can't write ChangeLog.new: $!\n";
close O or die "Can't close ChangeLog.new: $!\n";
-# Update affected ebuild copyright dates
-#for my $e (grep /\.ebuild$/, @files) {
-# Update all ebuild copyright dates -- according to Mr_Bones_ this is
-# the right thing to do
-opendir D, '.' or die "Can't opendir .: $!\n";
-for my $e (grep /\.ebuild$/, readdir D) {
+# Update affected ebuild copyright dates. There is no reason to update the
+# copyright lines on ebuilds that haven't changed. I verified this with an IP
+# lawyer.
+for my $e (grep /\.ebuild$/, @files) {
my ($etext, $netext);
open E, "<$e" or warn("Can't read $e to update copyright year\n"), next;
{ local $/ = undef; $etext = <E>; }
system "diff -U 0 $e $e.new";
rename "$e.new", $e or warn("Can't rename $e.new: $!\n");
}
-close D;
# Move things around and show the ChangeLog diff
system 'diff -Nu ChangeLog ChangeLog.new';