Sree Harsha Totakura <sreehar...@totakura.in> skribis:

> * gnu/packages/gnunet.scm (gnurl): New variable. Thanks to Zerwas for the 
> initial recipe.

Thanks, applied, with this phase:

> +       (lambda* (#:rest args)
> +         (begin (chdir "tests")
> +                (let* ((path (search-path-as-string->list (getenv "PATH")))
> +                       (sh (search-path path "sh"))
> +                       (exp (string-append "s@/bin/sh@" sh "@g"))
> +                       (f (open-file "data/DISABLED" "a")))
> +                  (system* "sed" "-i" exp "runtests.pl")
> +                  (newline f)
> +                  (display "1022" f)
> +                  (close f))
> +                (chdir "../")))
> +       %standard-phases)))

changed to the more idiomatic (and hopefully more elegant too):

       (lambda _
         (with-directory-excursion "tests"  ; <- like “cd tests; ...; cd ..”
           (substitute* "runtests.pl"       ; <- like sed
             (("/bin/sh")
              (which "sh")))                ; <- like ‘search-path’ etc.
           (let* ((port (open-file "data/DISABLED" "a")))
             (newline port)
             (display "1022" port)
             (close port))))

Ludo’.

Reply via email to