svn: /web/php-rmtools/trunk/client/include/ Branch.php BuildVC.php MakeLogParser.php MakeLogParserVC.php Repository.php Svn.php Tools.php
| From: | Pierre Joye | Date: | Tue, 23 Aug 2011 12:48:37 +0000 |
| Subject: | svn: /web/php-rmtools/trunk/client/include/ Branch.php BuildVC.php MakeLogParser.php MakeLogParserVC.php Repository.php Svn.php Tools.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-12001@lists.php.net to get a copy of this message | ||
pajoye Tue, 23 Aug 2011 12:48:37 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=315363
Log:
-cleanup and ignoring some warning (easier to catch some later)
Changed paths:
U web/php-rmtools/trunk/client/include/Branch.php
U web/php-rmtools/trunk/client/include/BuildVC.php
U web/php-rmtools/trunk/client/include/MakeLogParser.php
U web/php-rmtools/trunk/client/include/MakeLogParserVC.php
U web/php-rmtools/trunk/client/include/Repository.php
U web/php-rmtools/trunk/client/include/Svn.php
U web/php-rmtools/trunk/client/include/Tools.php
Modified: web/php-rmtools/trunk/client/include/Branch.php
===================================================================
--- web/php-rmtools/trunk/client/include/Branch.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/Branch.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -16,7 +16,7 @@
public function __construct($config_path)
{
if (!is_readable($config_path)) {
- throw new \Exception('Cannot open config data <' . $path . '>');
+ throw new \Exception('Cannot open config data <' . $config_path .
'>');
}
$this->config = new BranchConfig($config_path);
$this->repo = Repository::fromBranchConfig($this->config);
@@ -75,6 +75,9 @@
$zip_path = $dir_name . '.zip';
$cmd = "zip -q -r $zip_path $dir_name";
$res = exec_single_log($cmd, $this->config->getBuildDir());
+ if (!$res) {
+ throw new \Exception("Export failed, svn exec failed to be ran");
+ }
}
$target = realpath($target);
return $target;
@@ -82,7 +85,7 @@
public function createSourceSnap($revision = false)
{
- return $this->export($revision = $revision, true);
+ return $this->export($revision, true);
}
public function setLastRevisionExported($last_rev)
@@ -134,7 +137,6 @@
}
$compiler = strtolower($build['compiler']);
- $arch = strtolower($build['arch']);
switch ($compiler) {
case 'vc9':
case 'vc6':
Modified: web/php-rmtools/trunk/client/include/BuildVC.php
===================================================================
--- web/php-rmtools/trunk/client/include/BuildVC.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/BuildVC.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -164,7 +164,6 @@
function clean()
{
- $dir = $this->obj_dir;
rmdir_rf($this->obj_dir);
}
Modified: web/php-rmtools/trunk/client/include/MakeLogParser.php
===================================================================
--- web/php-rmtools/trunk/client/include/MakeLogParser.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/MakeLogParser.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -8,6 +8,7 @@
function toHtml($title)
{
+ /** @noinspection PhpUnusedLocalVariableInspection */
$log = $this->log;
ob_start();
include __DIR__ . '/../template/make_log.tpl.php';
Modified: web/php-rmtools/trunk/client/include/MakeLogParserVC.php
===================================================================
--- web/php-rmtools/trunk/client/include/MakeLogParserVC.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/MakeLogParserVC.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -17,7 +17,7 @@
}
//win32\build\deplister.c(50) : warning C4090: 'function' : different 'const'
qualifiers
- $log = '';
+ $pcre = '/(error|warning)/';
$log = array();
foreach ($lines as $line) {
$out = '#' . ($line_nr++) . ' ';
@@ -33,14 +33,13 @@
$re6='.*?'; # Non-greedy match on filler
$re7='((?:[a-z][a-z]*[0-9]+[a-z0-9]*))'; # Alphanum 1
$re8 =':(.*?)$';
- if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4.$re5.$re6.$re7.$re8."/is",
$txt, $matches))
+ if (preg_match_all ("/".$re1.$re2.$re3.$re4.$re5.$re6.$re7.$re8."/is",
$txt, $matches))
{
$winpath1 = $matches[1][0];
$int1 = $matches[2][0];
$word1 = $matches[3][0];
$alphanum1 = $matches[4][0];
$error_msg = trim(str_replace(array("\r","\n"),
array('',''),$matches[5][0]));
- $row = "match 1: ($winpath1) ($int1) ($word1) ($alphanum1) ($error_msg)\n";
$row = array(
'file' => $winpath1,
'line' => $int1,
@@ -60,7 +59,7 @@
$re8='((?:[a-z][a-z]*[0-9]+[a-z0-9]*))'; # Alphanum 1
$re9 =':(.*?)$';
- if ($c=preg_match_all
("/".$re1.$re2.$re3.$re4.$re5.$re6.$re7.$re8.$re9."/is", $txt, $matches))
+ if (preg_match_all
("/".$re1.$re2.$re3.$re4.$re5.$re6.$re7.$re8.$re9."/is", $txt, $matches))
{
$path=$matches[1][0];
$int1=$matches[2][0];
@@ -84,7 +83,7 @@
$re5='((?:[a-z][a-z]*[0-9]+[a-z0-9]*))'; # Alphanum 1
$re6 =':(.*?)$';
- if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4.$re5.$re6."/is", $txt,
$matches))
+ if (preg_match_all ("/".$re1.$re2.$re3.$re4.$re5.$re6."/is", $txt,
$matches))
{
$word1=$matches[1][0];
$word2=$matches[2][0];
@@ -142,5 +141,6 @@
}
}
$this->log = $log;
+ return true;
}
}
Modified: web/php-rmtools/trunk/client/include/Repository.php
===================================================================
--- web/php-rmtools/trunk/client/include/Repository.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/Repository.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -27,6 +27,8 @@
$r = new Svn($repo['url']);
return $r;
break;
+ default:
+ throw new \Exception('Invalid repo config data, invalid type defined');
}
}
}
Modified: web/php-rmtools/trunk/client/include/Svn.php
===================================================================
--- web/php-rmtools/trunk/client/include/Svn.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/Svn.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -35,7 +35,8 @@
public function getLastCommitId()
{
- $cmd = $this->svn_cmd . ' info --xml ' . $this->repo_url . $this->module.
$this->branch;
+ $path = $this->repo_url . $this->module. $this->branch;
+ $cmd = $this->svn_cmd . ' info --xml ' . $path;
$res = exec_sep_log($cmd);
if ($res && is_null($res['log_stdout'])) {
Modified: web/php-rmtools/trunk/client/include/Tools.php
===================================================================
--- web/php-rmtools/trunk/client/include/Tools.php 2011-08-23 12:32:07 UTC (rev 315362)
+++ web/php-rmtools/trunk/client/include/Tools.php 2011-08-23 12:48:37 UTC (rev 315363)
@@ -2,6 +2,7 @@
namespace rmtools;
function exec_sep_log($cmd, $cwd = NULL, $env = NULL)
{
+ $return_value = false;
$log_stdout = $log_stderr = NULL;
$descriptor_spec = array(
@@ -96,8 +97,8 @@
function ftp_make_directory($ftp_stream, $dir)
{
if (ftp_is_dir($ftp_stream, $dir) || @ftp_mkdir($ftp_stream, $dir)) return true;
- if (!make_directory($ftp_stream, dirname($dir))) return false;
- return ftp_mkdir($ftp_stream, $dir);
+ if (!ftp_make_directory($ftp_stream, dirname($dir))) return false;
+ return ftp_mkdir($ftp_stream, $dir);
}
function ftp_is_dir($ftp_stream, $dir)
@@ -152,7 +153,7 @@
if (!$login_result) {
return false;
}
- $res = ftp_make_directory($ftp, $target. '/logs');
+ ftp_make_directory($ftp, $target. '/logs');
ftp_close($ftp);
$curl = array();
@@ -204,7 +205,7 @@
}
do {
- $n = \curl_multi_exec($mh,$active);
+ \curl_multi_exec($mh,$active);
} while ($active);
foreach ($curl as $ch) {
@@ -215,6 +216,7 @@
\curl_close($ch);
}
//\curl_multi_close($mh);
+ return true;
}
function send_error_notification($branch_name, $build_entries, $previous_revision,
$current_revision, $url_log)