[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.
reviewable/pr18780/r1
Sébastien Gross 10 years ago
parent b68c136010
commit 84eb895a06

@ -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:

Loading…
Cancel
Save