summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>2015-03-20 17:19:15 +0100
committerSébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>2015-03-20 17:19:15 +0100
commit84eb895a06c8819ed5d8aea06672a69add2b9d37 (patch)
treed71931d3ca37c67a1f9e002bd13b3831017dd783 /files
parentb68c136010e4a7113f65a7a7bf5c52dc29c35b91 (diff)
downloadansible-modules-extras-84eb895a06c8819ed5d8aea06672a69add2b9d37.tar.gz
[patch] Make sure the absolute patch file is passed to the patch command.
According the patch(1) manpage: The --directory option change to the directory dir immediately, before doing anything else. Thus if file is not relative to dir and making file absolute ensure that patch will find it.
Diffstat (limited to 'files')
-rwxr-xr-xfiles/patch.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/files/patch.py b/files/patch.py
index 314a1bc3..78bcefe6 100755
--- a/files/patch.py
+++ b/files/patch.py
@@ -145,6 +145,9 @@ def main():
module.fail_json(msg="patch command not found")
patch_func = lambda opts: module.run_command("%s %s" % (patch_bin, ' '.join(opts)))
+ # patch need an absolute file name
+ p.src = os.path.abspath(p.src)
+
changed = False
if not is_already_applied(patch_func, p.src, p.basedir, dest_file=p.dest, strip=p.strip):
try: