From 4df616e6c6c5d20fa783a22d1550455dd976d9f9 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 20 Jun 2015 04:59:57 +0300 Subject: [PATCH] Fix update repositories --- slpkg/init.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/slpkg/init.py b/slpkg/init.py index c6b0868c..e9bb86e6 100644 --- a/slpkg/init.py +++ b/slpkg/init.py @@ -649,19 +649,24 @@ class Update(object): """Update repositories lists """ print("\nCheck and update repositories:\n") - repositories = self.meta.repositories + enabled = self.meta.repositories if only: - repositories = only + self.meta.repositories = only try: - for repo in repositories: + for repo in self.meta.repositories: sys.stdout.write("{0}Update repository {1} ...{2}".format( self.meta.color["GREY"], repo, self.meta.color["ENDC"])) sys.stdout.flush() - if repo in self.meta.default_repositories: + if repo in enabled: exec("{0}.{1}()".format(self._init, repo)) sys.stdout.write(self.done) - elif repo in self.meta.repositories: - Initialization(False).custom(repo) + elif repo in self.meta.default_repositories: + try: + Initialization(False).custom(repo) + except: + sys.stdout.write(self.error) + print("") + sys.exit(0) sys.stdout.write(self.done) else: sys.stdout.write(self.error)