From 4ed462f54fbccaa5d35c43ddfcaed2a6ae256eb1 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 7 May 2012 12:16:34 -0400 Subject: Add an option to specify a base directory for the patch --- config/systempatches/system_patches_edit.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'config/systempatches/system_patches_edit.php') diff --git a/config/systempatches/system_patches_edit.php b/config/systempatches/system_patches_edit.php index dd9e1ce7..bfa0af36 100644 --- a/config/systempatches/system_patches_edit.php +++ b/config/systempatches/system_patches_edit.php @@ -59,6 +59,7 @@ if (isset($id) && $a_patches[$id]) { $pconfig['location'] = $a_patches[$id]['location']; $pconfig['patch'] = $a_patches[$id]['patch']; $pconfig['pathstrip'] = $a_patches[$id]['pathstrip']; + $pconfig['basedir'] = $a_patches[$id]['basedir']; $pconfig['ignorewhitespace'] = isset($a_patches[$id]['ignorewhitespace']); $pconfig['autoapply'] = isset($a_patches[$id]['autoapply']); $pconfig['uniqid'] = $a_patches[$id]['uniqid']; @@ -89,6 +90,9 @@ if ($_POST) { if (!is_numeric($_POST['pathstrip'])) { $input_errors[] = gettext("Path Strip Count must be numeric!"); } + if (!empty($_POST['basedir']) && (!file_exists($_POST['basedir']) || !is_dir($_POST['basedir']))) { + $input_errors[] = gettext("Base Directory must exist and be a directory!"); + } if (!$input_errors) { $thispatch = array(); @@ -102,6 +106,7 @@ if ($_POST) { $thispatch['pathstrip'] = 1; else $thispatch['pathstrip'] = $_POST['pathstrip']; + $thispatch['basedir'] = empty($_POST['basedir']) ? "/" : $_POST['basedir']; $thispatch['ignorewhitespace'] = isset($_POST['ignorewhitespace']); $thispatch['autoapply'] = isset($_POST['autoapply']); if (empty($_POST['uniqid'])) { @@ -172,6 +177,12 @@ include("fbegin.inc"); ?> + + + + +
+ -- cgit v1.2.3