Commit ec9b613d authored by Romain Courteaud's avatar Romain Courteaud

Local directory Extensions should be handle like Document, Propertysheet and

Constraint (as it can be modified by portal_classes).
Clean local directories when using option --save, to prevent using old files.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23751 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6171a8a9
...@@ -764,7 +764,7 @@ class ERP5TypeTestCase(PortalTestCase): ...@@ -764,7 +764,7 @@ class ERP5TypeTestCase(PortalTestCase):
ZopeTestCase._print('done\n') ZopeTestCase._print('done\n')
if not quiet: if not quiet:
ZopeTestCase._print('Dumping static files... ') ZopeTestCase._print('Dumping static files... ')
for dir in ('Constraint', 'Document', 'PropertySheet'): for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'):
os.system('rm -rf %s/%s.bak' % (instance_home, dir)) os.system('rm -rf %s/%s.bak' % (instance_home, dir))
os.system('cp -ar %s/%s %s/%s.bak' % (instance_home, dir, instance_home, dir)) os.system('cp -ar %s/%s %s/%s.bak' % (instance_home, dir, instance_home, dir))
if not quiet: if not quiet:
......
...@@ -17,12 +17,16 @@ if os.environ.get('erp5_load_data_fs'): ...@@ -17,12 +17,16 @@ if os.environ.get('erp5_load_data_fs'):
assert os.system("mysql %s < %s/dump.sql" % ( assert os.system("mysql %s < %s/dump.sql" % (
getMySQLArguments(), instance_home)) == 0 getMySQLArguments(), instance_home)) == 0
print("Restoring static files ... ") print("Restoring static files ... ")
for dir in ('Constraint', 'Document', 'PropertySheet'): for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'):
if os.path.exists('%s/%s.bak' % (instance_home, dir)): if os.path.exists('%s/%s.bak' % (instance_home, dir)):
assert os.system('rm -rf %s/%s' % (instance_home, dir)) == 0 assert os.system('rm -rf %s/%s' % (instance_home, dir)) == 0
assert os.system('cp -ar %s/%s.bak %s/%s' % ( assert os.system('cp -ar %s/%s.bak %s/%s' % (
instance_home, dir, instance_home, dir)) == 0 instance_home, dir, instance_home, dir)) == 0
elif os.environ.get('erp5_save_data_fs'): elif os.environ.get('erp5_save_data_fs'):
print("Cleaning static files ... ")
for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'):
if os.path.exists('%s/%s' % (instance_home, dir)):
assert os.system('rm -f %s/%s/*' % (instance_home, dir)) == 0
if os.path.exists(new_data_fs_path): if os.path.exists(new_data_fs_path):
os.remove(new_data_fs_path) os.remove(new_data_fs_path)
Storage = FileStorage(new_data_fs_path) Storage = FileStorage(new_data_fs_path)
......
...@@ -77,11 +77,11 @@ def initializeInstanceHome(tests_framework_home, ...@@ -77,11 +77,11 @@ def initializeInstanceHome(tests_framework_home,
instance_home): instance_home):
if not os.path.exists(instance_home): if not os.path.exists(instance_home):
os.mkdir(instance_home) os.mkdir(instance_home)
for d in ('Constraint', 'Document', 'PropertySheet', 'bin', 'etc', 'tests', 'var', 'log'): for d in ('Extensions', 'Constraint', 'Document', 'PropertySheet', 'bin', 'etc', 'tests', 'var', 'log'):
path = os.path.join(instance_home, d) path = os.path.join(instance_home, d)
if not os.path.exists(path): if not os.path.exists(path):
os.mkdir(path) os.mkdir(path)
for d in ('Extensions', 'Products', 'bt5', 'svn', 'lib'): for d in ('Products', 'bt5', 'svn', 'lib'):
src = os.path.join(real_instance_home, d) src = os.path.join(real_instance_home, d)
dst = os.path.join(instance_home, d) dst = os.path.join(instance_home, d)
if not os.path.exists(dst): if not os.path.exists(dst):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment