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
parent
6a67aad88e
commit
c43c4d8b39
|
@ -455,47 +455,53 @@ 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
|
||||||
(add-after 'unpack 'delete-facter-ng-gemspec
|
(modify-phases %standard-phases
|
||||||
(lambda _
|
(add-after 'unpack 'delete-facter-ng-gemspec
|
||||||
;; XXX: ruby-build-system incorrectly finds
|
(lambda _
|
||||||
;; facter-ng.gemspec from this directory and tries to
|
;; XXX: ruby-build-system incorrectly finds
|
||||||
;; build that instead of the proper facter.gemspec.
|
;; facter-ng.gemspec from this directory and tries to
|
||||||
;; Just delete it as a workaround, as it appears to
|
;; build that instead of the proper facter.gemspec.
|
||||||
;; only exist for backwards-compatibility after the
|
;; Just delete it as a workaround, as it appears to
|
||||||
;; facter-ng->facter rename.
|
;; only exist for backwards-compatibility after the
|
||||||
(delete-file "agent/facter-ng.gemspec")
|
;; facter-ng->facter rename.
|
||||||
#t))
|
(delete-file "agent/facter-ng.gemspec")
|
||||||
(add-after 'unpack 'embed-iproute-reference
|
#t))
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(add-after 'unpack 'embed-absolute-references
|
||||||
(let ((iproute (assoc-ref inputs "iproute")))
|
;; Refer to absolute executable file names to avoid propagation.
|
||||||
;; Provide an absolute reference to the 'ip' executable
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
;; to avoid propagating it.
|
(substitute* (find-files "lib/resolvers" "\\.rb$")
|
||||||
(substitute* "lib/resolvers/networking_linux_resolver.rb"
|
(("execute\\('(which |)([^ ']+)" _ _ name)
|
||||||
(("execute\\('ip")
|
(string-append "execute('" (or (which name)
|
||||||
(string-append "execute('" iproute "/sbin/ip")))
|
name))))
|
||||||
#t)))
|
#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)
|
||||||
;; XXX: The test suite wants to run Bundler and
|
;; XXX: The test suite wants to run Bundler and
|
||||||
;; complains that the gemspec is invalid. For now
|
;; complains that the gemspec is invalid. For now
|
||||||
;; just make sure that we can run the wrapped
|
;; just make sure that we can run the wrapped
|
||||||
;; executable directly.
|
;; executable directly.
|
||||||
(if tests?
|
(if tests?
|
||||||
(invoke (string-append (assoc-ref outputs "out")
|
(invoke (string-append (assoc-ref outputs "out")
|
||||||
"/bin/facter")
|
"/bin/facter")
|
||||||
;; Many facts depend on /sys, /etc/os-release,
|
;; Many facts depend on /sys, /etc/os-release,
|
||||||
;; etc, so we only run a small sample.
|
;; etc, so we only run a small sample.
|
||||||
"facterversion" "architecture"
|
"facterversion" "architecture"
|
||||||
"kernel" "kernelversion")
|
"kernel" "kernelversion")
|
||||||
(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
|
||||||
|
|
Reference in New Issue