changeset 2591:99d1516223f7

1.6 converter: move cache dir with locks where the framework still expects it
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 03 Aug 2007 00:36:34 +0200
parents 20638e764560
children a6216260f164
files MoinMoin/script/migration/1059999.py MoinMoin/script/migration/_conv160.py
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/migration/1059999.py	Thu Aug 02 22:24:28 2007 +0200
+++ b/MoinMoin/script/migration/1059999.py	Fri Aug 03 00:36:34 2007 +0200
@@ -26,6 +26,8 @@
     src_data_dir = os.path.abspath(os.path.join(data_dir, '..', 'data.pre160')) # keep the orig data_dir here
     dst_data_dir = data_dir
     shutil.move(data_dir, src_data_dir)
+    os.mkdir(dst_data_dir)
+    shutil.move(os.path.join(src_data_dir, 'cache'), os.path.join(dst_data_dir, 'cache')) # mig script has locks there
     dc = DataConverter(None, src_data_dir, dst_data_dir) # XXX TODO None -> script.request
     dc.pass2()
     return 1060000
--- a/MoinMoin/script/migration/_conv160.py	Thu Aug 02 22:24:28 2007 +0200
+++ b/MoinMoin/script/migration/_conv160.py	Fri Aug 03 00:36:34 2007 +0200
@@ -498,7 +498,10 @@
         self.eventlog.copy(opj(self.ddata, 'event-log'), self.renames)
 
     def init_dest(self):
-        os.makedirs(self.ddata)
+        try:
+            os.makedirs(self.ddata)
+        except:
+            pass
         os.makedirs(opj(self.ddata, 'pages'))
         os.makedirs(opj(self.ddata, 'user'))
         copy_dir(opj(self.sdata, 'plugin'), opj(self.ddata, 'plugin'))