Kaydet (Commit) 8f76f711 authored tarafından Eray Özkural's avatar Eray Özkural

* fix: decompress local file in read mode

üst 31a70530
......@@ -298,6 +298,7 @@ def index(dirs, output = 'pisi-index.xml', skip_sources=False):
if not dirs:
dirs = ['.']
for repo_dir in dirs:
repo_dir = str(repo_dir)
ctx.ui.info(_('* Building index of PISI files under %s') % repo_dir)
index.index(repo_dir, skip_sources)
index.write(output, sha1sum=True, compress=File.xmill)
......
......@@ -119,8 +119,9 @@ class File:
else:
raise Error(_("Remote write not implemented"))
else:
localfile = uri.get_uri() #TODO: use a special function here?
localfile = File.decompress(localfile, self.compress)
localfile = uri.get_uri()
if self.mode == File.read:
localfile = File.decompress(localfile, self.compress)
if self.mode == File.read:
access = 'r'
......
......@@ -98,7 +98,7 @@ class Index(XmlFile):
errs = md.errors()
if md.errors():
ctx.ui.error(_('Package %s: metadata corrupt') % md.package.name)
ctx.ui.error(str(Error(*errs)))
ctx.ui.error(unicode(Error(*errs)))
else:
self.packages.append(md.package)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment