svn: r7699
This commit is contained in:
Alex Roitman 2006-11-26 04:26:06 +00:00
parent 47fe5af7c2
commit 8c32eaea35

View File

@ -356,11 +356,14 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
env_name = os.path.join(os.path.expanduser(const.env_dir),
self.full_name[1:])
# Copy the old common environment dir to the new env
# if it does not exist yet
# Create the env dir
if not os.path.isdir(env_name):
os.makedirs(env_name)
# If this is not a new db, see about copying old env dir
if os.path.isfile(self.full_name):
common_env_name = os.path.expanduser(const.bsddbenv_dir)
# 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)