INN commit: trunk (4 files)
INN Commit
Russ_Allbery at isc.org
Sun Apr 12 20:19:35 UTC 2009
Date: Sunday, April 12, 2009 @ 13:19:35
Author: iulius
Revision: 8415
Rename obsolete programs and configuration files, appending
'.OLD' to their name. Remove obsolete man pages.
The affected files are only those since INN 2.4.0.
Modified:
trunk/Makefile
trunk/doc/pod/innupgrade.pod
trunk/scripts/innupgrade.in
trunk/tests/util/innupgrade.t
-------------------------+
Makefile | 8 ++++++
doc/pod/innupgrade.pod | 55 +++++++++++++++++++++++++++++++++++++++-------
scripts/innupgrade.in | 48 +++++++++++++++++++++++++++++++++++++---
tests/util/innupgrade.t | 17 +++++++++++++-
4 files changed, 116 insertions(+), 12 deletions(-)
Modified: Makefile
===================================================================
--- Makefile 2009-04-12 17:30:50 UTC (rev 8414)
+++ Makefile 2009-04-12 20:19:35 UTC (rev 8415)
@@ -112,7 +112,15 @@
echo '' ; \
cd $$D && $(MAKE) install || exit 1 ; cd .. ; \
done
+ test -z "$D" && $(PATHBIN)/innupgrade $(PATHAUTHPASSWD)
+ test -z "$D" && $(PATHBIN)/innupgrade $(PATHBIN)
+ test -z "$D" && $(PATHBIN)/innupgrade $(PATHDOC)
test -z "$D" && $(PATHBIN)/innupgrade $(PATHETC)
+ test -z "$D" && $(PATHBIN)/innupgrade ${PATHFILTER}
+ test -z "$D" && $(PATHBIN)/innupgrade $(MAN1)
+ test -z "$D" && $(PATHBIN)/innupgrade $(MAN3)
+ test -z "$D" && $(PATHBIN)/innupgrade $(MAN5)
+ test -z "$D" && $(PATHBIN)/innupgrade $(MAN8)
install-root:
@chmod +x support/install-sh
Modified: doc/pod/innupgrade.pod
===================================================================
--- doc/pod/innupgrade.pod 2009-04-12 17:30:50 UTC (rev 8414)
+++ doc/pod/innupgrade.pod 2009-04-12 20:19:35 UTC (rev 8415)
@@ -26,18 +26,56 @@
=over 2
+=item F<inn.conf>
+
+=over 2
+
=item *
-F<inn.conf>: Quote values with whitespace and comment out keys with no
-values, required for the change in configuration parsers introduced in S<INN
-2.4>. The new format is not backward compatible with the previous parser,
-since the previous parser will include the double-quotes in the value of
-the parameter.
+Quote values with whitespace and comment out keys with no values, required
+for the change in configuration parsers introduced in S<INN 2.4>. The new
+format is not backward compatible with the previous parser, since the
+previous parser will include the double-quotes in the value of the parameter.
+=item *
+
+Add the I<hismethod> parameter if not found (introduced in S<INN 2.4>,
+with the default value C<hisv6>) and rename I<nntpactsync> to
+I<incominglogfrequency> (since S<INN 2.5>).
+
+=item *
+
+If the F<overview.fmt> file exists, its content is merged in
+the I<extraoverviewadvertised> and I<extraoverviewhidden> parameters
+introduced in S<INN 2.5>. The file is then renamed to F<overview.fmt.OLD>.
+
+=item *
+
+If the F<sasl.conf> file exists, its content is merged in
+the I<tlscapath>, I<tlscafile>, I<tlscertfile> and I<tlskeyfile>
+parameters introduced in S<INN 2.5>. The file is then renamed to
+F<sasl.conf.OLD>.
+
=back
-Normally, B<innupgrade> should be run on the I<pathetc> directory after
-any upgrade of INN other than a patch release (any upgrade that changes
+=item F<newsfeeds>
+
+=over 2
+
+=item *
+
+Replace the use of B<startinnfeed> with the appropriate direct invocation
+of B<innfeed> or B<imapfeed>.
+
+=back
+
+=back
+
+A few obsolete programs or configuration files are renamed with a C<.OLD>
+extension by B<innupgrade>. Obsolete man pages are directly removed.
+
+Normally, B<innupgrade> should be run at least on the I<pathetc> directory
+after any upgrade of INN other than a patch release (any upgrade that changes
the first or second version numbers). This may occur automatically during
the upgrade process.
@@ -60,7 +98,8 @@
=head1 EXAMPLES
-Upgrade any configuration files found in I<pathetc>:
+Upgrade any configuration files found in I<pathetc> and append a C<.OLD>
+extension to obsolete files in I<pathetc>:
innupgrade <pathetc in inn.conf>
Modified: scripts/innupgrade.in
===================================================================
--- scripts/innupgrade.in 2009-04-12 17:30:50 UTC (rev 8414)
+++ scripts/innupgrade.in 2009-04-12 20:19:35 UTC (rev 8415)
@@ -29,7 +29,7 @@
require 5.003;
use strict;
-use vars qw(%FIXES);
+use vars qw(%FIXES %RENAME);
use subs qw(fix_inn_conf);
use Getopt::Long qw(GetOptions);
@@ -38,6 +38,31 @@
%FIXES = ('inn.conf' => \&fix_inn_conf,
'newsfeeds' => \&fix_newsfeeds);
+# The mappings of obsolete file names to rename.
+# If the new name is empty, the file is removed.
+%RENAME = ('auth_smb' => 'auth_smb.OLD', # Obsolete programs in INN 2.5.0.
+ 'auth_smb.8' => '',
+ 'gpgverify' => 'gpgverify.OLD',
+ 'inndstart' => 'inndstart.OLD',
+ 'inndstart.8' => '',
+ 'overview.fmt' => 'overview.fmt.OLD',
+ 'overview.fmt.5' => '',
+ 'sasl.conf' => 'sasl.conf.OLD',
+ 'sasl.conf.5' => '',
+ 'startinnfeed' => 'startinnfeed.OLD',
+ 'startinnfeed.1' => '',
+
+ 'compliance-nntp' => '', # Obsolete documentation in INN 2.5.0.
+ 'makeactive.8' => '', # -- empty placeholder.
+ 'parsedate.3' => '', # -- replaced by convdate.
+ 'pgpverify.8' => '', # -- it is pgpverify(1).
+ 'README.readers.conf' => '', # -- it is external-auth.
+ 'sm.8' => '', # -- it is sm(1).
+
+ 'hook-tcl' => 'hook-tcl.OLD', # Obsolete Tcl hooks in INN 2.5.0.
+ 'filter.tcl' => 'filter.tcl.OLD',
+ 'startup.tcl' => 'startup.tcl.OLD');
+
# Clean up inn.conf for the new parser in INN 2.4. Null keys (keys without
# values) need to be commented out since they're no longer allowed (don't just
# remove them entirely since people may want them there as examples), and
@@ -230,6 +255,7 @@
# Upgrade a directory. Scan the directory for files that have upgrade rules
# defined and for each one of those, try running the upgrade rule.
+# Also rename obsolete files, appending ".OLD" to their name.
sub upgrade_directory {
my $directory = shift;
my $file;
@@ -242,11 +268,27 @@
if ($_ =~ /^([^\/]+)$/) {
$file = $1;
}
- if ($FIXES{$file}) {
+ if (exists ($FIXES{$file})) {
upgrade_file ($file, $FIXES{$file});
}
}
closedir (DIR);
+ opendir (DIR, ".") or die "Can't opendir $directory: $!\n";
+ for (readdir DIR) {
+ if ($_ =~ /^([^\/]+)$/) {
+ $file = $1;
+ }
+ if (exists ($RENAME{$file})) {
+ if ($RENAME{$file} eq '') {
+ unlink ($file)
+ or die "$file: cannot remove: $!\n";
+ } else {
+ rename ($file, $RENAME{$file})
+ or die "$file: cannot rename to $file.OLD: $!\n";
+ }
+ }
+ }
+ closedir (DIR);
}
@@ -264,7 +306,7 @@
}
chdir $dirname or die "Can't chdir to $dirname: $!\n";
$type ||= $basename;
- if (!$FIXES{$type}) { die "No upgrade rules defined for $basename\n" }
+ if (! exists($FIXES{$type})) { die "No upgrade rules defined for $basename\n" }
upgrade_file ($basename, $FIXES{$type});
} else {
if (@ARGV != 1) { die "Usage: innupgrade <directory>\n" }
Modified: tests/util/innupgrade.t
===================================================================
--- tests/util/innupgrade.t 2009-04-12 17:30:50 UTC (rev 8414)
+++ tests/util/innupgrade.t 2009-04-12 20:19:35 UTC (rev 8415)
@@ -55,7 +55,7 @@
fi
# Print out the number of tests
-echo 11
+echo 13
# Save backup copies.
cp "upgrade/inn.conf" "upgrade/inn.conf.bad"
@@ -68,12 +68,27 @@
compare "upgrade/inn.conf" "upgrade/inn.conf.ok"
compare "upgrade/newsfeeds" "upgrade/newsfeeds.ok"
+if [ ! -e "upgrade/overview.fmt" ] && [ -e "upgrade/overview.fmt.OLD" ] ; then
+ printcount "ok"
+else
+ printcount "not ok"
+fi
+
# Move inn.conf back and run it again in file mode.
+# Also move obsolete files back.
mv -f "upgrade/inn.conf.OLD" "upgrade/inn.conf"
+mv -f "upgrade/overview.fmt.OLD" "upgrade/overview.fmt"
+mv -f "upgrade/sasl.conf.OLD" "upgrade/sasl.conf"
run "-f" "upgrade/inn.conf"
compare "upgrade/inn.conf.OLD" "upgrade/inn.conf.bad"
compare "upgrade/inn.conf" "upgrade/inn.conf.ok"
+if [ -e "upgrade/overview.fmt" ] && [ ! -e "upgrade/overview.fmt.OLD" ] ; then
+ printcount "ok"
+else
+ printcount "not ok"
+fi
+
# Run innupgrade on the good file and make sure that it doesn't change
# anything.
run "-f" "upgrade/inn.conf"
More information about the inn-committers
mailing list