Önce index dosyasına bak yoksa uri'den almaya çalış.

add-repo sırasında şimdi update et demediyse, yalnızca
uri dosyası vardır.
Rebuild edilmeye çalışılan depo'unun dosyasına diskte
ya da nette ulaşamazsa da, uyar ve diğerleriyle devam
et.
This commit is contained in:
Faik Uygur
2006-04-20 08:26:27 +00:00
parent 69170901f3
commit 8ca28c819a
2 changed files with 12 additions and 4 deletions
+11 -3
View File
@@ -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.'))
+1 -1
View File
@@ -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: