Hello,

Ludovic Courtès <[email protected]> writes:

> How about this instead?
>
> diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
> index 1536e913bf6..de0ec88c0f8 100644
> --- a/guix/scripts/pack.scm
> +++ b/guix/scripts/pack.scm
> @@ -1348,6 +1348,13 @@ (define* (wrapped-package package
>                               (elf-loader-compile-flags program)))
>                (delete-file "run.c")))
>  
> +          (define (executable? file)
> +            ;; Return #t if FILE is a regular file and is executable.
> +            (let ((s (stat file #f)))
> +              (and s
> +                   (eq? 'regular (stat:type s))
> +                   (not (zero? (logand (stat:mode s) #o100))))))
> +
>            (setvbuf (current-output-port) 'line)
>  
>            ;; Link the top-level files of PACKAGE so that search paths are
> @@ -1360,7 +1367,7 @@ (define* (wrapped-package package
>                      (scandir input))
>  
>            (receive (executables others)
> -              (partition executable-file?
> +              (partition executable?
>                        ;; Note: Trailing slash in case these are symlinks.
>                           (append (find-files (string-append input "/bin/"))
>                                   (find-files (string-append input "/sbin/"))
>
>
> That would avoid wrapping directories (!) and everything should work
> much better afterwards.

I have tested your patch and can confirm it works.  I still prefer my
approach.  The resulting code is simpler, and since nothing in libexec
should be executed directly anyway, wrapping it should not be needed in
the first place (even your version just skips the wrapping in favor of
making a symlink; "proper" way would be to replace the symlink with an
actual directory with wrapped content).

But both available patches do resolve this bug. ^_^

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.



Reply via email to