mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
added parameter to run a command after copying checkout to buildroot, eg. to apply a patch or replace some files
This commit is contained in:
parent
18d45e9614
commit
1e80d9705d
@ -11,7 +11,7 @@
|
||||
|
||||
if (isset($_SERVER['HTTP_HOST'])) // security precaution: forbit calling setup-cli as web-page
|
||||
{
|
||||
die('<h1>checkout-build-tgz.php must NOT be called as web-page --> exiting !!!</h1>');
|
||||
die('<h1>checkout-build-archives.php must NOT be called as web-page --> exiting !!!</h1>');
|
||||
}
|
||||
date_default_timezone_set('Europe/Berlin'); // to get ride of 5.3 warnings
|
||||
|
||||
@ -46,7 +46,8 @@ $config = array(
|
||||
'release' => 'root@download.stylite.de:/var/www/html/stylite-epl/stylite-epl-$version/',
|
||||
'copychangelog' => 'root@download.stylite.de:/var/www/html/stylite-epl/stylite-epl-$version/changelog.txt',
|
||||
'skip' => array(),
|
||||
'run' => array('editsvnchangelog','svntag','checkout','copy','virusscan','create','sign','obs')
|
||||
'run' => array('editsvnchangelog','svntag','checkout','copy','virusscan','create','sign','obs'),
|
||||
'patchCmd' => '# run cmd after copy eg. "cd $egw_buildroot; patch -p1 /path/to/patch"',
|
||||
);
|
||||
|
||||
// process config from command line
|
||||
@ -558,6 +559,17 @@ function do_copy()
|
||||
$cmd = '/usr/bin/rsync -r --delete --exclude .svn '.$config['svndir'].'/'.$config['aliasdir'].' '.$config['egw_buildroot'];
|
||||
run_cmd($cmd);
|
||||
|
||||
if (($cmd = $config['patchCmd']) && $cmd[0] != '#')
|
||||
{
|
||||
if (strpos($cmd,'$') !== false) // allow to use config vars like $svnbranch in module
|
||||
{
|
||||
$translate = array();
|
||||
foreach($config as $name => $value) $translate['$'.$name] = $value;
|
||||
$cmd = strtr($cmd,$translate);
|
||||
}
|
||||
echo "Running $cmd\n";
|
||||
run_cmd($cmd);
|
||||
}
|
||||
// fix permissions
|
||||
echo "Fixing permissions\n";
|
||||
chdir($config['egw_buildroot'].'/'.$config['aliasdir']);
|
||||
|
Loading…
Reference in New Issue
Block a user