summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorcotton1998-11-05 19:58:02 +0000
committercotton1998-11-05 19:58:02 +0000
commit74691a3fa960c26dbff6756cc6aa2bf9012f0716 (patch)
tree0a6b0f2784b3386018151bcb2fa4dc185a352a6d /bin
parentc96fba24dbc5b7c199d5cd6b15103fe629f17387 (diff)
downloadmailman-74691a3fa960c26dbff6756cc6aa2bf9012f0716.tar.gz
mailman-74691a3fa960c26dbff6756cc6aa2bf9012f0716.tar.zst
mailman-74691a3fa960c26dbff6756cc6aa2bf9012f0716.zip
made it so that
1) it could be run more than once. 2) it handles files which may be around for some reason but which weren't put there by a previous mailman installation. scott
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update44
1 files changed, 36 insertions, 8 deletions
diff --git a/bin/update b/bin/update
index 3438d8ae7..7dda213ef 100755
--- a/bin/update
+++ b/bin/update
@@ -46,7 +46,7 @@ def dolist(list):
# Move any existing mboxes around, but watch out for both a public and a
# private one existing
if os.path.isfile(o_pri_mbox_file) and os.path.isfile(o_pub_mbox_file):
- if list.archive_private:
+ if l.archive_private:
print """\
%s has both public and private mbox archives, since this list
currently uses private archiving, I'm installing the private mbox
@@ -57,7 +57,7 @@ to
You can integrate that into the archives if you want by using the 'arch'
script.
-""" % (list._internal_name, o_pri_mbox_file, o_pub_mbox_file, o_pub_mbox_file)
+""" % (l._internal_name, o_pri_mbox_file, o_pub_mbox_file, o_pub_mbox_file)
os.rename(o_pub_mbox_file, "%s.preb6" % (o_pub_mbox_file))
else:
print """\
@@ -70,19 +70,47 @@ archive file (%s) as the active one, and renaming
You can integrate that into the archives if you want by using the 'arch'
script.
-""" % (list._internal_name, o_pub_mbox_file, o_pri_mbox_file, o_pri_mbox_file)
+""" % (l._internal_name, o_pub_mbox_file, o_pri_mbox_file, o_pri_mbox_file)
os.rename(o_pri_mbox_file, "%s.preb6" % (o_pri_mbox_file))
#
# move private archive mbox there if it's around
- # (don't rename it if it's a dir because then it's from
- # a very recent cvs tree and is already set up right.)
- if os.path.isfile(o_pri_mbox_file):
- os.rename(o_pri_mbox_file, mbox_file)
+ # and take into account all sorts of absurdities
+ #
+ if os.path.exists(o_pri_mbox_file):
+ if os.path.isfile(o_pri_mbox_file):
+ os.rename(o_pri_mbox_file, mbox_file)
+ elif not os.path.isdir(o_pri_mbox_file):
+ newname = "%s.mm_install-dunno_what_this_was_but_it_was_in_the_way" % \
+ o_pri_mbox_file
+ os.rename(o_pri_mbox_file, newname)
+ print "unknown file in the way, moving"
+ print "\t" + o_pri_mbox_file
+ print "to"
+ print "\t" + newname
+ else: # directory
+ print "looks like you have a really recent CVS isntallation..."
+ print "you're either one brave soul, or you already ran me"
+
+
#
# move public archive mbox there if it's around
+ # and take into account all sorts of absurdities.
#
if os.path.exists(o_pub_mbox_file):
- os.rename(o_pub_mbox_file, mbox_file)
+ if os.path.isfile(o_pub_mbox_file):
+ os.rename(o_pub_mbox_file, mbox_file)
+ elif not os.path.isdir(o_pub_mbox_file):
+ newname = "%s.mm_install-dunno_what_this_was_but_it_was_in_the_way" % \
+ o_pub_mbox_file
+ os.rename(o_pub_mbox_file, newname)
+ print "unknown file in the way, moving"
+ print "\t" + o_pub_mbox_file
+ print "to"
+ print "\t" + newname
+ else: # directory
+ print "looks like you have a really recent CVS isntallation..."
+ print "you're either one brave soul, or you already ran me"
+
#
# move the html archives there
#