me
/
guix
Archived
1
0
Fork 0

gnu: ansible: Work around issues with Guix wrapper scripts.

* gnu/packages/admin.scm (ansible)[arguments]: Remove fix-symlinks phase. Add
replace-symlinks phase.
master
Arun Isaac 2019-10-16 01:29:10 +05:30
parent 50bfb70b73
commit ba8551ec79
No known key found for this signature in database
GPG Key ID: 2E25EE8B61802BB3
1 changed files with 7 additions and 12 deletions

View File

@ -19,7 +19,7 @@
;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com> ;;; Copyright © 2017 Ethan R. Jones <doubleplusgood23@gmail.com>
;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org> ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr> ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com> ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
@ -1880,21 +1880,16 @@ import re
sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0]) sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
"))) ")))
#t)) #t))
(add-after 'wrap 'fix-symlinks (add-after 'install 'replace-symlinks
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Replace symlinks with duplicate copies of the ansible
;; executable.
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(for-each (for-each
(lambda (subprogram) (lambda (subprogram)
;; The symlinks point to the ansible wrapper script. Make (delete-file (string-append out "/bin/ansible-" subprogram))
;; them point to the real executable (.ansible-real). (copy-file (string-append out "/bin/ansible")
(delete-file (string-append out "/bin/.ansible-" subprogram "-real")) (string-append out "/bin/ansible-" subprogram)))
(symlink (string-append out "/bin/.ansible-real")
(string-append out "/bin/.ansible-" subprogram "-real"))
;; The wrapper scripts of the symlinks invoke the ansible
;; wrapper script. Fix them to invoke the correct executable.
(substitute* (string-append out "/bin/ansible-" subprogram)
(("/bin/ansible")
(string-append "/bin/.ansible-" subprogram "-real"))))
(list "config" "console" "doc" "galaxy" (list "config" "console" "doc" "galaxy"
"inventory" "playbook" "pull" "vault"))) "inventory" "playbook" "pull" "vault")))
#t))))) #t)))))