me
/
guix
Archived
1
0
Fork 0

gnu: facter: Embed more absolute references.

* gnu/packages/admin.scm (facter)[arguments]: Rename the
‘embed-iproute-reference’ phase to ‘embed-absolute-references’ and make
it generic.  Implicit inputs like coreutils are captured.  References
depend on what's found, not a hard-coded list.
[inputs]: Add dmidecode, inetutils, pciutils, and util-linux.
master
Tobias Geerinckx-Rice 2020-08-09 15:44:44 +02:00
parent 6a67aad88e
commit c43c4d8b39
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 45 additions and 39 deletions

View File

@ -455,7 +455,8 @@ graphs and can export its output to different formats.")
"0bab3by926gavbhkvp0in82vim575ybj8z6av3b12jdvla1s9rmz")))) "0bab3by926gavbhkvp0in82vim575ybj8z6av3b12jdvla1s9rmz"))))
(build-system ruby-build-system) (build-system ruby-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases `(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'delete-facter-ng-gemspec (add-after 'unpack 'delete-facter-ng-gemspec
(lambda _ (lambda _
;; XXX: ruby-build-system incorrectly finds ;; XXX: ruby-build-system incorrectly finds
@ -466,15 +467,14 @@ graphs and can export its output to different formats.")
;; facter-ng->facter rename. ;; facter-ng->facter rename.
(delete-file "agent/facter-ng.gemspec") (delete-file "agent/facter-ng.gemspec")
#t)) #t))
(add-after 'unpack 'embed-iproute-reference (add-after 'unpack 'embed-absolute-references
;; Refer to absolute executable file names to avoid propagation.
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((iproute (assoc-ref inputs "iproute"))) (substitute* (find-files "lib/resolvers" "\\.rb$")
;; Provide an absolute reference to the 'ip' executable (("execute\\('(which |)([^ ']+)" _ _ name)
;; to avoid propagating it. (string-append "execute('" (or (which name)
(substitute* "lib/resolvers/networking_linux_resolver.rb" name))))
(("execute\\('ip") #t))
(string-append "execute('" iproute "/sbin/ip")))
#t)))
(delete 'check) (delete 'check)
(add-after 'wrap 'check (add-after 'wrap 'check
(lambda* (#:key tests? outputs #:allow-other-keys) (lambda* (#:key tests? outputs #:allow-other-keys)
@ -492,10 +492,16 @@ graphs and can export its output to different formats.")
(format #t "tests disabled~%")) (format #t "tests disabled~%"))
#t))))) #t)))))
(inputs (inputs
`(("iproute" ,iproute) `(("ruby-hocon" ,ruby-hocon)
("ruby-hocon" ,ruby-hocon)
("ruby-sys-filesystem" ,ruby-sys-filesystem) ("ruby-sys-filesystem" ,ruby-sys-filesystem)
("ruby-thor" ,ruby-thor))) ("ruby-thor" ,ruby-thor)
;; For embed-absolute-references.
("dmidecode" ,dmidecode)
("inetutils" ,inetutils) ; for hostname
("iproute" ,iproute)
("pciutils" ,pciutils)
("util-linux" ,util-linux)))
(synopsis "Collect and display system facts") (synopsis "Collect and display system facts")
(description (description
"Facter is a tool that gathers basic facts about nodes (systems) such "Facter is a tool that gathers basic facts about nodes (systems) such