From: "Devan Franchini" <twitch153@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/layman:gsoc2014 commit in: layman/
Date: Fri, 15 Aug 2014 22:32:35 +0000 (UTC) [thread overview]
Message-ID: <1408136258.89bf796adb52fac6c9472f5dc40bc137e4ab0d44.twitch153@gentoo> (raw)
commit: 89bf796adb52fac6c9472f5dc40bc137e4ab0d44
Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 10 20:26:45 2014 +0000
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Fri Aug 15 20:57:38 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=89bf796a
api.py: Adds disable and enable repo functions
X-Gentoo-Bug: 512316
X-Gentoo-Bug-URL: https://bugs.gentoo.org/512316
---
layman/api.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 52 insertions(+), 2 deletions(-)
diff --git a/layman/api.py b/layman/api.py
index 17c7998..bae6972 100755
--- a/layman/api.py
+++ b/layman/api.py
@@ -122,7 +122,7 @@ class LaymanAPI(object):
self._get_installed_db().select(ovl))
except Exception as e:
self._error(
- "Exception caught disabling repository '"+ovl+
+ "Exception caught removing repository '"+ovl+
"':\n"+str(e))
results.append(success)
self.get_installed(dbreload=True)
@@ -155,7 +155,7 @@ class LaymanAPI(object):
success = self._get_installed_db().add(
self._get_remote_db().select(ovl))
except Exception as e:
- self._error("Exception caught enabling repository '"+ovl+
+ self._error("Exception caught installing repository '"+ovl+
"' : "+str(e))
results.append(success)
self.get_installed(dbreload=True)
@@ -183,6 +183,56 @@ class LaymanAPI(object):
return success
+ def disable_repos(self, repos, update_news=False):
+ repos = self._check_repo_type(repos, "disable_repo")
+ results = []
+ for ovl in repos:
+ if not self.is_repo(ovl):
+ self.output.error(UnknownOverlayMessage(ovl))
+ result.append(False)
+ continue
+ success = False
+ try:
+ success = self._get_installed_db().disable(
+ self._get_installed_db().select(ovl))
+ except Exception as e:
+ self._error('Exception caught disabling repository "%(repo)s"'\
+ ': %(err)s' % ({'repo': ovl, 'err': e}))
+ results.append(success)
+ self.get_installed(dbreload=True)
+ if (True in results) and update_news:
+ self.update_news(repos)
+
+ if False in results:
+ return False
+ return True
+
+
+ def enable_repos(self, repos, update_news=False):
+ repos = self._check_repo_type(repos, "enable_repo")
+ results = []
+ for ovl in repos:
+ if not self.is_repo(ovl):
+ self.output.error(UnknownOverlayMessage(ovl))
+ result.append(False)
+ continue
+ success = False
+ try:
+ success = self._get_installed_db().enable(
+ self._get_installed_db().select(ovl))
+ except Exception as e:
+ self._error('Exception caught enabling repository "%(repo)s"'\
+ ': %(err)s' % ({'repo': ovl, 'err': e}))
+ results.append(success)
+ self.get_installed(dbreload=True)
+ if (True in results) and update_news:
+ self.update_news(repos)
+
+ if False in results:
+ return False
+ return True
+
+
def get_all_info(self, repos, local=False):
"""retrieves the recorded information about the repo(s)
specified by repo-id
next reply other threads:[~2014-08-15 22:32 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-15 22:32 Devan Franchini [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-08-15 23:59 [gentoo-commits] proj/layman:master commit in: layman/ Devan Franchini
2014-08-16 0:00 ` [gentoo-commits] proj/layman:gsoc2014 " Devan Franchini
2014-08-15 22:32 Devan Franchini
2014-08-15 22:32 Devan Franchini
2014-08-15 22:32 Devan Franchini
2014-06-27 4:07 Devan Franchini
2014-06-27 4:07 Devan Franchini
2014-06-27 4:07 Devan Franchini
2014-06-16 3:40 [gentoo-commits] proj/layman:master " Brian Dolbec
2014-06-16 3:37 ` [gentoo-commits] proj/layman:gsoc2014 " Brian Dolbec
2014-06-16 3:40 [gentoo-commits] proj/layman:master " Brian Dolbec
2014-06-16 3:37 ` [gentoo-commits] proj/layman:gsoc2014 " Brian Dolbec
2014-06-16 3:40 [gentoo-commits] proj/layman:master " Brian Dolbec
2014-06-16 3:37 ` [gentoo-commits] proj/layman:gsoc2014 " Brian Dolbec
2014-06-16 3:37 Brian Dolbec
2014-06-16 3:37 Brian Dolbec
2014-06-16 3:37 Brian Dolbec
2014-06-16 3:37 Brian Dolbec
2014-05-16 2:30 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 1:07 Devan Franchini
2014-05-16 0:58 Devan Franchini
2014-05-16 0:58 Devan Franchini
2014-05-16 0:57 Devan Franchini
2014-05-15 20:46 Devan Franchini
2014-05-15 20:46 Devan Franchini
2014-05-15 20:37 Devan Franchini
2014-05-15 20:30 Devan Franchini
2014-05-15 20:02 Devan Franchini
2014-05-15 0:04 Devan Franchini
2014-05-14 23:54 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 23:49 Devan Franchini
2014-05-14 22:16 Devan Franchini
2014-05-14 22:08 Devan Franchini
2014-05-14 21:42 Devan Franchini
2014-05-14 21:30 Devan Franchini
2014-05-14 21:15 Devan Franchini
2014-05-14 21:15 Devan Franchini
2014-05-14 19:29 Devan Franchini
2014-05-14 18:55 Devan Franchini
2014-05-14 18:44 Devan Franchini
2014-05-14 17:32 Devan Franchini
2014-05-14 3:21 Devan Franchini
2014-05-14 0:37 Devan Franchini
2014-05-07 22:21 Devan Franchini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408136258.89bf796adb52fac6c9472f5dc40bc137e4ab0d44.twitch153@gentoo \
--to=twitch153@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox