summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordol-sen <brian.dolbec@gmail.com>2011-07-12 12:01:43 -0700
committerdol-sen <brian.dolbec@gmail.com>2011-07-12 12:01:43 -0700
commit36b0e7f01af24ed622d7ebab1bda9ad00ab8dcfc (patch)
treec57081584095f603963ee6e3c29d0eb6ab3a418d
parentpre-release update (diff)
downloadlayman-36b0e7f01af24ed622d7ebab1bda9ad00ab8dcfc.tar.gz
layman-36b0e7f01af24ed622d7ebab1bda9ad00ab8dcfc.tar.bz2
layman-36b0e7f01af24ed622d7ebab1bda9ad00ab8dcfc.zip
fix an errant mistracking of the success of adding an overlay.
-rw-r--r--layman/api.py12
-rw-r--r--layman/db.py4
2 files changed, 8 insertions, 8 deletions
diff --git a/layman/api.py b/layman/api.py
index 8e54d7d..b494b58 100644
--- a/layman/api.py
+++ b/layman/api.py
@@ -115,9 +115,9 @@ class LaymanAPI(object):
results.append(False)
continue
try:
- self._get_installed_db().delete(
+ success = self._get_installed_db().delete(
self._get_installed_db().select(ovl))
- results.append(True)
+ results.append(success)
except Exception as e:
self._error(
"Failed to disable repository '"+ovl+"':\n"+str(e))
@@ -147,12 +147,10 @@ class LaymanAPI(object):
self._error(UnknownOverlayMessage(ovl))
results.append(False)
continue
- try:
- self._get_installed_db().add(self._get_remote_db().select(ovl), quiet=True)
- results.append(True)
- except Exception as e:
+ success = self._get_installed_db().add(self._get_remote_db().select(ovl), quiet=True)
+ results.append(success)
+ if not success:
self._error("Failed to enable repository '"+ovl+"' : "+str(e))
- results.append(False)
self.get_installed(dbreload=True)
if False in results:
return False
diff --git a/layman/db.py b/layman/db.py
index 3ed5cc6..b1df906 100644
--- a/layman/db.py
+++ b/layman/db.py
@@ -206,7 +206,9 @@ class DB(DbBase):
self.write(self.path)
make_conf.delete(overlay)
else:
- raise Exception('No local overlay named "' + overlay.name + '"!')
+ self.output.error('No local overlay named "' + overlay.name + '"!')
+ return False
+ return True
def sync(self, overlay_name, quiet = False):
'''Synchronize the given overlay.'''