Subject: Re: [bug#35282] [PATCH] gnu: docker: Patch paths of xz and docker-proxy.

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 15 Apr 2019 15:05:53 -0400

Hello Danny!

Danny Milosavljevic <[email-masked]> writes:

>>diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm
>>index 10aa3aa5b4..6e598e4d18 100644
>>--- a/gnu/packages/docker.scm
>>+++ b/gnu/packages/docker.scm
>>@@ -375,7 +375,7 @@ built-in registry server of Docker.")
>>                                  ((substitute-LookPath source-text package
>>                                                        relative-path)
>>                                   #`(substitute* source-files
>>-                                      ((#,(string-append "exec\\.LookPath\\(\""
>>+                                      ((#,(string-append "\\<exec\\.LookPath\\(\""
>>                                                          (syntax->datum
>>                                                           #'source-text)
>>                                                          "\")"))
>>@@ -389,7 +389,7 @@ built-in registry server of Docker.")
>>                                  ((substitute-LookPath source-text package
>>                                                        relative-path)
>>                                   #`(substitute* source-files
>>-                                      ((#,(string-append "exec\\.Command\\(\""
>>+                                      ((#,(string-append "\\<exec\\.Command\\(\""
>>                                                          (syntax->datum
>>                                                           #'source-text)
>                                                           "\"")
> Then it wouldn't match those:
>
> ./builder/dockerfile/copy_windows.go:   cmd := reexec.Command("windows-fix-permissions", source, destination, identity.SID)
> ./daemon/graphdriver/overlay2/mount.go: cmd := reexec.Command("docker-mountfrom", dir)
> ./daemon/graphdriver/windows/windows.go:                cmd := reexec.Command(append([]string{"docker-windows-write-layer", d.info.HomeDir, id}, parentLayerPaths...)...)
> ./pkg/chrootarchive/archive_unix.go:    cmd := reexec.Command("docker-untar", dest)
> ./pkg/chrootarchive/diff_unix.go:       cmd := reexec.Command("docker-applyLayer", dest)

Those are currently commented out (not in the actual code), so it was
working with the change, but thanks for bringing this to my attention.

> Why did you change it?

As the commit message says, it was to harmonize the macros' regexes with
the other regexes found in later substitute* uses.  I didn't see the
need to have different flavors of the same.

I suggest amending my patch with:

--8<---------------cut here---------------start------------->8---
@@ -389,7 +389,7 @@ built-in registry server of Docker.")
                                  ((substitute-LookPath source-text package
                                                        relative-path)
                                   #`(substitute* source-files
-                                      ((#,(string-append "\\<exec\\.Command\\(\""
+                                      ((#,(string-append "\\<(re)?exec\\.Command\\(\""
                                                          (syntax->datum
                                                           #'source-text)
                                                          "\""))
--8<---------------cut here---------------end--------------->8---

To be future proof.

What do you think?

Maxim