Ö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:
+11
-3
@@ -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
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user