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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Michał Górny-5
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 <[hidden email]>
---
 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


Reply | Threaded
Open this post in threaded view
|

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

Ulrich Mueller-2
>>>>> 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 (497 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Michał Górny-5
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 (631 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Zac Medico-2
In reply to this post by Michał Górny-5
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 <[hidden email]>
> ---
>  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 (1000 bytes) Download Attachment