1 # Copyright (C) 1998-2015 by the Free Software Foundation, Inc.
3 # This file is part of GNU Mailman.
5 # GNU Mailman is free software: you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option)
10 # GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 # You should have received a copy of the GNU General Public License along with
16 # GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
21 from mailman
import errors
22 from mailman
import MailList
23 from mailman
.configuration
import config
24 from mailman
.core
.i18n
import _
25 from mailman
.version
import MAILMAN_VERSION
27 # Work around known problems with some RedHat cron daemons
29 signal
.signal(signal
.SIGCHLD
, signal
.SIG_DFL
)
34 parser
= optparse
.OptionParser(version
=MAILMAN_VERSION
,
36 %prog [options] [listname ...]
38 Increment the digest volume number and reset the digest number to one. All
39 the lists named on the command line are bumped. If no list names are given,
40 all lists are bumped."""))
41 parser
.add_option('-C', '--config',
42 help=_('Alternative configuration file to use'))
43 opts
, args
= parser
.parse_args()
44 return opts
, args
, parser
49 opts
, args
, parser
= parseargs()
50 config
.load(opts
.config
)
52 listnames
= set(args
or config
.list_manager
.names
)
54 print(_('Nothing to do.'))
57 for listname
in listnames
:
59 # Be sure the list is locked
60 mlist
= MailList
.MailList(listname
)
61 except errors
.MMListError
:
63 print(_('No such list: $listname'), file=sys
.stderr
)
66 mlist
.bump_digest_volume()
73 if __name__
== '__main__':