Update
svn: r7699
This commit is contained in:
parent
7e0a28b827
commit
e2a6b4085a
@ -356,14 +356,17 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
|
|||||||
env_name = os.path.join(os.path.expanduser(const.env_dir),
|
env_name = os.path.join(os.path.expanduser(const.env_dir),
|
||||||
self.full_name[1:])
|
self.full_name[1:])
|
||||||
|
|
||||||
# Copy the old common environment dir to the new env
|
# Create the env dir
|
||||||
# if it does not exist yet
|
|
||||||
if not os.path.isdir(env_name):
|
if not os.path.isdir(env_name):
|
||||||
os.makedirs(env_name)
|
os.makedirs(env_name)
|
||||||
common_env_name = os.path.expanduser(const.bsddbenv_dir)
|
# If this is not a new db, see about copying old env dir
|
||||||
if os.path.isdir(common_env_name):
|
if os.path.isfile(self.full_name):
|
||||||
shutil.rmtree(env_name)
|
common_env_name = os.path.expanduser(const.bsddbenv_dir)
|
||||||
shutil.copytree(common_env_name,env_name)
|
# Copy the old env dir contents into the new one
|
||||||
|
# ONLY if the old env dir exists
|
||||||
|
if os.path.isdir(common_env_name):
|
||||||
|
shutil.rmtree(env_name)
|
||||||
|
shutil.copytree(common_env_name,env_name)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
env_flags = db.DB_CREATE|db.DB_PRIVATE|db.DB_INIT_MPOOL
|
env_flags = db.DB_CREATE|db.DB_PRIVATE|db.DB_INIT_MPOOL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user