aboutsummaryrefslogtreecommitdiffstats
path: root/config/systempatches/patches.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/systempatches/patches.inc')
-rw-r--r--config/systempatches/patches.inc19
1 files changed, 10 insertions, 9 deletions
diff --git a/config/systempatches/patches.inc b/config/systempatches/patches.inc
index e25db3ff..d17e3614 100644
--- a/config/systempatches/patches.inc
+++ b/config/systempatches/patches.inc
@@ -43,13 +43,14 @@ function patch_commit($patch, $action, $test=false, $fulldetail=false) {
$direction = ($action == "revert") ? "--reverse" : "--forward";
$whitespace = $patch['ignorewhitespace'] ? "--ignore-whitespace" : "";
$pathstrip = '-p' . $patch['pathstrip'];
+ $full_patch_command = "{$patch_cmd} --directory={$directory} {$force} {$pathstrip} {$filename} {$check} {$direction} {$whitespace}";
patch_write($patch);
- $status = mwexec("{$patch_cmd} --directory={$directory} {$force} {$pathstrip} {$filename} {$check} {$direction} {$whitespace}", true);
- //patch_erase($patch);
- if ($status == 0)
- return true;
+ if (!$fulldetail)
+ $output = (mwexec($full_patch_command, true) == 0);
else
- return false;
+ $output = $full_patch_command . "\n\n" . shell_exec($full_patch_command . ' 2>&1');
+ patch_erase($patch);
+ return $output;
}
/* Attempt to apply a patch */
@@ -63,13 +64,13 @@ function patch_revert($patch) {
}
/* Test if a patch would apply cleanly */
-function patch_test_apply($patch) {
- return patch_commit($patch, "apply", true);
+function patch_test_apply($patch, $fulldetail=false) {
+ return patch_commit($patch, "apply", true, $fulldetail);
}
/* Test if a patch would revert cleanly */
-function patch_test_revert($patch) {
- return patch_commit($patch, "revert", true);
+function patch_test_revert($patch, $fulldetail=false) {
+ return patch_commit($patch, "revert", true, $fulldetail);
}
/* Fetch a patch from a URL or github */