Gentoo Archives: gentoo-portage-dev

From: Sergei Trofimovich <slyfox@g.o>
To: Zac Medico <zmedico@g.o>
Cc: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources
Date: Sun, 18 Jul 2021 15:41:56
Message-Id: 20210718164145.68da7d49@zn3
In Reply to: Re: [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources by Zac Medico
1 On Sat, 17 Jul 2021 15:34:12 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > On 7/17/21 12:59 PM, Sergei Trofimovich wrote:
5 > > Initially problem is noticed on gcc-11 as a full ${WORKDIR} syncing
6 > > into /usr/src/debug. It happens because `debug.sources` sometimes
7 > > contains directory. For example on bash-5 it has:
8 > >
9 > > $ grep -zv '/<[^/>]*>$' debug.sources | LANG=C sort -z -u | sed -e 's/\x00/\n/g'
10 > > bash-5.0/
11 > > bash-5.0/alias.c
12 > > ...
13 > >
14 > > This causes syncing object files, config.log, final binaries
15 > > and other unexpected data. The change avoids syncking paths
16 > > that end with '/'.
17 > >
18 > > Signed-off-by: Sergei Trofimovich <slyfox@g.o>
19 > > ---
20 > > bin/estrip | 3 +++
21 > > 1 file changed, 3 insertions(+)
22 > >
23 > > diff --git a/bin/estrip b/bin/estrip
24 > > index 7ef1ec35c..6cca0d04b 100755
25 > > --- a/bin/estrip
26 > > +++ b/bin/estrip
27 > > @@ -464,7 +464,10 @@ if [[ -s ${tmpdir}/debug.sources ]] && \
28 > > then
29 > > __vecho "installsources: rsyncing source files"
30 > > [[ -d ${D%/}/${prepstrip_sources_dir#/} ]] || mkdir -p "${D%/}/${prepstrip_sources_dir#/}"
31 > > + # skip installation of ".../<foo>" (system headers? why inner slashes are forbidden?)
32 > > + # skip syncing of ".../foo/" (complete directories)
33 > > grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
34 > > + grep -zv '/$' | \
35 > > (cd "${WORKDIR}"; LANG=C sort -z -u | \
36 > > rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D%/}/${prepstrip_sources_dir#/}/" )
37 > >
38 > >
39 >
40 > Looks good. Merged with both grep calls combined via grep -e. Thanks!
41 >
42 > https://gitweb.gentoo.org/proj/portage.git/commit/?id=e083c8bf20d8488d329e3dccd643c28429e6fe30
43
44 TIL 'grep -e'! Thank you!
45
46 --
47
48 Sergei