vcs-snapshot.eclass: set -o (--no-same-owner) when unpacking, bug #645182
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 21 Jan 2018 00:01:59 +0000 (00:01 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 17 Mar 2018 23:18:35 +0000 (23:18 +0000)
Fixes build failures in unprivileged containers like bug #645182:
  Package:    dev-python/pycparser-2.14
  >>> Unpacking source...
  tar: CHANGES: Cannot change ownership to uid 1000, gid 1000: Invalid argument

In such containers uid=0 can't really change file ownership.

Closes: https://bugs.gentoo.org/645182
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/vcs-snapshot.eclass

index 3eff6995fae7b21d4bbf99d3f24bda0c495c3cd8..243d4a8a31855e3fadad111148187c812dfefc9e 100644 (file)
@@ -67,7 +67,8 @@ vcs-snapshot_src_unpack() {
                                # XXX: check whether the directory structure inside is
                                # fine? i.e. if the tarball has actually a parent dir.
                                mkdir "${destdir}" || die
-                               tar -C "${destdir}" -x --strip-components 1 \
+                               # -o (--no-same-owner) to avoid restoring original owner
+                               tar -C "${destdir}" -x -o --strip-components 1 \
                                        -f "${DISTDIR}/${f}" || die
                                ;;
                        *)