gnu: btrbk: Use SEARCH-INPUT-FILES.

* gnu/packages/backup.scm (btrbk)[arguments]: Use SEARCH-INPUT-FILE to
construct the wrapper's PATH, rather than hard-coding package variables.
This commit is contained in:
Tobias Geerinckx-Rice 2022-07-24 02:00:00 +02:00
parent c7a13d29a2
commit f1b727c263
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -1121,20 +1121,23 @@ (define btrbk (search-input-file outputs "bin/btrbk"))
(string-append "program_name = " (string-append "program_name = "
"$ENV{'BTRBK_PROGRAM_NAME'}"))) "$ENV{'BTRBK_PROGRAM_NAME'}")))
;; Wrap the script, so that it works with SSH URI and ;; Wrap the script, so that it works with SSH URI and
;; finds mbuffer out of the box. ;; finds mbuffer and other tools out of the box.
(wrap-program btrbk (wrap-program btrbk
#:sh (search-input-file inputs "bin/bash") #:sh (search-input-file inputs "bin/bash")
'("BTRBK_PROGRAM_NAME" = ("$0")) '("BTRBK_PROGRAM_NAME" = ("$0"))
`("PATH" prefix `("PATH" prefix
,(list (string-append #$btrfs-progs "/bin") ,(map (lambda (command)
(string-append #$coreutils "/bin") (dirname (search-input-file inputs command)))
(string-append #$findutils "/bin") (list "bin/btrfs"
(string-append #$mbuffer "/bin") "bin/cat"
(string-append #$openssh "/bin"))))))))) "bin/find"
"bin/mbuffer"
"bin/ssh")))))))))
(native-inputs (list ruby-asciidoctor)) (native-inputs (list ruby-asciidoctor))
(inputs (list bash-minimal (inputs (list bash-minimal
btrfs-progs btrfs-progs
coreutils coreutils
findutils
mbuffer mbuffer
openssh openssh
perl)) perl))