From b2f4591004a0f16a4c348123e999b0912745833e Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Mon, 8 Oct 2012 15:37:58 -0700 Subject: move the rename_db code to a standalone updater utility. --- layman/db.py | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'layman/db.py') diff --git a/layman/db.py b/layman/db.py index 354481c..e2d740c 100644 --- a/layman/db.py +++ b/layman/db.py @@ -61,9 +61,6 @@ class DB(DbBase): else: ignore = 1 - # check and handle the name change - #if not os.access(self.path, os.F_OK): - # self.rename_db() DbBase.__init__(self, config, @@ -73,28 +70,11 @@ class DB(DbBase): self.output.debug('DB handler initiated', 6) - - def rename_db(self): - """small upgrade function to handle the name change - for the installed xml file""" - if os.access(self.config['local_list'], os.F_OK): - self.output.info("Automatic db rename, old name was: %s" - % self.config['local_list'],2) - try: - os.rename(self.config['local_list'], self.path) - self.output.info("Automatic db rename, new installed db " - "name is: %s" %self.path, 2) - self.output.notice('') - return - except OSError, err: - self.output.error("Automatic db rename failed:\n%s" %str(err)) - else: - self.output.info("Automatic db rename, failed access to: %s" - % self.config['local_list'],2) - self.output.die("Please check that /etc/layman.cfg is up" - " to date\nThen try running layman again.\n" - "You may need to rename the old 'local_list' config setting" - " to\nthe new 'installed' config setting's filename.\n") + # check and handle the name change + if not os.access(self.config['installed'], os.F_OK) and \ + os.access(self.config['local_list'], os.F_OK): + self.output.die("Please run layman-updater, " + "then run layman again") # overrider -- cgit v1.2.3-1-g7c22