# Usage:
# convert-conf.py < old.conf > new.conf
#
-# $Id: convert-conf.py,v 1.5 2005-04-17 02:18:55 isomer Exp $
+# $Id: convert-conf.py,v 1.8 2005-04-25 04:04:17 isomer Exp $
#
import sys
"HIS_REWRITE", "HIS_REMOTE", "HIS_NETSPLIT", "HIS_SERVERNAME",
"HIS_SERVERINFO", "HIS_URLSERVERS"
]
+deprecated_features = [
+ "VIRTUAL_HOST",
+ ]
# [ "old feature" => ( local oper priv, global oper priv ) ]
# None means don't add this
opers.append(parts)
cvtmap = {
- 'M': ('General', ('name', 'vhost', 'description', '', '!numeric'), ''),
+ 'M': ('General', ('name', 'vhost', 'description', '-', '!numeric'), ''),
'A': ('Admin', ('location', 'contact', 'contact'), ''),
'Y': ('Class', ('name', '!pingfreq', '!connectfreq', '!maxlinks', '!sendq'), ''),
'I': do_iline,
for item in items:
if idx >= len(parts):
break
+ # This field is ignored
+ if parts[idx]=="-":
+ continue
+ if len(parts[idx]) and not len(item):
+ sys.stderr.write("WARNING: Unknown field %i on line %i\n" % (idx,lno))
if len(parts[idx]) and len(item):
if item[0] == '!':
print "\t%s = %s;" % (item[1:], istr(parts[idx]))
print "\tname = \"%s\";" % qstr(connects[i]["name"])
print "\thost = \"%s\";" % qstr(connects[i]["host"])
print "\tpassword = \"%s\";" % qstr(connects[i]["password"])
- if connects[i]["port"]:
+ if connects[i].has_key("port"):
print "\tport = %s;" % connects[i]["port"]
print "\tclass = \"%s\";" % qstr(connects[i]["class"])
if connects[i].has_key("hub"):
print "\thub = \"%s\";" % qstr(connects[i]["hub"])
else:
print "\tleaf;"
+ if not connects[i].has_key("port"):
+ print "# You can now specify ports without implying autoconnect"
+ print "#\tport = 4400;"
+ print "\tautoconnect = no;"
+ sys.stderr.write("NOTE: You should add a port for \"%s\", autoconnect is now specified seperately\n" % qstr(connects[i]["name"]))
print "};"
print
print "# Option converted to locop privilege"
elif name.startswith("OPER_"):
print "# Option converted to oper privilege"
+ elif name in deprecated_features:
+ print "# Option is deprecated"
else:
- print "# Option no longer exists in 2.10.12"
+ print "# Unknown option"
+ sys.stderr.write("WARNING: Unknown option \"%s\"\n" % qstr(name))
print "#\t\"%s\" = \"%s\";" % (qstr(name), qstr(value))
print "};"
print