~mailman-coders/mailman/2.1

« back to all changes in this revision

Viewing changes to bin/arch

  • Committer: Mark Sapiro
  • Date: 2008-10-17 22:33:48 UTC
  • Revision ID: mark@msapiro.net-20081017223348-md48uwmoldamwaue
Changed bin/arch to attempt to open the mbox before wiping the old archive.
Launchpad bug #280418.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! @PYTHON@
2
2
#
3
 
# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
 
3
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
4
4
#
5
5
# This program is free software; you can redistribute it and/or
6
6
# modify it under the terms of the GNU General Public License
161
161
        # set the lock lifetime to 3 hours.  XXX is this reasonable???
162
162
        lock = LockFile(lockfile, lifetime=3*60*60)
163
163
        lock.lock()
 
164
        # Try to open mbox before wiping old archive.
 
165
        try:
 
166
            fp = open(mbox)
 
167
        except IOError, msg:
 
168
            usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s'))
164
169
        # Maybe wipe the old archives
165
170
        if wipe:
166
171
            if mlist.scrub_nondigest:
177
182
            shutil.rmtree(mlist.archive_dir())
178
183
            if mlist.scrub_nondigest and saved:
179
184
                os.renames(savedir, atchdir)
180
 
        try:
181
 
            fp = open(mbox)
182
 
        except IOError, msg:
183
 
            usage(3, _('Cannot open mbox file %(mbox)s: %(msg)s'))
184
185
 
185
186
        archiver = HyperArchive(mlist)
186
187
        archiver.VERBOSE = verbose