Re: [gentoo-portage-dev] [PATCH] make.globals: Change FETCHCOMMAND_RSYNC to --copy-links

2019-10-21 Thread Zac Medico
On 10/21/19 8:06 AM, Michał Górny wrote:
> Change FETCHCOMMAND_RSYNC to use '-Lt' over '-a'.  Notably, this
> replaces --links with --copy-links option, i.e. makes rsync copy
> underlying files when symlinks are met.  This is important since
> we do not transfer symlink targets, therefore '-l' ends up creating
> dangling symlinks.
> 
> This also removes most of the other options that are irrelevant or even
> undesirable to distfile fetching, that is:
> 
> - '-r' since we always fetch a single file, so recursive operation is
>   unnecessary
> - '-p', '-o', '-g' since we want to apply our permissions and ownership
>   for distfiles rather than copying the one from mirrors,
> - '-D' since we do not expect any devices or specials in distfiles.
> 
> Copying timestamps is preserved in case it's helpful in determining
> whether files need to be refetched.
> 
> Bug: https://bugs.gentoo.org/698046
> Signed-off-by: Michał Górny 
> ---
>  cnf/make.globals | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/cnf/make.globals b/cnf/make.globals
> index 9eeb7a01e..50511e812 100644
> --- a/cnf/make.globals
> +++ b/cnf/make.globals
> @@ -38,8 +38,8 @@ PORTAGE_TMPDIR="/var/tmp"
>  FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" 
> \"\${URI}\""
>  RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" 
> \"\${URI}\""
>  
> -FETCHCOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
> -RESUMECOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
> +FETCHCOMMAND_RSYNC="rsync -LtvP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
> +RESUMECOMMAND_RSYNC="rsync -LtvP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
>  
>  # NOTE: rsync will evaluate quotes embedded inside PORTAGE_SSH_OPTS
>  FETCHCOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; 
> port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && 
> port= ; exec rsync --rsh=\\\"ssh \\\${port:+-p\\\${port}} \\\${3}\\\" -avP 
> \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" 
> \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\""
> 

Looks good. Please merge.
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] [PATCH] make.globals: Change FETCHCOMMAND_RSYNC to --copy-links

2019-10-21 Thread Michał Górny
On Mon, 2019-10-21 at 17:25 +0200, Ulrich Mueller wrote:
> > > > > > On Mon, 21 Oct 2019, Michał Górny wrote:
> > This also removes most of the other options that are irrelevant or even
> > undesirable to distfile fetching, that is:
> > - '-r' since we always fetch a single file, so recursive operation is
> >   unnecessary
> > - '-p', '-o', '-g' since we want to apply our permissions and ownership
> >   for distfiles rather than copying the one from mirrors,
> > - '-D' since we do not expect any devices or specials in distfiles.
> 
> That certainly makes sense, but I don't see it in the actual patch?

Those were the options implied by '-a'.

-- 
Best regards,
Michał Górny



signature.asc
Description: This is a digitally signed message part


Re: [gentoo-portage-dev] [PATCH] make.globals: Change FETCHCOMMAND_RSYNC to --copy-links

2019-10-21 Thread Ulrich Mueller
> On Mon, 21 Oct 2019, Michał Górny wrote:

> This also removes most of the other options that are irrelevant or even
> undesirable to distfile fetching, that is:

> - '-r' since we always fetch a single file, so recursive operation is
>   unnecessary
> - '-p', '-o', '-g' since we want to apply our permissions and ownership
>   for distfiles rather than copying the one from mirrors,
> - '-D' since we do not expect any devices or specials in distfiles.

That certainly makes sense, but I don't see it in the actual patch?


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] make.globals: Change FETCHCOMMAND_RSYNC to --copy-links

2019-10-21 Thread Michał Górny
Change FETCHCOMMAND_RSYNC to use '-Lt' over '-a'.  Notably, this
replaces --links with --copy-links option, i.e. makes rsync copy
underlying files when symlinks are met.  This is important since
we do not transfer symlink targets, therefore '-l' ends up creating
dangling symlinks.

This also removes most of the other options that are irrelevant or even
undesirable to distfile fetching, that is:

- '-r' since we always fetch a single file, so recursive operation is
  unnecessary
- '-p', '-o', '-g' since we want to apply our permissions and ownership
  for distfiles rather than copying the one from mirrors,
- '-D' since we do not expect any devices or specials in distfiles.

Copying timestamps is preserved in case it's helpful in determining
whether files need to be refetched.

Bug: https://bugs.gentoo.org/698046
Signed-off-by: Michał Górny 
---
 cnf/make.globals | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cnf/make.globals b/cnf/make.globals
index 9eeb7a01e..50511e812 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -38,8 +38,8 @@ PORTAGE_TMPDIR="/var/tmp"
 FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" 
\"\${URI}\""
 RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" 
\"\${URI}\""
 
-FETCHCOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
-RESUMECOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
+FETCHCOMMAND_RSYNC="rsync -LtvP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
+RESUMECOMMAND_RSYNC="rsync -LtvP \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
 
 # NOTE: rsync will evaluate quotes embedded inside PORTAGE_SSH_OPTS
 FETCHCOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; 
port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && 
port= ; exec rsync --rsh=\\\"ssh \\\${port:+-p\\\${port}} \\\${3}\\\" -avP 
\\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" 
\"\${URI}\" \"\${PORTAGE_SSH_OPTS}\""
-- 
2.23.0