# This patch file, files created by its use and not subject to other copyright # and any changes in other files generated by its use are # Copyright (C) 2000-2003 by the Free Software Foundation, Inc. # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # This patch file is Free Software and permission is granted to copy and # redistribute it in original or modified form under the terms of the # GNU General Public License (GPL). # See the GPL COPYING files accompanying Mailman distributions this # patch was intended to work in conjunction with for further details. diff -r -u -P --exclude=.DS_Store mailman-2.1.3/Mailman/Archiver/HyperArch.py mailman-2.1.3-fixarchiver/Mailman/Archiver/HyperArch.py --- mailman-2.1.3/Mailman/Archiver/HyperArch.py Mon Sep 22 03:40:51 2003 +++ mailman-2.1.3-fixarchiver/Mailman/Archiver/HyperArch.py Mon Nov 3 15:36:26 2003 @@ -559,6 +559,12 @@ break self.body.append(line) + def finished_update_article(self): + self.body = [] + try: + delattr(self, 'html_body') + except AttributeError: + pass class HyperArchive(pipermail.T): diff -r -u -P --exclude=.DS_Store mailman-2.1.3/Mailman/Archiver/pipermail.py mailman-2.1.3-fixarchiver/Mailman/Archiver/pipermail.py --- mailman-2.1.3/Mailman/Archiver/pipermail.py Mon Sep 22 03:40:51 2003 +++ mailman-2.1.3-fixarchiver/Mailman/Archiver/pipermail.py Mon Nov 3 15:56:38 2003 @@ -126,9 +126,13 @@ """Store article without message body to save space""" # TBD this is not thread safe! temp = article.body + temp2 = article.html_body article.body = [] + del article.html_body self.articleIndex[article.msgid] = pickle.dumps(article) article.body = temp + article.html_body = temp2 + # The Article class encapsulates a single posting. The attributes # are: @@ -239,6 +243,9 @@ def __repr__(self): return '
' + def finished_update_article(self): + pass + # Pipermail formatter class class T: @@ -486,6 +493,8 @@ self.update_article(arcdir, a1, L[0], L[2]) else: del self.database.changed[key] + if L[0]: + L[0].finished_update_article() L = L[1:] # Rotate the list if msgid is None: L.append(msgid) diff -r -u -P --exclude=.DS_Store mailman-2.1.3/bin/Makefile.in mailman-2.1.3-fixarchiver/bin/Makefile.in --- mailman-2.1.3/bin/Makefile.in Mon Sep 22 03:29:50 2003 +++ mailman-2.1.3-fixarchiver/bin/Makefile.in Mon Nov 3 17:46:12 2003 @@ -43,7 +43,7 @@ SHELL= /bin/sh SCRIPTS= mmsitepass newlist rmlist add_members \ - list_members remove_members clone_member update arch \ + list_members remove_members clone_member update arch rb-archfix \ sync_members check_db withlist check_perms find_member \ version config_list list_lists dumpdb cleanarch \ list_admins genaliases change_pw mailmanctl qrunner inject \ diff -r -u -P --exclude=.DS_Store mailman-2.1.3/bin/rb-archfix mailman-2.1.3-fixarchiver/bin/rb-archfix --- mailman-2.1.3/bin/rb-archfix Thu Jan 1 01:00:00 1970 +++ mailman-2.1.3-fixarchiver/bin/rb-archfix Mon Nov 3 17:22:22 2003 @@ -0,0 +1,108 @@ +#! @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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +"""Richard Barrett's archive improver. +Only use this script if you have correctly installed the patch file +fixarchiver-2.1.3-0.1.patch that this file came with. Using this if you have +not installed the rest of the patch (including restarting mailmanctl) will ruin +your whole day. + +Usage: %(PROGRAM)s [options] file ... + +Where options are: + -h / --help + Print this help message and exit. + +Only use this to 'fix' archive -article database files that have been written +with Mailman 2.1.3 or earlier and have html_body attributes in them . These +attributes can cause huge amounts of memory bloat and impact performance for +high activity lists, particularly those having large text postings made to +them. Use like this from your $PREFIX directory: + + +%% ls -1 archives/private/*/database/*-article | xargs %(PROGRAM)s + +(note the backquotes are required) + +You will need to run `bin/check_perms -f' after running this script. + +You will probably want to delete the -article.bak files created by this script +when you are satisifed the upad +""" +# 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) + if hasattr(article, 'html_body'): + delattr(article, 'html_body') + 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 -r -u -P --exclude=.DS_Store mailman-2.1.3/configure mailman-2.1.3-fixarchiver/configure --- mailman-2.1.3/configure Mon Sep 22 03:54:26 2003 +++ mailman-2.1.3-fixarchiver/configure Mon Nov 3 17:29:45 2003 @@ -4070,6 +4070,7 @@ 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/contrib/check_perms_grsecurity.py:contrib/check_perms_grsecurity.py \ build/contrib/qmail-to-mailman.py:contrib/qmail-to-mailman.py \ build/contrib/rotatelogs.py:contrib/rotatelogs.py \ diff -r -u -P --exclude=.DS_Store mailman-2.1.3/configure.in mailman-2.1.3-fixarchiver/configure.in --- mailman-2.1.3/configure.in Mon Sep 22 03:54:26 2003 +++ mailman-2.1.3-fixarchiver/configure.in Mon Nov 3 17:34:27 2003 @@ -577,6 +577,7 @@ bin/version \ bin/withlist \ bin/b4b5-archfix \ +bin/rb-archfix \ contrib/check_perms_grsecurity.py \ contrib/qmail-to-mailman.py \ contrib/rotatelogs.py \