summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-09-11 03:58:57 +0000
committerbwarsaw2000-09-11 03:58:57 +0000
commit3862b53977f4201fd6b6f935628b1f1ed1503c4c (patch)
treeb6cfe375350e385db07a2bb215f107b2eefcb2bd
parentc01088f653574cd702b5a292aedd8201ff70ff12 (diff)
downloadmailman-3862b53977f4201fd6b6f935628b1f1ed1503c4c.tar.gz
mailman-3862b53977f4201fd6b6f935628b1f1ed1503c4c.tar.zst
mailman-3862b53977f4201fd6b6f935628b1f1ed1503c4c.zip
Make sure all scripts lowercase the list names, since they are case
insensitive. list_lists prints them out using their real name -- not their internal name -- and they should differ only by case. Closes SF bug #113742 and patch #101434.
-rwxr-xr-xbin/add_members2
-rw-r--r--bin/arch3
-rwxr-xr-xbin/check_db12
-rwxr-xr-xbin/clone_member2
-rw-r--r--bin/config_list2
-rw-r--r--bin/dumpdb2
-rwxr-xr-xbin/find_member10
-rwxr-xr-xbin/list_members3
-rwxr-xr-xbin/mmsitepass6
-rw-r--r--bin/move_list3
-rwxr-xr-xbin/remove_members2
-rwxr-xr-xbin/rmlist5
-rwxr-xr-xbin/sync_members2
-rw-r--r--bin/withlist2
14 files changed, 38 insertions, 18 deletions
diff --git a/bin/add_members b/bin/add_members
index bede2cf0a..9f6b186a1 100755
--- a/bin/add_members
+++ b/bin/add_members
@@ -132,7 +132,7 @@ def main():
if not len(args) == 1:
usage(1)
- listname = args[0]
+ listname = string.lower(args[0])
nfile = None
dfile = None
send_changes_msg = 0
diff --git a/bin/arch b/bin/arch
index 4daf6d719..f0784a2e9 100644
--- a/bin/arch
+++ b/bin/arch
@@ -34,6 +34,7 @@ be some path in the archives/private directory. For example:
import sys
import os
+import string
import getopt
import paths
@@ -69,7 +70,7 @@ def main():
# grok arguments
if len(args) < 1:
usage(1, 'listname is required')
- listname = args[0]
+ listname = string.lower(args[0])
if len(args) < 2:
mbox = None
diff --git a/bin/check_db b/bin/check_db
index 0a6cb3120..13c46c8e3 100755
--- a/bin/check_db
+++ b/bin/check_db
@@ -24,12 +24,16 @@ Usage: %(program)s listname
import sys
import os
+import string
import marshal
+
import paths
-import Mailman.mm_cfg
+from Mailman import mm_cfg
program = sys.argv[0]
+
+
def testfile(filename):
try:
fp = open(filename)
@@ -47,14 +51,15 @@ def testfile(filename):
return 0
+
def main():
if len(sys.argv) == 2:
- listname = sys.argv[1]
+ listname = string.lower(sys.argv[1])
else:
print __doc__ % globals()
sys.exit(1)
- listpath = os.path.join(Mailman.mm_cfg.LIST_DATA_DIR, listname)
+ listpath = os.path.join(mm_cfg.LIST_DATA_DIR, listname)
configdb = os.path.join(listpath, 'config.db')
lastdb = os.path.join(listpath, 'config.db.last')
@@ -82,5 +87,6 @@ from a system backup, or remove the list `%(listname)s' and
re-create it from scratch.""" % locals()
+
if __name__ == '__main__':
main()
diff --git a/bin/clone_member b/bin/clone_member
index 16871a410..6f17123f1 100755
--- a/bin/clone_member
+++ b/bin/clone_member
@@ -194,7 +194,7 @@ def main():
elif opt in ('-l', '--listname'):
if options.listnames is None:
options.listnames = []
- options.listnames.append(arg)
+ options.listnames.append(string.lower(arg))
# further options and argument processing
if not options.modify:
diff --git a/bin/config_list b/bin/config_list
index 3b74be018..bcb2270a5 100644
--- a/bin/config_list
+++ b/bin/config_list
@@ -228,7 +228,7 @@ def main():
# get the list name
if len(args) <> 1:
usage(1, 'List name is required')
- listname = args[0]
+ listname = string.lower(args[0])
if outfile:
do_output(listname, outfile)
diff --git a/bin/dumpdb b/bin/dumpdb
index 02d6c3e11..387948ac7 100644
--- a/bin/dumpdb
+++ b/bin/dumpdb
@@ -43,5 +43,7 @@ def main():
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(d)
+
+
if __name__ == '__main__':
main()
diff --git a/bin/find_member b/bin/find_member
index 2f7a24d7c..b25510506 100755
--- a/bin/find_member
+++ b/bin/find_member
@@ -26,7 +26,7 @@ Where:
-l listname
Include only the named list in the search.
- --excluded=listname
+ --exclude=listname
-x listname
Exclude the named list from the search.
@@ -59,6 +59,7 @@ displayed.
import sys
import re
import getopt
+import string
import paths
from Mailman import Utils
@@ -119,10 +120,11 @@ class Options:
listnames = Utils.list_names()
owners = None
+
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 'l:x:wh',
- ['listname=', 'excluded=', 'owners',
+ ['listname=', 'exclude=', 'owners',
'help'])
except getopt.error, e:
usage(1, e)
@@ -137,9 +139,9 @@ def main():
if not loptseen:
options.listnames = []
loptseen = 1
- options.listnames.append(arg)
+ options.listnames.append(string.lower(arg))
elif opt in ('-x', '--exclude'):
- excludes.append(arg)
+ excludes.append(string.lower(arg))
elif opt in ('-w', '--owners'):
options.owners = 1
diff --git a/bin/list_members b/bin/list_members
index 520455cc0..c1da95d5e 100755
--- a/bin/list_members
+++ b/bin/list_members
@@ -52,6 +52,7 @@ status.
"""
import sys
+import string
import getopt
import paths
@@ -80,7 +81,7 @@ def main():
if len(args) <> 1:
usage(1)
- listname = args[0]
+ listname = string.lower(args[0])
outfile = None
regular = None
digest = None
diff --git a/bin/mmsitepass b/bin/mmsitepass
index 53b124e62..474f38a35 100755
--- a/bin/mmsitepass
+++ b/bin/mmsitepass
@@ -31,6 +31,8 @@ except ImportError:
from Mailman.pythonlib import getpass
from Mailman import MailList
+
+
def main(argv):
if len(sys.argv) > 2:
print "Usage: mmsitepass [ password ]"
@@ -56,5 +58,7 @@ def main(argv):
print "Password change failed."
raise SystemExit, 1
-if __name__ == "__main__":
+
+
+if __name__ == '__main__':
main(sys.argv)
diff --git a/bin/move_list b/bin/move_list
index 9a9f97d83..d2d81455a 100644
--- a/bin/move_list
+++ b/bin/move_list
@@ -36,6 +36,7 @@ listname must be a valid mailing list name and is required.
import os
import sys
+import string
import getopt
import paths
@@ -67,7 +68,7 @@ def main():
usage(1)
try:
- listname = args[0]
+ listname = string.lower(args[0])
except IndexError:
usage(1, 'You must supply a list name.')
diff --git a/bin/remove_members b/bin/remove_members
index 6076997ac..84de45bad 100755
--- a/bin/remove_members
+++ b/bin/remove_members
@@ -79,7 +79,7 @@ def main():
if not len(args) >= 1:
usage(1)
- listname = args[0]
+ listname = string.lower(args[0])
addresses = args[1:]
filename = None
diff --git a/bin/rmlist b/bin/rmlist
index 3b2277da8..bf66587d0 100755
--- a/bin/rmlist
+++ b/bin/rmlist
@@ -46,6 +46,7 @@ def usage(status, msg=''):
print msg
sys.exit(status)
+
def remove_it(listname, dir, msg):
if os.path.islink(dir):
@@ -58,6 +59,7 @@ def remove_it(listname, dir, msg):
print listname, msg, 'not found as', dir
+
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 'ah',
@@ -67,7 +69,7 @@ def main():
if len(args) <> 1:
usage(1)
- listname = args[0]
+ listname = string.lower(args[0])
removeArchives = 0
for opt, arg in opts:
@@ -94,6 +96,7 @@ def main():
dir = os.path.join(paths.prefix, dirtmpl % listname)
remove_it(listname, dir, msg)
+
if __name__ == '__main__':
main()
diff --git a/bin/sync_members b/bin/sync_members
index 65370135a..ad582a828 100755
--- a/bin/sync_members
+++ b/bin/sync_members
@@ -156,7 +156,7 @@ def main():
usage(1, 'Illegal option: ' + opt)
else:
try:
- listname = sys.argv[i]
+ listname = string.lower(sys.argv[i])
i = i + 1
except IndexError:
usage(1, 'No listname given')
diff --git a/bin/withlist b/bin/withlist
index f7829e2da..23704dee9 100644
--- a/bin/withlist
+++ b/bin/withlist
@@ -137,7 +137,7 @@ def main():
if len(args) <> 1:
usage('No list name supplied.')
- listname = args[0]
+ listname = string.lower(args[0])
lock = 0
run = None