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: