public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources
@ 2021-07-17 19:59 Sergei Trofimovich
  2021-07-17 22:34 ` Zac Medico
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Trofimovich @ 2021-07-17 19:59 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Sergei Trofimovich

Initially problem is noticed on gcc-11 as a full ${WORKDIR} syncing
into /usr/src/debug. It happens because `debug.sources` sometimes
contains directory. For example on bash-5 it has:

    $ grep -zv '/<[^/>]*>$' debug.sources | LANG=C sort -z -u  | sed -e 's/\x00/\n/g'
    bash-5.0/
    bash-5.0/alias.c
    ...

This causes syncing object files, config.log, final binaries
and other unexpected data. The change avoids syncking paths
that end with '/'.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 bin/estrip | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/estrip b/bin/estrip
index 7ef1ec35c..6cca0d04b 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -464,7 +464,10 @@ if [[ -s ${tmpdir}/debug.sources ]] && \
 then
 	__vecho "installsources: rsyncing source files"
 	[[ -d ${D%/}/${prepstrip_sources_dir#/} ]] || mkdir -p "${D%/}/${prepstrip_sources_dir#/}"
+	# skip installation of ".../<foo>" (system headers? why inner slashes are forbidden?)
+	# skip syncing of ".../foo/" (complete directories)
 	grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
+	grep -zv '/$' | \
 		(cd "${WORKDIR}"; LANG=C sort -z -u | \
 		rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D%/}/${prepstrip_sources_dir#/}/" )
 
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources
  2021-07-17 19:59 [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources Sergei Trofimovich
@ 2021-07-17 22:34 ` Zac Medico
  2021-07-18 15:41   ` Sergei Trofimovich
  0 siblings, 1 reply; 3+ messages in thread
From: Zac Medico @ 2021-07-17 22:34 UTC (permalink / raw
  To: gentoo-portage-dev, Sergei Trofimovich


[-- Attachment #1.1: Type: text/plain, Size: 1604 bytes --]

On 7/17/21 12:59 PM, Sergei Trofimovich wrote:
> Initially problem is noticed on gcc-11 as a full ${WORKDIR} syncing
> into /usr/src/debug. It happens because `debug.sources` sometimes
> contains directory. For example on bash-5 it has:
> 
>     $ grep -zv '/<[^/>]*>$' debug.sources | LANG=C sort -z -u  | sed -e 's/\x00/\n/g'
>     bash-5.0/
>     bash-5.0/alias.c
>     ...
> 
> This causes syncing object files, config.log, final binaries
> and other unexpected data. The change avoids syncking paths
> that end with '/'.
> 
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> ---
>  bin/estrip | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/bin/estrip b/bin/estrip
> index 7ef1ec35c..6cca0d04b 100755
> --- a/bin/estrip
> +++ b/bin/estrip
> @@ -464,7 +464,10 @@ if [[ -s ${tmpdir}/debug.sources ]] && \
>  then
>  	__vecho "installsources: rsyncing source files"
>  	[[ -d ${D%/}/${prepstrip_sources_dir#/} ]] || mkdir -p "${D%/}/${prepstrip_sources_dir#/}"
> +	# skip installation of ".../<foo>" (system headers? why inner slashes are forbidden?)
> +	# skip syncing of ".../foo/" (complete directories)
>  	grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
> +	grep -zv '/$' | \
>  		(cd "${WORKDIR}"; LANG=C sort -z -u | \
>  		rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D%/}/${prepstrip_sources_dir#/}/" )
>  
> 

Looks good. Merged with both grep calls combined via grep -e. Thanks!

https://gitweb.gentoo.org/proj/portage.git/commit/?id=e083c8bf20d8488d329e3dccd643c28429e6fe30
-- 
Thanks,
Zac


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources
  2021-07-17 22:34 ` Zac Medico
@ 2021-07-18 15:41   ` Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2021-07-18 15:41 UTC (permalink / raw
  To: Zac Medico; +Cc: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

On Sat, 17 Jul 2021 15:34:12 -0700
Zac Medico <zmedico@gentoo.org> wrote:

> On 7/17/21 12:59 PM, Sergei Trofimovich wrote:
> > Initially problem is noticed on gcc-11 as a full ${WORKDIR} syncing
> > into /usr/src/debug. It happens because `debug.sources` sometimes
> > contains directory. For example on bash-5 it has:
> > 
> >     $ grep -zv '/<[^/>]*>$' debug.sources | LANG=C sort -z -u  | sed -e 's/\x00/\n/g'
> >     bash-5.0/
> >     bash-5.0/alias.c
> >     ...
> > 
> > This causes syncing object files, config.log, final binaries
> > and other unexpected data. The change avoids syncking paths
> > that end with '/'.
> > 
> > Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
> > ---
> >  bin/estrip | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/bin/estrip b/bin/estrip
> > index 7ef1ec35c..6cca0d04b 100755
> > --- a/bin/estrip
> > +++ b/bin/estrip
> > @@ -464,7 +464,10 @@ if [[ -s ${tmpdir}/debug.sources ]] && \
> >  then
> >  	__vecho "installsources: rsyncing source files"
> >  	[[ -d ${D%/}/${prepstrip_sources_dir#/} ]] || mkdir -p "${D%/}/${prepstrip_sources_dir#/}"
> > +	# skip installation of ".../<foo>" (system headers? why inner slashes are forbidden?)
> > +	# skip syncing of ".../foo/" (complete directories)
> >  	grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
> > +	grep -zv '/$' | \
> >  		(cd "${WORKDIR}"; LANG=C sort -z -u | \
> >  		rsync -tL0 --chmod=ugo-st,a+r,go-w,Da+x,Fa-x --files-from=- "${WORKDIR}/" "${D%/}/${prepstrip_sources_dir#/}/" )
> >  
> >   
> 
> Looks good. Merged with both grep calls combined via grep -e. Thanks!
> 
> https://gitweb.gentoo.org/proj/portage.git/commit/?id=e083c8bf20d8488d329e3dccd643c28429e6fe30

TIL 'grep -e'! Thank you!

-- 

  Sergei

[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-18 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-17 19:59 [gentoo-portage-dev] [PATCH] bin/estrip: avoid copying directories in FEATURES=installsources Sergei Trofimovich
2021-07-17 22:34 ` Zac Medico
2021-07-18 15:41   ` Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox