From a333bbdf6971c78cd98fdd9df14e35183de02a3b Mon Sep 17 00:00:00 2001 From: Claudio Freire Date: Thu, 29 Dec 2016 14:29:28 -0300 Subject: [PATCH 1/4] Add support for python patching --- defaults/main.yml | 7 +++++++ tasks/build.yml | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 5f4385b..9fcdb1b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -63,4 +63,11 @@ python_build_opts: '' python_force_build: False setuptools_force_build: False +# List of patches to download and apply, should be maps with: +# - url +# - basename - base name of the patch (filename to download to) +# - sha1sum - sha1sum check string +# - pargs - patch args (default -p1) +python_patches: [] + # vi:ts=2:sw=2:et:ft=yaml diff --git a/tasks/build.yml b/tasks/build.yml index 6044f07..724f534 100644 --- a/tasks/build.yml +++ b/tasks/build.yml @@ -20,6 +20,17 @@ src="{{python_src_prefix}}/{{python_src_pkg}}" dest="{{python_src_prefix}}" +- name: Patch code + script: | + #!/bin/bash + set -e + cd "{{python_src_prefix}}" + wget -q -O "{{item.basename}}" "{{item.url}}" + echo "{{item.sha1sum}}" | sha1sum + patch {{item.pargs|default('-p1')}} -i "{{item.basename}}" + rm "{{item.basename}}" + with_items: "{{python_patches}}" + - name: Check Custom Python binary command: > {{python_bin}} --version From bb2f76b50cc15e8997582046b22389184eb989f1 Mon Sep 17 00:00:00 2001 From: Claudio Freire Date: Mon, 2 Jan 2017 21:45:49 -0300 Subject: [PATCH 2/4] Use shell (supports chdir) and leave patches lying around --- tasks/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/build.yml b/tasks/build.yml index 724f534..a4178f1 100644 --- a/tasks/build.yml +++ b/tasks/build.yml @@ -21,14 +21,13 @@ dest="{{python_src_prefix}}" - name: Patch code - script: | + shell: | #!/bin/bash set -e - cd "{{python_src_prefix}}" wget -q -O "{{item.basename}}" "{{item.url}}" echo "{{item.sha1sum}}" | sha1sum patch {{item.pargs|default('-p1')}} -i "{{item.basename}}" - rm "{{item.basename}}" + chdir: "{{python_src_prefix}}" with_items: "{{python_patches}}" - name: Check Custom Python binary From fdae0cad1d0454432df1f96c9dee926a7685c084 Mon Sep 17 00:00:00 2001 From: Claudio Freire Date: Mon, 2 Jan 2017 21:51:50 -0300 Subject: [PATCH 3/4] Syntax fix --- tasks/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/build.yml b/tasks/build.yml index a4178f1..8b73673 100644 --- a/tasks/build.yml +++ b/tasks/build.yml @@ -27,7 +27,8 @@ wget -q -O "{{item.basename}}" "{{item.url}}" echo "{{item.sha1sum}}" | sha1sum patch {{item.pargs|default('-p1')}} -i "{{item.basename}}" - chdir: "{{python_src_prefix}}" + args: + chdir: "{{python_src_prefix}}" with_items: "{{python_patches}}" - name: Check Custom Python binary From b8bd4a82edaad8759276eed74f79ce88b780ae35 Mon Sep 17 00:00:00 2001 From: Claudio Freire Date: Mon, 2 Jan 2017 21:52:21 -0300 Subject: [PATCH 4/4] Syntax fix --- tasks/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/build.yml b/tasks/build.yml index 8b73673..9dbfb09 100644 --- a/tasks/build.yml +++ b/tasks/build.yml @@ -21,7 +21,7 @@ dest="{{python_src_prefix}}" - name: Patch code - shell: | + shell: > #!/bin/bash set -e wget -q -O "{{item.basename}}" "{{item.url}}"