From 8ca28c819aaf5f550f96e74f8f9cb0e216d78309 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 20 Apr 2006 08:26:27 +0000 Subject: [PATCH] =?UTF-8?q?=C3=96nce=20index=20dosyas=C4=B1na=20bak=20yoks?= =?UTF-8?q?a=20uri'den=20almaya=20=C3=A7al=C4=B1=C5=9F.=20add-repo=20s?= =?UTF-8?q?=C4=B1ras=C4=B1nda=20=C5=9Fimdi=20update=20et=20demediyse,=20ya?= =?UTF-8?q?ln=C4=B1zca=20uri=20dosyas=C4=B1=20vard=C4=B1r.=20Rebuild=20edi?= =?UTF-8?q?lmeye=20=C3=A7al=C4=B1=C5=9F=C4=B1lan=20depo'unun=20dosyas?= =?UTF-8?q?=C4=B1na=20diskte=20ya=20da=20nette=20ula=C5=9Famazsa=20da,=20u?= =?UTF-8?q?yar=20ve=20di=C4=9Ferleriyle=20devam=20et.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/api.py | 14 +++++++++++--- pisi/file.py | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index 29140ae2..583488df 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -372,11 +372,19 @@ def rebuild_repo(repo): if ctx.repodb.has_repo(repo): repouri = ctx.repodb.get_repo(repo).indexuri.get_uri() indexname = os.path.basename(repouri) - repouri = pisi.util.join_path(ctx.config.lib_dir(), 'index', repo, indexname) - index.read_uri(repouri, repo, force = True) + indexpath = pisi.util.join_path(ctx.config.lib_dir(), 'index', repo, indexname) + + if os.path.exists(indexpath): + repouri = indexpath + + try: + index.read_uri(repouri, repo, force = True) + except IOError: + ctx.ui.warning(_("Repo index file \'%s\' not found.") % repouri) + return else: raise Error(_('No repository named %s found.') % repo) - + ctx.txn_proc(lambda txn : index.update_db(repo, txn=txn)) ctx.ui.info(_('OK.')) diff --git a/pisi/file.py b/pisi/file.py index ac904c3e..56eb6ddc 100644 --- a/pisi/file.py +++ b/pisi/file.py @@ -110,7 +110,7 @@ class File: else: localfile = uri.get_uri() #TODO: use a special function here? if not os.path.exists(localfile): - raise Error(_("Localfile %s does not exist" % localfile)) + raise IOError(_("File '\%s'\ not found." % localfile)) if sha1sum: