Gentoo Archives: gentoo-dev

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-dev@l.g.o
Cc: mgorny@g.o, Sergei Trofimovich <slyfox@g.o>
Subject: [gentoo-dev] [PATCH] vcs-snapshot.eclass: set -o (--no-same-owner) when unpacking, bug #645182
Date: Sun, 21 Jan 2018 00:13:34
Message-Id: 20180121001304.26280-1-slyfox@gentoo.org
1 Fixes build failures in unprivileged containers like bug #645182:
2 Package: dev-python/pycparser-2.14
3 >>> Unpacking source...
4 tar: CHANGES: Cannot change ownership to uid 1000, gid 1000: Invalid argument
5
6 In such containers uid=0 can't really change file ownership.
7
8 Bug: https://bugs.gentoo.org/645182
9 Signed-off-by: Sergei Trofimovich <slyfox@g.o>
10 ---
11 eclass/vcs-snapshot.eclass | 3 ++-
12 1 file changed, 2 insertions(+), 1 deletion(-)
13
14 diff --git a/eclass/vcs-snapshot.eclass b/eclass/vcs-snapshot.eclass
15 index 3eff6995fae..2b3f73897ce 100644
16 --- a/eclass/vcs-snapshot.eclass
17 +++ b/eclass/vcs-snapshot.eclass
18 @@ -67,7 +67,8 @@ vcs-snapshot_src_unpack() {
19 # XXX: check whether the directory structure inside is
20 # fine? i.e. if the tarball has actually a parent dir.
21 mkdir "${destdir}" || die
22 - tar -C "${destdir}" -x --strip-components 1 \
23 + # -o (--no-same-owner) to avoid restoring original owner
24 + tar -C "${destdir}" -xo --strip-components 1 \
25 -f "${DISTDIR}/${f}" || die
26 ;;
27 *)
28 --
29 2.16.0

Replies