diff --git a/pisi/archive.py b/pisi/archive.py index bdf8a084..3ab8a928 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -72,9 +72,10 @@ class ArchiveTar(ArchiveBase): type. Provides access to tar, tar.gz and tar.bz2 files. This class provides the unpack magic for tar archives.""" - def __init__(self, file_path, arch_type = "tar"): + def __init__(self, file_path, arch_type = "tar", no_same_permissions = True): super(ArchiveTar, self).__init__(file_path, arch_type) self.tar = None + self.no_same_permissions = no_same_permissions def unpack(self, target_dir, clean_dir = False): """Unpack tar archive to a given target directory(target_dir).""" @@ -126,7 +127,10 @@ class ArchiveTar(ArchiveBase): # tarfile.extract does not honor umask. It must be honored explicitly. # see --no-same-permissions option of tar(1), which is the deafult # behaviour. - if not os.path.islink(tarinfo.name): + # + # Note: This is no good while installing a pisi package. Thats why + # this is optional. + if self.no_same_permissions and not os.path.islink(tarinfo.name): os.chmod(tarinfo.name, tarinfo.mode & ~ctx.const.umask) os.chdir(oldwd) diff --git a/pisi/package.py b/pisi/package.py index 455b970a..cdba08e8 100644 --- a/pisi/package.py +++ b/pisi/package.py @@ -91,7 +91,7 @@ class Package: def extract_install(self, outdir): if self.impl.has_file(ctx.const.install_tar_lzma): self.extract_file(ctx.const.install_tar_lzma, ctx.config.tmp_dir()) - tar = archive.ArchiveTar(join(ctx.config.tmp_dir(), ctx.const.install_tar_lzma), 'tarlzma') + tar = archive.ArchiveTar(join(ctx.config.tmp_dir(), ctx.const.install_tar_lzma), 'tarlzma', False) tar.unpack_dir(outdir) else: self.extract_dir_flat('install', outdir)