提交 d5df2f3a 编写于 作者: R Rudá Moura 提交者: Ruda Moura

avocado.utils.archive: preserve permissions. when extracting.

Preserve file permissions when extracting data from tarballs,
so in some tests we have we don't need to set permissions too.
Signed-off-by: NRuda Moura <rmoura@redhat.com>
上级 86dcba4f
......@@ -184,6 +184,8 @@ class TarArchive(BaseArchive):
with open(filename, 'wb') as outfile:
if extracted is not None:
shutil.copyfileobj(extracted, outfile)
if not member.issym():
os.chmod(filename, member.mode)
else:
log.error("Member correspondent to file %s does "
"not seem to be a regular file or a link",
......
......@@ -42,13 +42,10 @@ class fiotest(test.Test):
"""
Build 'fio'.
"""
self.cwd = os.getcwd()
tarball_path = self.get_deps_path(self.params.fio_tarball)
archive.extract(tarball_path, self.srcdir)
fio_version = self.params.fio_tarball.split('.tar.')[0]
self.srcdir = os.path.join(self.srcdir, fio_version)
cmd = ('chmod +x %s' % os.path.join(self.srcdir, 'configure'))
process.system(cmd)
build.make(self.srcdir)
def action(self):
......@@ -58,7 +55,6 @@ class fiotest(test.Test):
os.chdir(self.srcdir)
cmd = ('./fio %s' % self.get_deps_path(self.params.fio_job))
process.system(cmd)
os.chdir(self.cwd)
if __name__ == "__main__":
......
......@@ -64,7 +64,6 @@ class trinity(test.Test):
archive.extract(tarball_path, self.srcdir)
self.srcdir = os.path.join(self.srcdir, 'trinity-1.4')
os.chdir(self.srcdir)
process.run('chmod +x configure.sh')
process.run('./configure.sh')
build.make(self.srcdir)
self.populate_dir()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册