(patch_name, dir_name, pnum)
| 370 | |
| 371 | |
| 372 | def applyPatchFile(patch_name, dir_name, pnum): |
| 373 | # we're assuming the patch was applied like in this example: |
| 374 | # diff --exclude=".git" --exclude=".hg" -rupN ./src/AGAST/ ./src/AGAST_patched/ > ./patches/agast.patch |
| 375 | # where the first given location is the unpatched directory, and the second location is the patched directory. |
| 376 | log("Applying patch to " + dir_name) |
| 377 | patch_dir = os.path.join(BASE_DIR, "patches") |
| 378 | arguments = "-d " + os.path.join(SRC_DIR, dir_name) + " -p" + str(pnum) + " < " + os.path.join(patch_dir, patch_name) |
| 379 | argumentsBinary = "-d " + os.path.join(SRC_DIR, dir_name) + " -p" + str(pnum) + " --binary < " + os.path.join(patch_dir, patch_name) |
| 380 | res = executeCommand(TOOL_COMMAND_PATCH + " --dry-run " + arguments, quiet = True) |
| 381 | if res != 0: |
| 382 | arguments = argumentsBinary |
| 383 | res = executeCommand(TOOL_COMMAND_PATCH + " --dry-run " + arguments, quiet = True) |
| 384 | if res != 0: |
| 385 | log("ERROR: patch application failure; has this patch already been applied?") |
| 386 | executeCommand(TOOL_COMMAND_PATCH + " --dry-run " + arguments, printCommand = True) |
| 387 | exit(255) |
| 388 | else: |
| 389 | dieIfNonZero(executeCommand(TOOL_COMMAND_PATCH + " " + arguments, quiet = True)) |
| 390 | |
| 391 | |
| 392 | def runPythonScript(script_name): |
no test coverage detected