Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.

From: Mathieu Othacehe <[email-masked]>
Date: Mon, 17 Feb 2020 12:48:56 +0100

Hey Pierre,

Thanks for this patch! A few remarks below.

> +@item @code{("foo/bar" "share/my-app/baz")}: Install @code{bar}t o @code{share/my-app/baz}.
                                                                   ^
                                                                   typo

> +  (and (not target)                               ;XXX: no cross-compilation

Why don't we support cross-compilation here?

> +    (set! target (if (string-suffix? "/" target)
> +                     (string-append target (basename source))
> +                     target))

We could use let instead of set!, right?

> +  (define* (make-file-predicate matches matches-regexp #:optional (default-value #t))
> +    (if (or matches matches-regexp)
> +        (lambda (file)
> +          (any (lambda (pred) (pred file))
> +               (append
> +                (map (lambda (str)
> +                       (lambda (f) (string-suffix? str f)))
> +                     (or matches '()))
> +                (map (lambda (regexp)
> +                       (lambda (f) (regexp-exec (make-regexp regexp) f)))
> +                     (or matches-regexp '())))))
> +        (const default-value)))

You could maybe explain a bit what this function does. And how 'file'
differs from 'f'.

Thanks,

Mathieu