------------------------------------------------------------
revno: 1273
committer: Mark Sapiro <[email protected]>
branch nick: 2.1
timestamp: Thu 2011-01-13 18:06:17 -0800
message:
   - Changed bin/rmlist to also remove heldmsg files for the removed list and
     fixed a problem with removal of stale locks for the list.  Bug #700528.
modified:
  NEWS
  bin/rmlist


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'NEWS'
--- NEWS	2011-01-14 01:00:40 +0000
+++ NEWS	2011-01-14 02:06:17 +0000
@@ -13,6 +13,9 @@
 
   Bug Fixes and other patches
 
+    - Changed bin/rmlist to also remove heldmsg files for the removed list and
+      fixed a problem with removal of stale locks for the list.  Bug #700528.
+
     - Fixed a bug where content filtering could leave a multipart message or
       part with just one sub-part. These should be recast to just the sub-part.
       Bug #701558.

=== modified file 'bin/rmlist'
--- bin/rmlist	2005-08-27 01:40:17 +0000
+++ bin/rmlist	2011-01-14 02:06:17 +0000
@@ -1,6 +1,6 @@
 #! @PYTHON@
 #
-# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2011 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
@@ -37,6 +37,7 @@
 """
 
 import os
+import re
 import sys
 import getopt
 import shutil
@@ -121,7 +122,7 @@
             sys.modules[modname].remove(mlist)
 
         REMOVABLES = [
-            (os.path.join('lists', listname), _('list info')),
+            (os.path.join(mm_cfg.LIST_DATA_DIR, listname), _('list info')),
             ]
 
     # Remove any stale locks associated with the list
@@ -131,20 +132,27 @@
             REMOVABLES.append((os.path.join(mm_cfg.LOCK_DIR, filename),
                                _('stale lock file')))
 
+    # Remove any held messages for this list
+    for filename in os.listdir(mm_cfg.DATA_DIR):
+        cre = re.compile('^heldmsg-%s-\d+\.(pck|txt)$' % listname,
+                         re.IGNORECASE)
+        if cre.match(filename):
+            REMOVABLES.append((os.path.join(mm_cfg.DATA_DIR, filename),
+                               _('held message file')))
+
     if removeArchives:
         REMOVABLES.extend([
-            (os.path.join('archives', 'private', listname),
-             _('private archives')),
-            (os.path.join('archives', 'private', listname + '.mbox'),
-             _('private archives')),
-            (os.path.join('archives', 'public', listname),
+            (os.path.join(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, listname),
+             _('private archives')),
+            (os.path.join(mm_cfg.PRIVATE_ARCHIVE_FILE_DIR, listname + '.mbox'),
+             _('private archives')),
+            (os.path.join(mm_cfg.PUBLIC_ARCHIVE_FILE_DIR, listname),
              _('public archives')),
-            (os.path.join('archives', 'public', listname + '.mbox'),
+            (os.path.join(mm_cfg.PUBLIC_ARCHIVE_FILE_DIR, listname + '.mbox'),
              _('public archives')),
             ])
 
-    for dirtmpl, msg in REMOVABLES:
-        dir = os.path.join(mm_cfg.VAR_PREFIX, dirtmpl)
+    for dir, msg in REMOVABLES:
         remove_it(listname, dir, msg)
 
 

_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to