diff options
Diffstat (limited to 'src/echangelog')
-rw-r--r-- | src/echangelog/AUTHORS | 1 | ||||
-rw-r--r-- | src/echangelog/ChangeLog | 84 | ||||
-rw-r--r-- | src/echangelog/Makefile | 23 | ||||
-rw-r--r-- | src/echangelog/README | 11 | ||||
-rw-r--r-- | src/echangelog/TODO | 0 | ||||
-rw-r--r-- | src/echangelog/echangelog | 493 | ||||
-rw-r--r-- | src/echangelog/echangelog.1 | 275 | ||||
-rw-r--r-- | src/echangelog/echangelog.pod | 136 |
8 files changed, 1023 insertions, 0 deletions
diff --git a/src/echangelog/AUTHORS b/src/echangelog/AUTHORS new file mode 100644 index 0000000..36d5bfd --- /dev/null +++ b/src/echangelog/AUTHORS @@ -0,0 +1 @@ +Aron Griffis <agriffis@gentoo.org> diff --git a/src/echangelog/ChangeLog b/src/echangelog/ChangeLog new file mode 100644 index 0000000..c1c5885 --- /dev/null +++ b/src/echangelog/ChangeLog @@ -0,0 +1,84 @@ +26 Mar 2006 Aron Griffis <agriffis@gentoo.org> + * echangelog: Don't warn about missing ebuilds when updating + copyrights #120061 + +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 + changing #90326 + +23 Mar 2005 Aron Griffis <agriffis@gentoo.org> + * handle package moves without adding new version lines + +08 Mar 2005 Aron Griffis <agriffis@gentoo.org> + * don't complain about cvs add of digests #84377 + * use gmtime instead of localtime + +07 Mar 2005 Aron Griffis <agriffis@gentoo.org> + * report all changed versions #84332 + +25 Feb 2005 Aron Griffis <agriffis@gentoo.org> + * strip GECOS #80011 + +09 Nov 2004 Aron Griffis <agriffis@gentoo.org> + * change "cvs diff -fU 0" => "cvs -f diff U0" because -f is a + global option, not a diff option + +08 Nov 2004 Aron Griffis <agriffis@gentoo.org> + * call cvs with -f to refrain from using .cvsrc, which might + contain conflicting options + * fix auto-addition of ChangeLog; last attempt was broken + +03 Nov 2004 Aron Griffis <agriffis@gentoo.org> + * abort when there are unresolved files (files that aren't under + revision control) just like repoman + * auto-add to cvs when a new ChangeLog is created + +15 Sep 2004 Aron Griffis <agriffis@gentoo.org> + * fix the wrapping to fit in 80 columns properly. It was + previously possible to get lines with 81 chars. Thanks to + ciaranm for reporting. + +29 Mar 2004 Aron Griffis <agriffis@gentoo.org> + * fix bug 46111 by testing for /<root@/ instead of / root@/ + +28 Mar 2004 Aron Griffis <agriffis@gentoo.org> + * apply patch from plasmaroo, with minor modifications, to enable EDITOR + and +- support + +27 Mar 2004 Michael Sterrett <mr_bones_@gentoo.org> + * don't fall out of the loop if update_copyright() didn't change + anything. Just go on to the next file. + +21 Mar 2004 Aron Griffis <agriffis@gentoo.org> + * Fix typo $0 -> 0 + +19 Mar 2004 Aron Griffis <agriffis@gentoo.org> + * Remove debugging output + * Fix $v bug introduced in last commit + +16 Mar 2004 Aron Griffis <agriffis@gentoo.org> + * Make Feb 17 behavior work without Feb 20 bug :-) + * Release as version 0.2.0 + +20 Feb 2004 Aron Griffis <agriffis@gentoo.org> + * Only update copyrights on modified ebuilds, otherwise if you run + echangelog again, it reports that all the ebuilds have been updated! + The copyright year issue would be better solved on Jan 1 of each year by + a separate script. + +17 Feb 2004 Aron Griffis <agriffis@gentoo.org> + * Update copyrights on all ebuilds, not just the modified ones + +07 Jan 2004 Aron Griffis <agriffis@gentoo.org> + * Updated Makefile to understand building man-page from pod + * Removed static man-page in favor of generated man-page from pod + * Added copyright year updating + * Allow echangelog to run even when no files have changed + +2004-01-07 Karl Trygve Kalleberg <karltk@gentoo.org> + * Added Makefile diff --git a/src/echangelog/Makefile b/src/echangelog/Makefile new file mode 100644 index 0000000..61c5e57 --- /dev/null +++ b/src/echangelog/Makefile @@ -0,0 +1,23 @@ +# Copyright 2004 Karl Trygve Kalleberg <karltk@gentoo.org> +# Copyright 2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# +# $Header$ + +include ../../makedefs.mak + +%.1 : %.pod + pod2man $< > $@ + +.PHONY: all +all: echangelog.1 + +dist: echangelog.1 + mkdir -p ../../$(distdir)/src/echangelog/ + cp Makefile AUTHORS README TODO ChangeLog echangelog echangelog.pod echangelog.1 ../../$(distdir)/src/echangelog/ + +install: all + install -m 0755 echangelog $(bindir)/ + install -d $(docdir)/echangelog + install -m 0644 AUTHORS README $(docdir)/echangelog/ + install -m 0644 echangelog.1 $(mandir)/ diff --git a/src/echangelog/README b/src/echangelog/README new file mode 100644 index 0000000..77a7930 --- /dev/null +++ b/src/echangelog/README @@ -0,0 +1,11 @@ +Most of the documentation is contained in the man-page, which you can +read directly (using GNU man) by doing + + man ./echangelog.1 + +To rebuild the man-page from pod source, do + + pod2man --name=echangelog --center='Gentoolkit' \ + echangelog.pod echangelog.1 + +03 Nov 2004 agriffis diff --git a/src/echangelog/TODO b/src/echangelog/TODO new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/echangelog/TODO diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog new file mode 100644 index 0000000..1a4bee7 --- /dev/null +++ b/src/echangelog/echangelog @@ -0,0 +1,493 @@ +#!/usr/bin/perl -w +# +# echangelog: Update the ChangeLog for an ebuild. For example: +# +# $ echangelog 'Add ~alpha to KEYWORDS' +# 4a5,7 +# > 10 Feb 2003; Aron Griffis <agriffis@gentoo.org> oaf-0.6.8-r1.ebuild : +# > Add ~alpha to KEYWORDS +# > + +use strict; +use POSIX qw(strftime getcwd setlocale); +use File::Find; + +# Fix bug 21022 by restricting to C locale +setlocale(&POSIX::LC_ALL, "C"); + +use Text::Wrap; +$Text::Wrap::columns = 77; +$Text::Wrap::unexpand = 0; + +# Global variables +my (@files, @ebuilds, @conflicts, @trivial, @unknown, @new_versions, %actions); +my ($input, $editor, $entry, $user, $date, $text, $version, $year, $vcs); + +my %vcs = ( cvs => { diff => "cvs -f diff -U0", + status => "cvs -fn up", + add => "cvs -f add", + skip => 6, + regex => qr/^Index: ()(([^\/]*?)\.ebuild)\s*$/ }, + svn => { diff => "svn diff -N", + status => "svn status", + add => "svn add", + skip => 6, + regex => qr/^Index: ()(([^\/]*?)\.ebuild)\s*$/ }, + git => { diff => "git diff", + status => "git diff-index HEAD --name-status", + add => "git add", + skip => 4, + regex => qr/^diff \-\-git \S*\/((\S*)\.ebuild)/ } + +); + +# Figure out what kind of repo we are in. + +if ( -d "CVS" ) { + $vcs = "cvs"; +} elsif ( -d '.svn' ) { + $vcs = "svn"; +} elsif ( -f '/usr/bin/git' and open GIT, "git rev-parse --git-dir |" ) { + $vcs = "git"; + close GIT; +} else { + die "No CVS, .git, .svn directories found, what kind of repo is this?"; +} + +# Read the current ChangeLog +if (-f 'ChangeLog') { + open I, '<ChangeLog' or die "Can't open ChangeLog for input: $!\n"; + { local $/ = undef; $text = <I>; } + close I; +} else { + # No ChangeLog here, maybe we should make one... + if (<*.ebuild>) { + open C, "portageq envvar PORTDIR |" or die "Can't find PORTDIR"; + my ($new) = <C>; + close C; + $new =~ s/\s+$//; + open I, "< $new/skel.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+)/([^/]+)| + 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"; + } +} + +# 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>) { + if (/^C\s+(\S+)/) { + if($vcs eq "git") { + my $filename = $2; + $filename =~ /\S*\/(\S*)/; + if( -d $1 ) { + next; + } + push @conflicts, $1; + next; + } + push @conflicts, $1; + next; + } elsif (/^\?\s+(\S+)/) { + if($vcs eq "git") { + my $filename = $2; + $filename =~ /\S*\/(\S*)/; + if( -d $1 ) { + next; + } + push @unknown, $1; + next; + } else { + push @unknown, $1; + } + $actions{$1} = '+'; + next; + } elsif (/^([ARMD])\s+(\S+)/) { + my ($status, $filename) = ($1,$2); + if($vcs eq "git") { + open P, "git-rev-parse --sq --show-prefix |"; + my $prefix = <P>; + $prefix = substr($prefix, 0, -1); + close P; + + if ($filename =~ /$prefix(\S*)/) { + $filename = $1 ; + } + else { + next; + } + } + if( -d $filename ) { + next; + } + push @files, $filename; + ($actions{$filename} = $status) =~ tr/DARM/-+-/d; + } +} + +# git only shows files already added so we need to check for unknown files +# separately here. +if($vcs eq "git") { + find(\&git_unknown_objects, "./"); +} + +sub git_unknown_objects { + my $object = $_; + my ($dev,$ino,$mode,$nlink,$uid,$gid); + + # Ignore empty directories - git doesn't version them and cvs removes them. + if ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && ! -d _) { + open C, $vcs." status $_ 2>&1 1>/dev/null |"; + + while (<C>) { + $_ = <C>; + push @unknown, $object; + }; + close C; + }; +} + +# 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; +$vcs reports the following conflicts. Please resolve them before +running echangelog. +EOT + print STDERR map "C $_\n", @conflicts; + exit 1; +} + +# Don't allow unknown files (other than the trivial files that were separated +# out above) +if (@unknown) { + print STDERR <<EOT; +$vcs reports the following unknown files. Please use "$vcs add" before +running echangelog, or remove the files in question. +EOT + print STDERR map "? $_\n", @unknown; + exit 1; +} + +# Sort the list of files as portage does. None of the operations through +# the rest of the script should break this sort. +sub sortfunc($$) { + my ($a, $b) = @_; + (my $va = $a) =~ s/.*?-(\d.*?)(?:\.ebuild)?$/$1/; + (my $vb = $b) =~ s/.*?-(\d.*?)(?:\.ebuild)?$/$1/; + my ($na, $sa, $sna, $ra) = ($va =~ /^(.*?)(?:_(alpha|beta||pre|rc|p)(\d*))?(?:-r(\d+))?$/); + my ($nb, $sb, $snb, $rb) = ($vb =~ /^(.*?)(?:_(alpha|beta||pre|rc|p)(\d*))?(?:-r(\d+))?$/); + my (@na) = split /\.|(?<=\d)(?=[^\d\.])/, $na; + my (@nb) = split /\.|(?<=\d)(?=[^\d\.])/, $nb; + my $retval; + + # + # compare version numbers first + # + for (my $i = 0; defined $na[$i] or defined $nb[$i]; $i++) { + # def vs. undef + return +1 if defined $na[$i] and !defined $nb[$i]; + return -1 if defined $nb[$i] and !defined $na[$i]; + + # num vs. num + if ($na[$i] =~ /^\d/ and $nb[$i] =~ /^\d/) { + $retval = ($na[$i] <=> $nb[$i]); + return $retval if $retval; + next; + } + + # char vs. char + if ($na[$i] =~ /^\D/ and $nb[$i] =~ /^\D/) { + $retval = ($na[$i] cmp $nb[$i]); + return $retval if $retval; + next; + } + + # num vs. char + $retval = ($na[$i] =~ /\d/ and -1 or +1); + return $retval; + } + + # + # compare suffix second + # + if (defined $sa and !defined $sb) { + return +2 if $sa eq "p"; + return -2; + } + if (defined $sb and !defined $sa) { + return -3 if $sb eq "p"; + return +3; + } + + if (defined $sa) { # and defined $sb + $retval = ($sa cmp $sb); + if ($retval) { + return +4 if $sa eq "p"; + return -4 if $sb eq "p"; + return $retval; # suffixes happen to be alphabetical order, mostly + } + + # compare suffix number + return +5 if defined $sna and !defined $snb; + return -5 if defined $snb and !defined $sna; + if (defined $sna) { # and defined $snb + $retval = ($sna <=> $snb); + return $retval if $retval; + } + } + + # + # compare rev third + # + return +6 if defined $ra and !defined $rb; + return -6 if defined $rb and !defined $ra; + if (defined $ra) { # and defined $rb + return ($ra <=> $rb); + } + + # + # nothing left to compare + # + return 0; +} +@files = sort sortfunc @files; + +# Forget ebuilds that only have changed copyrights, unless that's all +# the changed files we have + +@ebuilds = grep /\.ebuild$/, @files; +@files = grep !/\.ebuild$/, @files; + +if (@ebuilds) { + if ($vcs eq "git") { + open C, $vcs{$vcs}{diff}." HEAD -- @ebuilds 2>&1 |" or die "Can't run: ".$vcs{$vcs}{diff}."$!\n"; + } else { + open C, $vcs{$vcs}{diff}." @ebuilds 2>&1 |" or die "Can't run: ".$vcs{$vcs}{diff}."$!\n"; + } + $_ = <C>; + while (defined $_) { + # only possible with cvs + if (/^$vcs diff: (([^\/]*?)\.ebuild) was removed/) { + push @files, $1; + } + + # We assume GNU diff output format here. + # git format: diff --git a/app-doc/repodoc/metadata.xml b/app-doc/repodoc/metadata.xml + elsif (/$vcs{$vcs}{regex}/) { + my $f; + if ($vcs eq "git") { + ($f) = ($1); + my $version = ($2); + while (<C>) { + last if /^deleted file mode|^index/; + if (/^new file mode/) { + push @new_versions, $version; # new ebuild, will create a new entry + last; + } + } + } else { + ($f) = ($2); + } + + # check if more than just copyright date changed. + # skip some lines (vcs dependent) + foreach(1..$vcs{$vcs}{skip}){ + $_ = <C>; + } + while (<C>) { + last if /^[A-Za-z]/; + if (/^[-+](?!# Copyright)/) { + push @files, $f; + last; + } + } + # at this point we've either added $f to @files or not, + # and we have the next line in $_ for processing + next; + } + elsif (/^$vcs.*?: (([^\/]*?)\.ebuild) is a new entry/) { + push @files, $1; + push @new_versions, $2; # new ebuild, will create a new entry + } + # other cvs output is ignored + $_ = <C>; + } +} +close C; + +# When a package move occurs, the versions appear to be new even though they are +# not. Trim them from @new_versions in that case. +@new_versions = grep { $text !~ /^\*\Q$_\E\s/m } @new_versions; + +# Check if we have any files left, otherwise re-insert ebuild list +# (of course, both might be empty anyway) +@files = @ebuilds unless (@files); + +# Allow ChangeLog entries with no changed files, but give a fat warning +unless (@files) { + print STDERR "**\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 $vcs add?\n"; + print STDERR "**\n"; + @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 +if ($ARGV[0]) { + $input = "@ARGV"; +} else { + # Testing for defined() allows ECHANGELOG_EDITOR='' to cancel EDITOR + $editor = defined($ENV{'ECHANGELOG_EDITOR'}) ? $ENV{'ECHANGELOG_EDITOR'} : + $ENV{'EDITOR'} || undef; + if ($editor) { + 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. + system('/usr/bin/stty sane'); + print STDERR "Editor died! Reverting to stdin method.\n"; + undef $editor; + } else { + if (open I, "<ChangeLog.new") { + local $/ = undef; + $input = <I>; + close I; + } else { + print STDERR "Error opening ChangeLog.new: $!\n"; + print STDERR "Reverting to stdin method.\n"; + undef $editor; + } + unlink 'ChangeLog.new'; + } + } + unless ($editor) { + print "Please type the log entry: use Ctrl-d to finish, Ctrl-c to abort...\n"; + local $/ = undef; + $input = <>; + } +} +die "Empty entry; aborting\n" unless $input =~ /\S/; + +# If there are any long lines, then wrap the input at $columns chars +# (leaving 2 chars on left, one char on right, after adding indentation below). +$input =~ s/^\s*(.*?)\s*\z/$1/s; # trim whitespace +$input = Text::Wrap::fill(' ', ' ', $input); + +# Prepend the user info to the input +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", gmtime); +$entry = "$date; $user "; +$entry .= join ', ', map "$actions{$_}$_", @files; +$entry .= ':'; +$entry = Text::Wrap::fill(' ', ' ', $entry); # does not append a \n +$entry .= "\n$input"; # append user input + +# Each one of these regular expressions will eat the whitespace +# leading up to the next entry (except the two-space leader on the +# 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. +if (@new_versions) { + # Insert at the top with a new version marker + $text =~ s/^( .*? ) # grab header + \s*\n(?=\ \ \d|\*|\z) # suck up trailing whitespace + /"$1\n\n" . + join("\n", map "*$_ ($date)", reverse @new_versions) . + "\n\n$entry\n\n"/sxe + or die "Failed to insert new entry (4)\n"; +} else { + # Changing an existing patch or ebuild, no new version marker + # required + $text =~ s/^( .*? ) # grab header + \s*\n(?=\ \ \d|\*|\z) # suck up trailing whitespace + /$1\n\n$entry\n\n/sx + or die "Failed to insert new entry (3)\n"; +} + +sub update_copyright { + my ($t) = @_; + (my $year = $date) =~ s/.* //; + $t =~ s/^# Copyright \d+(?= )/$&-$year/m or + $t =~ s/^(# Copyright \d+)-(\d+)/$1-$year/m; + return $t; +} + +# 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"; +close O or die "Can't close ChangeLog.new: $!\n"; + +# 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) { + if (-s $e) { + my ($etext, $netext); + open E, "<$e" or warn("Can't read $e to update copyright year\n"), next; + { local $/ = undef; $etext = <E>; } + close E; + + # Attempt the substitution and compare + $netext = update_copyright($etext); + next if $netext eq $etext; # skip this file if no change. + + # Write the new ebuild + open E, ">$e.new" or warn("Can't open $e.new\n"), next; + print E $netext and + close E or warn("Can't write $e.new\n"), next; + + # Move things around and show the diff + system "diff -U 0 $e $e.new"; + rename "$e.new", $e or warn("Can't rename $e.new: $!\n"); + } +} + +# Move things around and show the ChangeLog diff +system 'diff -Nu ChangeLog ChangeLog.new'; +rename 'ChangeLog.new', 'ChangeLog' or die "Can't rename ChangeLog.new: $!\n"; + +# Okay, now we have a starter ChangeLog to work with. +# The text will be added just like with any other ChangeLog below. +# Add the new ChangeLog to vcs before continuing. +if ($vcs eq "cvs") { + if (open F, "CVS/Entries") { + system("cvs -f add ChangeLog") unless (scalar grep /^\/ChangeLog\//, <F>); + } +} elsif ($vcs eq "svn") { + if (open F, ".svn/entries") { + system("svn add ChangeLog") unless (scalar grep /ChangeLog/, <F>); + } +} else { + system("$vcs{$vcs}{add} ChangeLog 2>&1 >> /dev/null"); +} + +# vim:sw=4 ts=8 expandtab diff --git a/src/echangelog/echangelog.1 b/src/echangelog/echangelog.1 new file mode 100644 index 0000000..f83eaf7 --- /dev/null +++ b/src/echangelog/echangelog.1 @@ -0,0 +1,275 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.13 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ECHANGELOG 1" +.TH ECHANGELOG 1 "2004-04-02" "perl v5.8.2" "User Contributed Perl Documentation" +.SH "NAME" +echangelog \- Gentoo: update portage ChangeLogs +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +echangelog [ \fItext\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +This tool provides an easy way to create or update portage ChangeLogs +in Gentoo. The tool scans the current directory, which is assumed to +be a package directory such as /usr/portage/app\-editors/vim, finds +what files have been changed or added, and inserts the appropriate +entry to ChangeLog. If \fItext\fR is not provided on the command\-line, +echangelog prompts for it. +.PP +All modifications should occur before running echangelog so that it +can include the appropriate file information in the ChangeLog entry. +For example, you should run \*(L"cvs add\*(R" on your files, otherwise +echangelog won't know those files are part of the update. +.PP +If your text would cause the ChangeLog entry to exceed 80 columns, it +will be rewrapped to keep the ChangeLog neat. If you need special +formatting in the ChangeLog, then you can either (1) run echangelog +with no text on the command\-line, and make sure that your text won't +be too wide, (2) edit the ChangeLog manually. If you prefer (2), I'd +recommend something like \*(L"echangelog blah\*(R" so that the header lines +are computed correctly, then edit and change \*(L"blah\*(R" to your preferred +text. +.PP +In addition to updating the ChangeLog, echangelog will automatically +update the copyright year of all out-of-date ebuilds, as well as the +ChangeLog itself. These updates are included in the diff displayed by +echangelog when it finishes its work. +.SH "OPTIONS" +.IX Header "OPTIONS" +Presently echangelog is simple enough that it supplies no options. +Probably I'll add \fB\-\-help\fR and \fB\-\-version\fR in the future, but for +now it's enough to track the gentoolkit version. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +To create a ChangeLog for a completely new package. The header is +parsed from skel.ebuild. +.PP +.Vb 2 +\& $ cvs add metalog-0.1.ebuild +\& cvs server: use 'cvs commit' to add this file permanently +.Ve +.PP +.Vb 13 +\& $ echangelog 'New ebuild, thanks to Harvey McGillicuddy' +\& --- ChangeLog 1969-12-31 19:00:00.000000000 -0500 +\& +++ ChangeLog.new 2003-02-23 14:04:06.000000000 -0500 +\& @@ -0,0 +1,9 @@ +\& +# ChangeLog for app-admin/metalog +\& +# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 +\& +# $Header$ +\& + +\& +*metalog-0.1 (23 Feb 2003) +\& + +\& + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1.ebuild : +\& + New ebuild, thanks to Harvey McGillicuddy +\& + +.Ve +.PP +To bump a revision. Note you need to \*(L"cvs add\*(R" so that echangelog +will notice the new file. +.PP +.Vb 2 +\& $ cvs add metalog-0.1-r1.ebuild +\& cvs server: use 'cvs commit' to add this file permanently +.Ve +.PP +.Vb 6 +\& $ echangelog 'Bump revision to fix bug #999' +\& --- ChangeLog 2003-02-23 14:04:06.000000000 -0500 +\& +++ ChangeLog.new 2003-02-23 14:07:48.000000000 -0500 +\& @@ -2,6 +2,11 @@ +\& # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 +\& # $Header$ +.Ve +.PP +.Vb 6 +\& +*metalog-0.1-r1 (23 Feb 2003) +\& + +\& + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1-r1.ebuild : +\& + Bump revision to fix bug #999 +\& + +\& *metalog-0.1 (23 Feb 2003) +.Ve +.PP +.Vb 1 +\& 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1.ebuild : +.Ve +.PP +For a multi-line entry, omit the command-line arg. +.PP +.Vb 10 +\& $ echangelog +\& Please type the log entry, finish with ctrl-d +\& Bump revision to fix bug #999. Necessary to bump the revision because +\& the problem appears at run-time, not compile-time. This should also +\& give users the updated default configuration file. +\& --- ChangeLog 2003-02-23 14:09:12.000000000 -0500 +\& +++ ChangeLog.new 2003-02-23 14:12:43.000000000 -0500 +\& @@ -2,6 +2,13 @@ +\& # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 +\& # $Header$ +.Ve +.PP +.Vb 8 +\& +*metalog-0.1-r1 (23 Feb 2003) +\& + +\& + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1-r1.ebuild : +\& + Bump revision to fix bug #999. Necessary to bump the revision because +\& + the problem appears at run-time, not compile-time. This should also +\& + give users the updated default configuration file. +\& + +\& *metalog-0.1 (23 Feb 2003) +.Ve +.PP +.Vb 1 +\& 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1.ebuild : +.Ve +.SH "ENVIRONMENT VARIABLES" +.IX Header "ENVIRONMENT VARIABLES" +.IP "\s-1ECHANGELOG_USER\s0" 4 +.IX Item "ECHANGELOG_USER" +If echangelog can't figure out your username for the entry, you should +set \s-1ECHANGELOG_USER\s0. For example, export ECHANGELOG_USER=\*(L"Aron +Griffis <agriffis@gentoo.org>\*(R" +.SH "NOTES" +.IX Header "NOTES" +As of the most recent version of echangelog (when this man-page +appeared), echangelog puts all new entries at the top of the file +instead of finding the appropriate *version line within the file. +This is because that \*(L"new\*(R" ChangeLog format was never agreed upon by +the Gentoo developers. Unfortunately the existence of both formats +will undoubtedly cause much confusion. +.PP +This also means that the examples above are wrong, since I just copied +them from some old email. However they're not much wrong. ;\-) +.PP +This tool was written by Aron Griffis <agriffis@gentoo.org>. Bugs +found should be filed against me at http://bugs.gentoo.org/ diff --git a/src/echangelog/echangelog.pod b/src/echangelog/echangelog.pod new file mode 100644 index 0000000..192af8d --- /dev/null +++ b/src/echangelog/echangelog.pod @@ -0,0 +1,136 @@ +=head1 NAME + +echangelog - Gentoo: update portage ChangeLogs + +=head1 SYNOPSIS + +echangelog [ I<text> ] + +=head1 DESCRIPTION + +This tool provides an easy way to create or update portage ChangeLogs +in Gentoo. The tool scans the current directory, which is assumed to +be a package directory such as /usr/portage/app-editors/vim, finds +what files have been changed or added, and inserts the appropriate +entry to ChangeLog. If I<text> is not provided on the command-line, +echangelog prompts for it. + +All modifications should occur before running echangelog so that it +can include the appropriate file information in the ChangeLog entry. +For example, you should run "cvs add" on your files, otherwise +echangelog won't know those files are part of the update. + +If your text would cause the ChangeLog entry to exceed 80 columns, it +will be rewrapped to keep the ChangeLog neat. If you need special +formatting in the ChangeLog, then you can either (1) run echangelog +with no text on the command-line, and make sure that your text won't +be too wide, (2) edit the ChangeLog manually. If you prefer (2), I'd +recommend something like "echangelog blah" so that the header lines +are computed correctly, then edit and change "blah" to your preferred +text. + +In addition to updating the ChangeLog, echangelog will automatically +update the copyright year of all out-of-date ebuilds, as well as the +ChangeLog itself. These updates are included in the diff displayed by +echangelog when it finishes its work. + +=head1 OPTIONS + +Presently echangelog is simple enough that it supplies no options. +Probably I'll add B<--help> and B<--version> in the future, but for +now it's enough to track the gentoolkit version. + +=head1 EXAMPLES + +To create a ChangeLog for a completely new package. The header is +parsed from skel.ebuild. + + $ cvs add metalog-0.1.ebuild + cvs server: use 'cvs commit' to add this file permanently + + $ echangelog 'New ebuild, thanks to Harvey McGillicuddy' + --- ChangeLog 1969-12-31 19:00:00.000000000 -0500 + +++ ChangeLog.new 2003-02-23 14:04:06.000000000 -0500 + @@ -0,0 +1,9 @@ + +# ChangeLog for app-admin/metalog + +# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 + +# $Header$ + + + +*metalog-0.1 (23 Feb 2003) + + + + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1.ebuild : + + New ebuild, thanks to Harvey McGillicuddy + + + +To bump a revision. Note you need to "cvs add" so that echangelog +will notice the new file. + + $ cvs add metalog-0.1-r1.ebuild + cvs server: use 'cvs commit' to add this file permanently + + $ echangelog 'Bump revision to fix bug #999' + --- ChangeLog 2003-02-23 14:04:06.000000000 -0500 + +++ ChangeLog.new 2003-02-23 14:07:48.000000000 -0500 + @@ -2,6 +2,11 @@ + # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 + # $Header$ + + +*metalog-0.1-r1 (23 Feb 2003) + + + + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1-r1.ebuild : + + Bump revision to fix bug #999 + + + *metalog-0.1 (23 Feb 2003) + + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1.ebuild : + +For a multi-line entry, omit the command-line arg. + + $ echangelog + Please type the log entry, finish with ctrl-d + Bump revision to fix bug #999. Necessary to bump the revision because + the problem appears at run-time, not compile-time. This should also + give users the updated default configuration file. + --- ChangeLog 2003-02-23 14:09:12.000000000 -0500 + +++ ChangeLog.new 2003-02-23 14:12:43.000000000 -0500 + @@ -2,6 +2,13 @@ + # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 + # $Header$ + + +*metalog-0.1-r1 (23 Feb 2003) + + + + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1-r1.ebuild : + + Bump revision to fix bug #999. Necessary to bump the revision because + + the problem appears at run-time, not compile-time. This should also + + give users the updated default configuration file. + + + *metalog-0.1 (23 Feb 2003) + + 23 Feb 2003; Aron Griffis <agriffis@gentoo.org> metalog-0.1.ebuild : + +=head1 ENVIRONMENT VARIABLES + +=over + +=item ECHANGELOG_USER + +If echangelog can't figure out your username for the entry, you should +set ECHANGELOG_USER. For example, export ECHANGELOG_USER="Aron +Griffis <agriffis@gentoo.org>" + +=back + +=head1 NOTES + +As of the most recent version of echangelog (when this man-page +appeared), echangelog puts all new entries at the top of the file +instead of finding the appropriate *version line within the file. +This is because that "new" ChangeLog format was never agreed upon by +the Gentoo developers. Unfortunately the existence of both formats +will undoubtedly cause much confusion. + +This also means that the examples above are wrong, since I just copied +them from some old email. However they're not much wrong. ;-) + +This tool was written by Aron Griffis <agriffis@gentoo.org>. Bugs +found should be filed against me at http://bugs.gentoo.org/ |