com web/rmtools: split the batch scripts into simple workers and tasks: client/bin/pecl.bat client/bin/pecl_build_all.bat clien t/bin/pecl_rss.bat
client/bin/pecl_rss_task.bat
| From: | Anatol Belski | Date: | Tue, 24 Sep 2013 11:49:06 +0000 |
| Subject: | com web/rmtools: split the batch scripts into simple workers and tasks: client/bin/pecl.bat client/bin/pecl_build_all.bat clien t/bin/pecl_rss.bat client/bin/pecl_rss_task.bat |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-19164@lists.php.net to get a copy of this message | ||
Commit: 1387efc806b9b89652c78b1345ce1a4f8ec5051e
Author: Anatol Belski <ab@php.net> Tue, 24 Sep 2013 13:49:06 +0200
Parents: 634f9df1bb49e2414f252b0d95ad0ee5fa296839
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=1387efc806b9b89652c78b1345ce1a4f8ec5051e
Log:
split the batch scripts into simple workers and tasks
Changed paths:
M client/bin/pecl.bat
A client/bin/pecl_build_all.bat
A client/bin/pecl_rss.bat
A client/bin/pecl_rss_task.bat
Diff:
diff --git a/client/bin/pecl.bat b/client/bin/pecl.bat
index 7c2cce7..d283a1e 100644
--- a/client/bin/pecl.bat
+++ b/client/bin/pecl.bat
@@ -2,20 +2,9 @@
SET BAT_DIR=%~dp0
-set yyyy=%date:~6,4%
-set mm=%date:~3,2%
-set dd=%date:~0,2%
-
-set hh=%time:~0,2%
-if %hh% lss 10 (set hh=0%time:~1,1%)
-set nn=%time:~3,2%
-set ss=%time:~6,2%
-set cur_date=%yyyy%%mm%%dd%-%hh%%nn%%ss%
-
-set LOG_FILE=c:\php-sdk\logs\task-pecl-%cur_date%.log
set RMTOOLS_BASE_DIR=c:\php-sdk\rmtools-client
-set PECL_PHP_CMD=c:\php-sdk\php\php.exe -d extension_dir=c:\php-sdk\php\ext -d
extension=php_openssl.dll -d extension=php_curl.dll -d date.timezone=UTC
+set PECL_PHP_CMD=c:\php-sdk\php\php.exe -d extension_dir=c:\php-sdk\php\ext -d
extension=php_openssl.dll -d extension=php_curl.dll -d extension=php_sqlite3.dll -d
date.timezone=UTC
if "%1"=="" goto :help
if "%1"=="--help" goto :help
@@ -24,26 +13,14 @@ if "%1"=="/?" goto :help
goto :skip_help
:help
-echo ==========================================================
-echo This is the PECL build batch script. You can see the help
-echo output of the underlaying worker below. Note that you have
-echo to ommit the --config option when running this batch.
-echo ==========================================================
%PECL_PHP_CMD% %BAT_DIR%\..\script\pecl.php
GOTO EXIT_LOCKED
:skip_help
-IF EXIST c:\php-sdk\locks\pecl.lock (
-ECHO Snapshot script is already running.
-GOTO EXIT_LOCKED
-)
-
-ECHO running > c:\php-sdk\locks\pecl.lock
-
CALL c:\php-sdk\bin\phpsdk_setvars.bat
-copy c:\php-sdk\rmtools.base\data\config\credentials_ftps.php %RMTOOLS_BASE_DIR%\data\config\
>> %LOG_FILE% 2<&1
+copy c:\php-sdk\rmtools.base\data\config\credentials_ftps.php %RMTOOLS_BASE_DIR%\data\config\
REM VC9 Support
SET PSDK_61_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.1
@@ -93,19 +70,11 @@ SET VC11_X64_SHELL=%comspec% /k ""C:\Program Files (x86)\Microsoft
Visual Studio
REM Run pecl.php
SET BISON_SIMPLE=c:\php-sdk\bin\bison.simple
-rem XXX iterate the c:\pecl_in_pkg here and delete the packages after successful build
@ECHO ON
-%PECL_PHP_CMD% %BAT_DIR%\..\script\pecl.php --config=pecl55_x64 %* >> %LOG_FILE% 2<&1
-%PECL_PHP_CMD% %BAT_DIR%\..\script\pecl.php --config=pecl55_x86 %* >> %LOG_FILE% 2<&1
-%PECL_PHP_CMD% %BAT_DIR%\..\script\pecl.php --config=pecl54 %* >> %LOG_FILE% 2<&1
-%PECL_PHP_CMD% %BAT_DIR%\..\script\pecl.php --config=pecl53 %* >> %LOG_FILE% 2<&1
+%PECL_PHP_CMD% %BAT_DIR%..\script\pecl.php %*
@ECHO OFF
SET PATH=%OLD_PATH%
-echo Done.>> %LOG_FILE%
-
-del c:\php-sdk\locks\pecl.lock >> %LOG_FILE% 2<&1
-
:EXIT_LOCKED
echo .
diff --git a/client/bin/pecl_build_all.bat b/client/bin/pecl_build_all.bat
new file mode 100644
index 0000000..074658b
--- /dev/null
+++ b/client/bin/pecl_build_all.bat
@@ -0,0 +1,53 @@
+@ECHO OFF
+
+SET BAT_DIR=%~dp0
+
+set yyyy=%date:~6,4%
+set mm=%date:~3,2%
+set dd=%date:~0,2%
+
+set hh=%time:~0,2%
+if %hh% lss 10 (set hh=0%time:~1,1%)
+set nn=%time:~3,2%
+set ss=%time:~6,2%
+set cur_date=%yyyy%%mm%%dd%-%hh%%nn%%ss%
+
+set LOG_FILE=c:\php-sdk\logs\task-pecl-%cur_date%.log
+set RMTOOLS_BASE_DIR=c:\php-sdk\rmtools-client
+
+if "%1"=="" goto :help
+if "%1"=="--help" goto :help
+if "%1"=="-h" goto :help
+if "%1"=="/?" goto :help
+goto :skip_help
+
+:help
+echo ==========================================================
+echo This is the PECL build batch script. You can see the help
+echo output of the underlaying worker below. Note that you HAVE
+echo TO ommit the --config option when running this batch.
+echo ==========================================================
+%BAT_DIR%pecl.bat
+GOTO EXIT_LOCKED
+
+:skip_help
+
+IF EXIST c:\php-sdk\locks\pecl.lock (
+ECHO Pecl build script is already running.
+GOTO EXIT_LOCKED
+)
+
+ECHO running > c:\php-sdk\locks\pecl.lock
+
+call %BAT_DIR%pecl.bat --config=pecl55_x64 %* >> %LOG_FILE% 2<&1
+call %BAT_DIR%pecl.bat --config=pecl55_x86 %* >> %LOG_FILE% 2<&1
+call %BAT_DIR%pecl.bat --config=pecl54 %* >> %LOG_FILE% 2<&1
+call %BAT_DIR%pecl.bat --config=pecl53 %* >> %LOG_FILE% 2<&1
+
+echo Done.>> %LOG_FILE%
+
+del c:\php-sdk\locks\pecl.lock >> %LOG_FILE% 2<&1
+
+:EXIT_LOCKED
+echo .
+
diff --git a/client/bin/pecl_rss.bat b/client/bin/pecl_rss.bat
new file mode 100644
index 0000000..d73073c
--- /dev/null
+++ b/client/bin/pecl_rss.bat
@@ -0,0 +1,24 @@
+@echo off
+
+SET BAT_DIR=%~dp0
+
+set PECL_RSS_CMD=c:\php-sdk\php\php.exe -d extension_dir=c:\php-sdk\php\ext -d
extension=php_openssl.dll -d extension=php_curl.dll -d extension=php_sqlite3.dll -d
date.timezone=UTC
+
+if "%1"=="" goto :help
+if "%1"=="--help" goto :help
+if "%1"=="-h" goto :help
+if "%1"=="/?" goto :help
+goto :skip_help
+
+:help
+%PECL_RSS_CMD% %BAT_DIR%\..\script\pecl_rss.php
+GOTO EXIT_LOCKED
+
+:skip_help
+
+
+%PECL_RSS_CMD% %BAT_DIR%\..\script\pecl_rss.php %*
+
+:EXIT_LOCKED
+echo .
+
diff --git a/client/bin/pecl_rss_task.bat b/client/bin/pecl_rss_task.bat
new file mode 100644
index 0000000..2d88d2d
--- /dev/null
+++ b/client/bin/pecl_rss_task.bat
@@ -0,0 +1,44 @@
+@echo off
+
+SET BAT_DIR=%~dp0
+
+set LOG_FILE=c:\php-sdk\logs\task-pecl-rss.log
+
+set PECL_RSS_CMD=c:\php-sdk\php\php.exe -d extension_dir=c:\php-sdk\php\ext -d
extension=php_openssl.dll -d extension=php_curl.dll -d extension=php_sqlite3.dll -d
date.timezone=UTC %BAT_DIR%\..\script\pecl_rss.php %* >> %LOG_FILE% 2<&1
+
+
+if "%1"=="" goto :help
+if "%1"=="--help" goto :help
+if "%1"=="-h" goto :help
+if "%1"=="/?" goto :help
+goto :skip_help
+
+:help
+echo ==========================================================
+echo This is the PECL RSS task script. You can see the help
+echo output of the underlaying worker below. This script will
+echo fetch the items from the current RSS feed, download and
+echo put them into the build queue.
+echo ==========================================================
+call %BAT_DIR%pecl_rss.bat
+GOTO EXIT_LOCKED
+
+:skip_help
+
+IF EXIST c:\php-sdk\locks\pecl-rss.lock (
+ECHO Pecl build script is already running.
+GOTO EXIT_LOCKED
+)
+
+ECHO running > c:\php-sdk\locks\pecl-rss.lock
+
+
+call %BAT_DIR%pecl_rss.bat %* >> %LOG_FILE% 2<&1
+
+echo Done.>> %LOG_FILE%
+
+del c:\php-sdk\locks\pecl-rss.lock >> %LOG_FILE% 2<&1
+
+:EXIT_LOCKED
+echo .
+