Fix update repositories

This commit is contained in:
Dimitris Zlatanidis 2015-06-20 04:59:57 +03:00
parent e8b7af1ade
commit 4df616e6c6

View file

@ -649,19 +649,24 @@ class Update(object):
"""Update repositories lists """Update repositories lists
""" """
print("\nCheck and update repositories:\n") print("\nCheck and update repositories:\n")
repositories = self.meta.repositories enabled = self.meta.repositories
if only: if only:
repositories = only self.meta.repositories = only
try: try:
for repo in repositories: for repo in self.meta.repositories:
sys.stdout.write("{0}Update repository {1} ...{2}".format( sys.stdout.write("{0}Update repository {1} ...{2}".format(
self.meta.color["GREY"], repo, self.meta.color["ENDC"])) self.meta.color["GREY"], repo, self.meta.color["ENDC"]))
sys.stdout.flush() sys.stdout.flush()
if repo in self.meta.default_repositories: if repo in enabled:
exec("{0}.{1}()".format(self._init, repo)) exec("{0}.{1}()".format(self._init, repo))
sys.stdout.write(self.done) sys.stdout.write(self.done)
elif repo in self.meta.repositories: elif repo in self.meta.default_repositories:
Initialization(False).custom(repo) try:
Initialization(False).custom(repo)
except:
sys.stdout.write(self.error)
print("")
sys.exit(0)
sys.stdout.write(self.done) sys.stdout.write(self.done)
else: else:
sys.stdout.write(self.error) sys.stdout.write(self.error)