fix: an uri is something like os.path but it's not that. We have a
cute little module called uri.py to use ;).
This commit is contained in:
+7
-5
@@ -385,17 +385,19 @@ def rebuild_repo(repo):
|
|||||||
|
|
||||||
index = Index()
|
index = Index()
|
||||||
if ctx.repodb.has_repo(repo):
|
if ctx.repodb.has_repo(repo):
|
||||||
repouri = ctx.repodb.get_repo(repo).indexuri.get_uri()
|
repouri = URI(ctx.repodb.get_repo(repo).indexuri.get_uri())
|
||||||
indexname = os.path.basename(repouri)
|
|
||||||
|
indexname = repouri.filename()
|
||||||
indexpath = pisi.util.join_path(ctx.config.lib_dir(), 'index', repo, indexname)
|
indexpath = pisi.util.join_path(ctx.config.lib_dir(), 'index', repo, indexname)
|
||||||
|
|
||||||
|
uri_str = repouri.get_uri()
|
||||||
if os.path.exists(indexpath):
|
if os.path.exists(indexpath):
|
||||||
repouri = indexpath
|
uri_str = indexpath
|
||||||
|
|
||||||
try:
|
try:
|
||||||
index.read_uri(repouri, repo, force = True)
|
index.read_uri(uri_str, repo, force = True)
|
||||||
except IOError:
|
except IOError:
|
||||||
ctx.ui.warning(_("Repo index file \'%s\' not found.") % repouri)
|
ctx.ui.warning(_("Repo index file \'%s\' not found.") % uri_str)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
raise Error(_('No repository named %s found.') % repo)
|
raise Error(_('No repository named %s found.') % repo)
|
||||||
|
|||||||
Reference in New Issue
Block a user