com web/rmtools: added pre check whether the build hase to be skipped: client/include/PeclExt.php client/script/pecl.php
| From: | Anatol Belski | Date: | Mon, 07 Oct 2013 15:53:03 +0000 |
| Subject: | com web/rmtools: added pre check whether the build hase to be skipped: client/include/PeclExt.php client/script/pecl.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19145@lists.php.net to get a copy of this message | ||
Commit: 455dc451ad9671231736f565f64c0973d8b0cf19
Author: Anatol Belski <ab@php.net> Mon, 7 Oct 2013 17:53:03 +0200
Parents: 290b6189c9d0476412fc0dd9067d4c84a11df698
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=455dc451ad9671231736f565f64c0973d8b0cf19
Log:
added pre check whether the build hase to be skipped
Changed paths:
M client/include/PeclExt.php
M client/script/pecl.php
Diff:
diff --git a/client/include/PeclExt.php b/client/include/PeclExt.php
index 14e688b..11becfb 100644
--- a/client/include/PeclExt.php
+++ b/client/include/PeclExt.php
@@ -243,6 +243,11 @@ class PeclExt
public function unpack()
{
+ if ($this->tmp_extract_path) {
+ /* already unpacked */
+ return $this->tmp_extract_path;
+ }
+
switch ($this->pkg_fmt) {
case 'tgz':
case 'tbz':
@@ -684,6 +689,25 @@ if (!function_exists('rmtools\combinations')) {
$this->cleanupNonCoreExtDeps();
}
+ public function checkSkipBuild()
+ {
+ $this->unpack();
+
+ if ($this->package_xml) {
+ $oses = $this->getPackageXmlProperty("dependencies", "required",
"os");
+ if ($oses) {
+ foreach($oses as $os) {
+ if ("windows" == (string)$os->name) {
+ if (isset($os->conflicts)) {
+ throw new \EXception("Per package.xml not compatible with Windows");
+ }
+ }
+ }
+ }
+
+ }
+ }
+
public function check()
{
if (!$this->tmp_extract_path) {
@@ -717,6 +741,8 @@ if (!function_exists('rmtools\combinations')) {
$this->cleanup();
throw new \Exception("At most PHP '$max_php_ver' required, got
'$php_ver'");
}
+
+
}
}
diff --git a/client/script/pecl.php b/client/script/pecl..php
index 350edff..e26f476 100644
--- a/client/script/pecl.php
+++ b/client/script/pecl.php
@@ -140,6 +140,7 @@ foreach ($builds as $build_name) {
try {
$ext = new rm\PeclExt($pkg_path, $build);
$mailer = new rm\PeclMail($pkg_path, $aggregate_mail);
+ $ext->checkSkipBuild();
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;