gnu: ansible: Apply experimental patch to deal with wrapping of ansible script.
[jackhill/guix/guix.git] / gnu / packages / patches / ansible-wrap-program-hack.patch
1 Ansible changes its behaviour depending on the name of the script that it is
2 called as. Make it deal with guix' .real wrapper scripts.
3
4 FIXME: Remove once wrapping ansible works properly.
5 See http://lists.gnu.org/archive/html/bug-guix/2017-05/msg00015.html.
6 --- ansible-2.3.0.0/bin/ansible 2017-04-12 16:08:05.000000000 +0200
7 +++ ansible-2.3.0.0-fixed/bin/ansible 2017-05-21 20:11:18.720872385 +0200
8 @@ -75,7 +75,13 @@
9 # sometimes add that
10 target = target[:-1]
11
12 - if len(target) > 1:
13 + if target[-1] == "real" and target[0].startswith('.'):
14 + target = target[:-1]
15 + target[0] = target[0][1:]
16 + if len(target) > 1 and target[1] != "real" :
17 + sub = target[1]
18 + myclass = "%sCLI" % sub.capitalize()
19 + elif len(target) > 2 and target[2] == "real" :
20 sub = target[1]
21 myclass = "%sCLI" % sub.capitalize()
22 elif target[0] == 'ansible':