diff options
| author | bwarsaw | 2006-04-28 23:05:14 +0000 |
|---|---|---|
| committer | bwarsaw | 2006-04-28 23:05:14 +0000 |
| commit | 7c195b1f29ef15dcc933130e38386c76885100cd (patch) | |
| tree | 1dc5333b39a221192cc6a6732bfacb1457a07d74 | |
| parent | 00d980486b3edcc8bd0940654a28d9b408ae87f8 (diff) | |
| download | mailman-7c195b1f29ef15dcc933130e38386c76885100cd.tar.gz mailman-7c195b1f29ef15dcc933130e38386c76885100cd.tar.zst mailman-7c195b1f29ef15dcc933130e38386c76885100cd.zip | |
| -rw-r--r-- | Mailman/Defaults.py.in | 1 | ||||
| -rw-r--r-- | Mailman/bin/arch.py | 169 | ||||
| -rwxr-xr-x | Mailman/bin/mmsitepass.py | 85 | ||||
| -rwxr-xr-x | Mailman/bin/newlist.py | 2 | ||||
| -rwxr-xr-x | Mailman/bin/rmlist.py | 2 | ||||
| -rw-r--r-- | Mailman/bin/unshunt.py (renamed from bin/unshunt) | 66 | ||||
| -rw-r--r-- | bin/Makefile.in | 12 | ||||
| -rw-r--r-- | bin/arch | 200 | ||||
| -rw-r--r-- | bin/b4b5-archfix | 96 | ||||
| -rwxr-xr-x | bin/mmsitepass | 105 | ||||
| -rwxr-xr-x | configure | 6 | ||||
| -rw-r--r-- | configure.in | 6 |
12 files changed, 289 insertions, 461 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index cfff401a8..27eb73ee5 100644 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -1301,6 +1301,7 @@ LISTCREATOR_PW_FILE = os.path.join(DATA_DIR, 'creator.pw') # Import a bunch of version numbers from Version import * +MAILMAN_VERSION = 'GNU Mailman ' + VERSION # Vgg: Language descriptions and charsets dictionary, any new supported # language must have a corresponding entry here. Key is the name of the diff --git a/Mailman/bin/arch.py b/Mailman/bin/arch.py new file mode 100644 index 000000000..3d3036460 --- /dev/null +++ b/Mailman/bin/arch.py @@ -0,0 +1,169 @@ +# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +import os +import sys +import errno +import shutil +import optparse + +from Mailman import Errors +from Mailman import i18n +from Mailman import mm_cfg +from Mailman.Archiver.HyperArch import HyperArchive +from Mailman.LockFile import LockFile +from Mailman.MailList import MailList + +_ = i18n._ +i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) + +__i18n_templates__ = True + + + +def parseargs(): + parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION, + usage=_("""\ +%%prog [options] listname [mbox] + +Rebuild a list's archive. + +Use this command to rebuild the archives for a mailing list. You may want to +do this if you edit some messages in an archive, or remove some messages from +an archive. + +Where 'mbox' is the path to a list's complete mbox archive. Usually this will +be some path in the archives/private directory. For example: + +% bin/arch mylist archives/private/mylist.mbox/mylist.mbox + +'mbox' is optional. If it is missing, it is calculated from the listname. +""")) + parser.add_option('-q', '--quiet', + dest='verbose', default=True, action='store_false', + help=_('Make the archiver output less verbose')) + parser.add_option('--wipe', + default=False, action='store_true', + help=_("""\ +First wipe out the original archive before regenerating. You usually want to +specify this argument unless you're generating the archive in chunks.""")) + parser.add_option('-s', '--start', + default=None, type='int', metavar='N', + help=_("""\ +Start indexing at article N, where article 0 is the first in the mbox. +Defaults to 0.""")) + parser.add_option('-e', '--end', + default=None, type='int', metavar='M', + help=_("""\ +End indexing at article M. This script is not very efficient with respect to +memory management, and for large archives, it may not be possible to index the +mbox entirely. For that reason, you can specify the start and end article +numbers.""")) + opts, args = parser.parse_args() + if len(args) < 1: + parser.print_help() + print >> sys.stderr, _('listname is required') + sys.exit(1) + if len(args) > 2: + parser.print_help() + print >> sys.stderr, _('Unexpected arguments') + sys.exit(1) + return parser, opts, args + + + +def main(): + parser, opts, args = parseargs() + + listname = args[0].lower().strip() + if len(args) < 2: + mbox = None + else: + mbox = args[1] + + # Open the mailing list object + mlist = None + lock = None + try: + try: + mlist = MailList(listname) + except Errors.MMListError, e: + parser.print_help() + print >> sys.stderr, _('No such list: $listname\n$e') + sys.exit(1) + if mbox is None: + mbox = mlist.ArchiveFileName() + + i18n.set_language(mlist.preferred_language) + # Lay claim to the archive's lock file. This is so no other post can + # mess up the archive while we're processing it. Try to pick a + # suitably long period of time for the lock lifetime even though we + # really don't know how long it will take. + # + # XXX processUnixMailbox() should refresh the lock. + # + # XXX This may not be necessary because I think we lay claim to the + # list lock up above, although that may be too short to be of use (and + # maybe we don't really want to lock the list anyway). + lockfile = os.path.join(mm_cfg.LOCK_DIR, mlist._internal_name) + \ + '.archiver.lock' + # set the lock lifetime to 3 hours. XXX is this reasonable??? + lock = LockFile(lockfile, lifetime=3*60*60) + lock.lock() + # Maybe wipe the old archives + if opts.wipe: + if mlist.scrub_nondigest: + # TK: save the attachments dir because they are not in mbox + saved = False + atchdir = os.path.join(mlist.archive_dir(), 'attachments') + savedir = os.path.join(mlist.archive_dir() + '.mbox', + 'attachments') + try: + os.rename(atchdir, savedir) + saved = True + except OSError, e: + if e.errno <> errno.ENOENT: + raise + shutil.rmtree(mlist.archive_dir()) + if mlist.scrub_nondigest and saved: + os.renames(savedir, atchdir) + try: + fp = open(mbox) + except IOError, e: + if e.errno == errno.ENOENT: + print >> sys.stderr, _('Cannot open mbox file: $mbox') + else: + print >> sys.stderr, e + sys.exit(1) + + archiver = HyperArchive(mlist) + archiver.VERBOSE = opts.verbose + try: + archiver.processUnixMailbox(fp, opts.start, opts.end) + finally: + archiver.close() + fp.close() + finally: + if lock: + lock.unlock() + if mlist: + mlist.Unlock() + + + +if __name__ == '__main__': + main() diff --git a/Mailman/bin/mmsitepass.py b/Mailman/bin/mmsitepass.py new file mode 100755 index 000000000..b6576c8fa --- /dev/null +++ b/Mailman/bin/mmsitepass.py @@ -0,0 +1,85 @@ +# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +import sys +import getpass +import optparse + +from Mailman import Utils +from Mailman import mm_cfg +from Mailman.i18n import _ + +__i18n_templates__ = True + + + +def parseargs(): + parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION, + usage=_("""\ +%prog [options] [password] + +Set the site or list creator password. + +The site password can be used in most if not all places that the list +administrator's password can be used, which in turn can be used in most places +that a list user's password can be used. The list creator password is a +separate password that can be given to non-site administrators to delegate the +ability to create new mailing lists. + +If password is not given on the command line, it will be prompted for. +""")) + parser.add_option('-c', '--listcreator', + default=False, action='store_true', + help=_("""\ +Set the list creator password instead of the site password. The list +creator is authorized to create and remove lists, but does not have +the total power of the site administrator.""")) + opts, args = parser.parse_args() + if len(args) > 1: + parser.print_help() + print >> sys.stderr, _('Unexpected arguments') + sys.exit(1) + return parser, opts, args + + + +def main(): + parser, opts, args = parseargs() + if args: + password = args[0] + else: + # Prompt for the password + if opts.listcreator: + prompt_1 = _('New list creator password: ') + else: + prompt_1 = _('New site administrator password: ') + pw1 = getpass.getpass(prompt_1) + pw2 = getpass.getpass(_('Enter password again to confirm: ')) + if pw1 <> pw2: + print _('Passwords do not match; no changes made.') + sys.exit(1) + password = pw1 + Utils.set_global_password(password, not opts.listcreator) + if Utils.check_global_password(password, not opts.listcreator): + print _('Password changed.') + else: + print _('Password change failed.') + + + +if __name__ == '__main__': + main() diff --git a/Mailman/bin/newlist.py b/Mailman/bin/newlist.py index 2a103c15b..bd2ec0dde 100755 --- a/Mailman/bin/newlist.py +++ b/Mailman/bin/newlist.py @@ -35,7 +35,7 @@ __i18n_templates__ = True def parseargs(): - parser = optparse.OptionParser(version='GNU Mailman ' + mm_cfg.VERSION, + parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION, usage=_("""\ %%prog [options] [listname [listadmin-addr [admin-password]]] diff --git a/Mailman/bin/rmlist.py b/Mailman/bin/rmlist.py index e2d41c8d9..9d83bf1b6 100755 --- a/Mailman/bin/rmlist.py +++ b/Mailman/bin/rmlist.py @@ -44,7 +44,7 @@ def remove_it(listname, filename, msg): def parseargs(): - parser = optparse.OptionParser(version='GNU Mailman ' + mm_cfg.VERSION, + parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION, usage=_("""\ %%prog [options] listname diff --git a/bin/unshunt b/Mailman/bin/unshunt.py index 8b6755878..c2fdbe349 100644 --- a/bin/unshunt +++ b/Mailman/bin/unshunt.py @@ -1,6 +1,4 @@ -#! @PYTHON@ - -# Copyright (C) 2002 by the Free Software Foundation, Inc. +# Copyright (C) 2002-2006 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -14,59 +12,43 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -"""Move a message from the shunt queue to the original queue. - -Usage: %(PROGRAM)s [options] [directory] - -Where: - - -h / --help - Print help and exit. - -Optional `directory' specifies a directory to dequeue from other than -qfiles/shunt. -""" +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. import sys -import getopt +import optparse -import paths from Mailman import mm_cfg from Mailman.Queue.sbcache import get_switchboard from Mailman.i18n import _ +__i18n_templates__ = True + -def usage(code, msg=''): - if code: - fd = sys.stderr - else: - fd = sys.stdout - print >> fd, _(__doc__) - if msg: - print >> fd, msg - sys.exit(code) +def parseargs(): + parser = optparse.OptionParser(version=mm_cfg.MAILMAN_VERSION, + usage=_("""\ +%%prog [options] [directory] + +Move a message from the shunt queue to the original queue. Optional +`directory' specifies a directory to dequeue from other than qfiles/shunt. +""")) + opts, args = parser.parse_args() + if len(args) > 1: + parser.print_help() + print >> sys.stderr, _('Unexpected arguments') + sys.exit(1) + return parser, opts, args def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], 'h', ['help']) - except getopt.error, msg: - usage(1, msg) - - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - - if len(args) == 0: - qdir = mm_cfg.SHUNTQUEUE_DIR - elif len(args) == 1: + parser, opts, args = parseargs() + if args: qdir = args[0] else: - usage(1) + qdir = mm_cfg.SHUNTQUEUE_DIR sb = get_switchboard(qdir) for filebase in sb.files(): @@ -79,7 +61,7 @@ def main(): # If there are any unshunting errors, log them and continue trying # other shunted messages. print >> sys.stderr, _( - 'Cannot unshunt message %(filebase)s, skipping:\n%(e)s') + 'Cannot unshunt message $filebase, skipping:\n$e') diff --git a/bin/Makefile.in b/bin/Makefile.in index 9e59a62f9..6e6ba81d6 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -44,16 +44,16 @@ SCRIPTSDIR= $(prefix)/bin SHELL= /bin/sh -SCRIPTS= mmsitepass mmshell add_members \ - list_members remove_members clone_member update arch \ +SCRIPTS= mmshell add_members \ + list_members remove_members clone_member update \ sync_members check_db withlist check_perms find_member \ version config_list list_lists dumpdb cleanarch \ list_admins genaliases change_pw mailmanctl qrunner inject \ - unshunt fix_url.py convert.py transcheck b4b5-archfix \ + fix_url.py convert.py transcheck \ list_owners msgfmt.py show_qfiles discard rb-archfix \ reset_pw.py templ2pot.py po2templ.py -LN_SCRIPTS= newlist rmlist +LN_SCRIPTS= arch mmsitepass newlist rmlist unshunt BUILDDIR= ../build/bin @@ -77,8 +77,8 @@ install: done for f in $(LN_SCRIPTS); \ do \ - rm -f $(DESTDIR)/$(SCRIPTSDIR)/$$f; \ - (cd $(DESTDIR)/$(SCRIPTSDIR); $(LN_S) mmshell $$f); \ + rm -f $(DESTDIR)$(SCRIPTSDIR)/$$f; \ + (cd $(DESTDIR)$(SCRIPTSDIR); $(LN_S) mmshell $$f); \ done finish: diff --git a/bin/arch b/bin/arch deleted file mode 100644 index 40a75a0e3..000000000 --- a/bin/arch +++ /dev/null @@ -1,200 +0,0 @@ -#! @PYTHON@ -# -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -"""Rebuild a list's archive. - -Use this command to rebuild the archives for a mailing list. You may want to -do this if you edit some messages in an archive, or remove some messages from -an archive. - -Usage: %(PROGRAM)s [options] <listname> [<mbox>] - -Where options are: - -h / --help - Print this help message and exit. - - -q / --quiet - Make the archiver output less verbose. - - --wipe - First wipe out the original archive before regenerating. You usually - want to specify this argument unless you're generating the archive in - chunks. - - -s N - --start=N - Start indexing at article N, where article 0 is the first in the mbox. - Defaults to 0. - - -e M - --end=M - End indexing at article M. This script is not very efficient with - respect to memory management, and for large archives, it may not be - possible to index the mbox entirely. For that reason, you can specify - the start and end article numbers. - -Where <mbox> is the path to a list's complete mbox archive. Usually this will -be some path in the archives/private directory. For example: - -%% bin/arch mylist archives/private/mylist.mbox/mylist.mbox - -<mbox> is optional. If it is missing, it is calculated. -""" - -import os -import sys -import getopt -import shutil - -import paths -from Mailman import mm_cfg -from Mailman import Errors - -from Mailman.MailList import MailList -from Mailman.Archiver.HyperArch import HyperArchive -from Mailman.LockFile import LockFile -from Mailman import i18n - -_ = i18n._ - -PROGRAM = sys.argv[0] -i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) - - - -def usage(code, msg=''): - if code: - fd = sys.stderr - else: - fd = sys.stdout - print >> fd, _(__doc__) - if msg: - print >> fd, msg - sys.exit(code) - - - -def main(): - # get command line arguments - try: - opts, args = getopt.getopt( - sys.argv[1:], 'hs:e:q', - ['help', 'start=', 'end=', 'quiet', 'wipe']) - except getopt.error, msg: - usage(1, msg) - - start = None - end = None - verbose = 1 - wipe = 0 - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt in ('-s', '--start'): - try: - start = int(arg) - except ValueError: - usage(1) - elif opt in ('-e', '--end'): - try: - end = int(arg) - except ValueError: - usage(1) - elif opt in ('-q', '--quiet'): - verbose = 0 - elif opt == '--wipe': - wipe = 1 - - # grok arguments - if len(args) < 1: - usage(1, _('listname is required')) - listname = args[0].lower().strip() - - if len(args) < 2: - mbox = None - else: - mbox = args[1] - - if len(args) > 2: - usage(1) - - # open the mailing list object - mlist = None - lock = None - try: - try: - mlist = MailList(listname) - except Errors.MMListError, e: - usage(2, _('No such list "%(listname)s"\n%(e)s')) - if mbox is None: - mbox = mlist.ArchiveFileName() - - i18n.set_language(mlist.preferred_language) - # lay claim to the archive's lock file. this is so no other post can - # mess up the archive while we're glomming it. we pick a suitably - # long period of time for the lock lifetime, however we really don't - # know how long it will take. - # - # XXX: processUnixMailbox() should refresh the lock. - # - # XXX: this may not be necessary because I think we lay claim to the - # list lock up above, although that may be too short to be of use (and - # maybe we don't really want to lock the list anyway). - # - lockfile = os.path.join(mm_cfg.LOCK_DIR, mlist._internal_name) + \ - '.archiver.lock' - # set the lock lifetime to 3 hours. XXX is this reasonable??? - lock = LockFile(lockfile, lifetime=3*60*60) - lock.lock() - # Maybe wipe the old archives - if wipe: - if mlist.scrub_nondigest: - # TK: save the attachments dir because they are not in mbox - saved = 0 - try: - atchdir = os.path.join(mlist.archive_dir(), 'attachments') - savedir = os.path.join(mlist.archive_dir() + '.mbox', - 'attachments') - os.rename(atchdir, savedir) - saved = 1 - except: - pass - shutil.rmtree(mlist.archive_dir()) - if mlist.scrub_nondigest and saved: - os.renames(savedir, atchdir) - try: - fp = open(mbox) - except IOError, msg: - usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s')) - - archiver = HyperArchive(mlist) - archiver.VERBOSE = verbose - try: - archiver.processUnixMailbox(fp, start, end) - finally: - archiver.close() - fp.close() - finally: - if lock: - lock.unlock() - if mlist: - mlist.Unlock() - - -if __name__ == '__main__': - main() diff --git a/bin/b4b5-archfix b/bin/b4b5-archfix deleted file mode 100644 index 1bdaedac5..000000000 --- a/bin/b4b5-archfix +++ /dev/null @@ -1,96 +0,0 @@ -#! @PYTHON@ -# -# Copyright (C) 2002 by the Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -"""Fix the MM2.1b4 archives. - -Usage: %(PROGRAM)s [options] file ... - -Where options are: - -h / --help - Print this help message and exit. - -Only use this to `fix' some archive database files that may have gotten -written in Mailman 2.1b4 with some bogus data. Use like this from your -$PREFIX directory - -%% %(PROGRAM)s `grep -l _mlist archives/private/*/database/*-article` - -(note the backquotes are required) - -You will need to run `bin/check_perms -f' after running this script. -""" -# This script is provided for convenience purposes only. It isn't supported. - -import os -import sys -import getopt -import marshal -import cPickle as pickle - -# Required to get the right classes for unpickling -import paths -from Mailman.i18n import _ - -PROGRAM = sys.argv[0] - - - -def usage(code, msg=''): - if code: - fd = sys.stderr - else: - fd = sys.stdout - print >> fd, _(__doc__) - if msg: - print >> fd, msg - sys.exit(code) - - - -def main(): - # get command line arguments - try: - opts, args = getopt.getopt(sys.argv[1:], 'h', ['help']) - except getopt.error, msg: - usage(1, msg) - - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - - for filename in args: - print 'processing:', filename - fp = open(filename, 'rb') - d = marshal.load(fp) - fp.close() - newd = {} - for key, pckstr in d.items(): - article = pickle.loads(pckstr) - newd[key] = pickle.dumps(article) - fp = open(filename + '.tmp', 'wb') - marshal.dump(newd, fp) - fp.close() - os.rename(filename, filename + '.bak') - os.rename(filename + '.tmp', filename) - - print 'You should now run "bin/check_perms -f"' - - - -if __name__ == '__main__': - main() diff --git a/bin/mmsitepass b/bin/mmsitepass deleted file mode 100755 index 0bb6e77e6..000000000 --- a/bin/mmsitepass +++ /dev/null @@ -1,105 +0,0 @@ -#! @PYTHON@ -# -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -"""Set the site password, prompting from the terminal. - -The site password can be used in most if not all places that the list -administrator's password can be used, which in turn can be used in most places -that a list users password can be used. - -Usage: %(PROGRAM)s [options] [password] - -Options: - - -c/--listcreator - Set the list creator password instead of the site password. The list - creator is authorized to create and remove lists, but does not have - the total power of the site administrator. - - -h/--help - Print this help message and exit. - -If password is not given on the command line, it will be prompted for. -""" - -import sys -import getpass -import getopt - -import paths -from Mailman import Utils -from Mailman.i18n import _ - -PROGRAM = sys.argv[0] - - - -def usage(code, msg=''): - if code: - fd = sys.stderr - else: - fd = sys.stdout - print >> fd, _(__doc__) - if msg: - print >> fd, msg - sys.exit(code) - - - -def main(): - try: - opts, args = getopt.getopt(sys.argv[1:], 'ch', - ['listcreator', 'help']) - except getopt.error, msg: - usage(1, msg) - - # Defaults - siteadmin = 1 - pwdesc = _('site') - - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt in ('-c', '--listcreator'): - siteadmin = 0 - pwdesc = _('list creator') - - if len(args) == 1: - pw1 = args[0] - else: - try: - pw1 = getpass.getpass(_('New %(pwdesc)s password: ')) - pw2 = getpass.getpass(_('Again to confirm password: ')) - if pw1 <> pw2: - print _('Passwords do not match; no changes made.') - sys.exit(1) - except KeyboardInterrupt: - print _('Interrupted...') - sys.exit(0) - # Set the site password by writing it to a local file. Make sure the - # permissions don't allow other+read. - Utils.set_global_password(pw1, siteadmin) - if Utils.check_global_password(pw1, siteadmin): - print _('Password changed.') - else: - print _('Password change failed.') - - - -if __name__ == '__main__': - main() @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 7858 . +# From configure.in Revision: 7876 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # @@ -4277,7 +4277,6 @@ done SCRIPTS="build/bin/add_members:bin/add_members \ -build/bin/arch:bin/arch \ build/bin/change_pw:bin/change_pw \ build/bin/check_db:bin/check_db \ build/bin/check_perms:bin/check_perms \ @@ -4297,7 +4296,6 @@ build/bin/list_members:bin/list_members \ build/bin/list_owners:bin/list_owners \ build/bin/mailmanctl:bin/mailmanctl \ build/bin/mmshell:bin/mmshell \ -build/bin/mmsitepass:bin/mmsitepass \ build/bin/msgfmt.py:bin/msgfmt.py \ build/bin/pygettext.py:bin/pygettext.py \ build/bin/qrunner:bin/qrunner \ @@ -4306,11 +4304,9 @@ build/bin/reset_pw.py:bin/reset_pw.py \ build/bin/show_qfiles:bin/show_qfiles \ build/bin/sync_members:bin/sync_members \ build/bin/transcheck:bin/transcheck \ -build/bin/unshunt:bin/unshunt \ build/bin/update:bin/update \ build/bin/version:bin/version \ build/bin/withlist:bin/withlist \ -build/bin/b4b5-archfix:bin/b4b5-archfix \ build/bin/rb-archfix:bin/rb-archfix \ build/bin/templ2pot.py:bin/templ2pot.py \ build/bin/po2templ.py:bin/po2templ.py \ diff --git a/configure.in b/configure.in index d3c691c3f..d0f3667ad 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. dnl Process this file with autoconf to produce a configure script. -AC_REVISION($Revision: 7876 $) +AC_REVISION($Revision: 7881 $) AC_PREREQ(2.0) AC_INIT(src/common.h) @@ -595,7 +595,6 @@ dnl Expand PYTHON path in the scripts, output into build/scriptname AC_DEFUN(MM_SCRIPTS, [dnl bin/add_members \ -bin/arch \ bin/change_pw \ bin/check_db \ bin/check_perms \ @@ -615,7 +614,6 @@ bin/list_members \ bin/list_owners \ bin/mailmanctl \ bin/mmshell \ -bin/mmsitepass \ bin/msgfmt.py \ bin/pygettext.py \ bin/qrunner \ @@ -624,11 +622,9 @@ bin/reset_pw.py \ bin/show_qfiles \ bin/sync_members \ bin/transcheck \ -bin/unshunt \ bin/update \ bin/version \ bin/withlist \ -bin/b4b5-archfix \ bin/rb-archfix \ bin/templ2pot.py \ bin/po2templ.py \ |
