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): ...@@ -298,6 +298,7 @@ def index(dirs, output = 'pisi-index.xml', skip_sources=False):
if not dirs: if not dirs:
dirs = ['.'] dirs = ['.']
for repo_dir in dirs: for repo_dir in dirs:
repo_dir = str(repo_dir)
ctx.ui.info(_('* Building index of PISI files under %s') % repo_dir) ctx.ui.info(_('* Building index of PISI files under %s') % repo_dir)
index.index(repo_dir, skip_sources) index.index(repo_dir, skip_sources)
index.write(output, sha1sum=True, compress=File.xmill) index.write(output, sha1sum=True, compress=File.xmill)
......
...@@ -119,8 +119,9 @@ class File: ...@@ -119,8 +119,9 @@ class File:
else: else:
raise Error(_("Remote write not implemented")) raise Error(_("Remote write not implemented"))
else: else:
localfile = uri.get_uri() #TODO: use a special function here? localfile = uri.get_uri()
localfile = File.decompress(localfile, self.compress) if self.mode == File.read:
localfile = File.decompress(localfile, self.compress)
if self.mode == File.read: if self.mode == File.read:
access = 'r' access = 'r'
......
...@@ -98,7 +98,7 @@ class Index(XmlFile): ...@@ -98,7 +98,7 @@ class Index(XmlFile):
errs = md.errors() errs = md.errors()
if md.errors(): if md.errors():
ctx.ui.error(_('Package %s: metadata corrupt') % md.package.name) ctx.ui.error(_('Package %s: metadata corrupt') % md.package.name)
ctx.ui.error(str(Error(*errs))) ctx.ui.error(unicode(Error(*errs)))
else: else:
self.packages.append(md.package) 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