diff options
author | 2015-08-03 21:02:38 -0400 | |
---|---|---|
committer | 2015-08-03 21:02:38 -0400 | |
commit | d95ae901856d94b2f7693b58aaa5618582c17280 (patch) | |
tree | ce301d7a7c5e031f7edbe0b54db33693e3f23c83 /layman | |
parent | setup.py: Fixes sqlite_db module name (diff) | |
download | layman-d95ae901856d94b2f7693b58aaa5618582c17280.tar.gz layman-d95ae901856d94b2f7693b58aaa5618582c17280.tar.bz2 layman-d95ae901856d94b2f7693b58aaa5618582c17280.zip |
update.py: Adds functionality to ensure proper sqlite migration
Diffstat (limited to 'layman')
-rw-r--r-- | layman/updater.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/layman/updater.py b/layman/updater.py index 746373d..25abf72 100644 --- a/layman/updater.py +++ b/layman/updater.py @@ -140,7 +140,10 @@ class Main(object): self.output.info(msg) try: - shutil.copy(installed, backup_name) + if migrate_type in ('json', 'xml'): + shutil.copy(installed, backup_name) + else: + shutil.move(installed, backup_name) except IOError as err: msg = ' migrate_database() error; failed to back up old database '\ 'file.\n Error was: %(err)s' % {'err': err} |