# Copyright (C) 2016 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. """Tweak the data_version attribute of a list or all lists to force an update. Sometimes a site applies a patch to Mailman which adds and then uses new list attributes, but because the patch might be against an older release, it may not cause version updating to be done on existing lists. If that happens, this script will force version updating to be done for the list(s) it is run against. Save as bin/fix_data_version.py Run via bin/withlist -r fix_data_version to do the list or bin/withlist -a -r fix_data_version to do all lists. """ def fix_data_version(mlist): if not mlist.Locked(): mlist.Lock() # Decrement the list's data_version and Save and Load the list to # force an update. mlist.data_version -= 1 mlist.Save() mlist.Load() mlist.Unlock()