diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 9c06d48bdcabeb419c759045f96d44acc12766a3..bd67b5ef10293a101e123b25d21cb1aaf93773ba 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -27,6 +27,7 @@ require_once 'htmlguielements.class.php'; 2013-11-08 Axel <axel.hahn@iml.unibe.ch> (...) 2024-08-28 Axel php8 only; added variable types; short array syntax + 2024-09-20 Axel build(): check if checkout of sources failed ###################################################################### */ /** @@ -1785,7 +1786,16 @@ class project extends base // -------------------------------------------------- $sReturn .= '<h3>' . t('class-project-build-label-get-sources-from-version-control') . '</h3>'; - $sReturn .= '<pre>' . $this->_oVcs->getSources($sTempBuildDir) . '</pre>'; + $sCheckout=$this->_oVcs->getSources($sTempBuildDir); + $sReturn .= '<pre>' . $sCheckout . '</pre>'; + + // fetch last line "rc=NNN" + preg_match("/rc=([0-9]+)$/", $sCheckout, $aMatches); + $iRc=$aMatches[1] ?? 0; + if ($iRc != 0) { + return $this->_oHtml->getBox("error", "" . $sReturn); + } + $aRepodata = $this->getRepoRevision(); $sRevisionShort = substr($aRepodata['revision'], 0, 8); diff --git a/public_html/deployment/classes/vcs.git.class.php b/public_html/deployment/classes/vcs.git.class.php index dc16c3dd676f85c7aa091e12171eb26ab23eabc9..00b5020ee8b57d9be548484cb9f3b8d788c3618d 100644 --- a/public_html/deployment/classes/vcs.git.class.php +++ b/public_html/deployment/classes/vcs.git.class.php @@ -626,7 +626,7 @@ class vcs implements iVcs // this does not checkout tags in git v1.7 - only branches: // $sGitCmd .= 'echo git clone --depth 1 --recursive --branch "' . $sBranchname . '" "' . $this->getUrl() . '" "' . $sWorkDir . '" ; '; // $sGitCmd .= ' git clone --depth 1 --recursive --branch "' . $sBranchname . '" "' . $this->getUrl() . '" "' . $sWorkDir . '" 2>&1; '; - // + // $sGitCmd .= 'echo git clone "' . $this->getUrl() . '" "' . $sWorkDir . '" 2>&1 \&\& cd "' . $sWorkDir . '" \&\& git checkout "' . $sBranchname . '" ; '; $sGitCmd .= ' git clone "' . $this->getUrl() . '" "' . $sWorkDir . '" 2>&1 && cd "' . $sWorkDir . '" && git checkout "' . $sBranchname . '" 2>&1 '; $this->log(__FUNCTION__ . " start command <code>$sGitCmd</code>"); diff --git a/public_html/deployment/pages/act_build.php b/public_html/deployment/pages/act_build.php index 00c9cc94972df2e820f9f4d19ef6f95fd8ee5ede..828909e870b5dd3276a53b14ec2e4bb52d52a46e 100644 --- a/public_html/deployment/pages/act_build.php +++ b/public_html/deployment/pages/act_build.php @@ -7,9 +7,12 @@ webgui - build a package --------------------------------------------------------------------- - 2014-11-14 Axel <axel.hahn@iml.unibe.ch> selector for branches - 2014-02-14 Axel <axel.hahn@iml.unibe.ch> build was "ajaxified" 2013-11-08 Axel <axel.hahn@iml.unibe.ch> + 2014-02-14 Axel build was "ajaxified" + 2014-11-14 Axel selector for branches + (...) + 2024-09-20 Axel urlencode params in ajax call + ###################################################################### */ require_once("./classes/project_gui.class.php"); @@ -187,10 +190,10 @@ if (!array_key_exists("confirm", $aParams)) { $sAjaxFile = $aParams["prj"] . "_" . $aParams["action"]; $sDivname = "outAjax"; $sUrlStartAction = "/deployment/?" - . "&prj=" . $aParams["prj"] + . "&prj=" . urlencode($aParams["prj"]) . "&action=" . $aParams["action"] . "&confirm=" . $aParams["confirm"] - . "&branchname=" . $aParams["branchname"] + . "&branchname=" . urlencode($aParams["branchname"]) . "&ajax=" . $sAjaxFile . "&run=1" ;