parameter to copy changelog automatically eg. to sf.net

This commit is contained in:
Ralf Becker 2011-02-16 10:06:48 +00:00
parent 75ec08885a
commit 56b933e06d

View File

@ -42,8 +42,9 @@ $config = array(
'editor' => '/usr/bin/vi',
'svntag' => 'tags/$version.$packaging', // eg. '$version.$packaging'
'release' => 'ralfbecker,egroupware@frs.sourceforge.net:/home/frs/project/e/eg/egroupware/eGroupware-$version/eGroupware-$version.$packaging/',
'copychangelog' => 'ralfbecker,egroupware@frs.sourceforge.net:/home/frs/project/e/eg/egroupware/README',
'skip' => array(),
'run' => array('editsvnchangelog','svntag','checkout','copy','virusscan','create','sign','obs','release')
'run' => array('editsvnchangelog','svntag','checkout','copy','virusscan','create','sign','obs','release','copychangelog')
);
// process config from command line
@ -85,6 +86,7 @@ while(($arg = array_shift($argv)))
case 'svntag':
case 'release':
case 'copychangelog':
$config[$name] = $value;
array_unshift($config['run'],$name);
break;
@ -145,6 +147,25 @@ function do_release()
passthru($cmd);
}
/**
* Copy changelog by rsync'ing it to a distribution / download directory
*/
function do_copychangelog()
{
global $config,$verbose;
$changelog = __DIR__.'/debian.changes';
$target = $config['copychangelog'];
if (strpos($target,'$') !== false) // allow to use config vars like $svnbranch in module
{
$translate = array();
foreach($config as $name => $value) $translate['$'.$name] = $value;
$target = strtr($target,$translate);
}
$cmd = $config['rsync'].' '.$changelog.' '.$target;
passthru($cmd);
}
/**
* Query changelog from svn and let user edit it
*/
@ -278,7 +299,7 @@ function get_last_svn_tag($tags_url,$pattern,&$matches=null)
{
global $config,$verbose,$svn;
$cmd = $svn.' log --xml --limit 10 '.escapeshellarg($tags_url);
$cmd = $svn.' log --xml --limit 20 '.escapeshellarg($tags_url);
if (($v = $verbose))
{
echo "Querying SVN for last tags\n$cmd\n";