mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-20 21:08:54 +01:00
"automatic updating version number in .dsc and .spec files"
This commit is contained in:
parent
96f65d0936
commit
03b2acde59
@ -20,15 +20,15 @@ $config = array(
|
|||||||
'version' => '9.2', // '1.6'
|
'version' => '9.2', // '1.6'
|
||||||
'packaging' => date('Ymd'), // '001'
|
'packaging' => date('Ymd'), // '001'
|
||||||
'egwdir' => 'egroupware',
|
'egwdir' => 'egroupware',
|
||||||
'svndir' => '/tmp/build_root/epl_buildroot-svn',
|
'svndir' => '/tmp/build_root/epl_9.2_buildroot-svn',
|
||||||
'egw_buildroot' => '/tmp/build_root/epl_buildroot',
|
'egw_buildroot' => '/tmp/build_root/epl_9.2_buildroot',
|
||||||
'sourcedir' => '/srv/obs/download/stylite-epl/egroupware-epl-9.1',
|
'sourcedir' => '/srv/obs/download/stylite-epl/egroupware-epl-9.2',
|
||||||
'svnbase' => 'svn+ssh://stylite@svn.stylite.de/stylite',
|
'svnbase' => 'svn+ssh://stylite@svn.stylite.de/stylite',
|
||||||
'egwbase' => 'svn+ssh://svn@dev.egroupware.org/egroupware',
|
'egwbase' => 'svn+ssh://svn@dev.egroupware.org/egroupware',
|
||||||
'svnbranch' => 'branches/Stylite-EPL-9.2', // 'branches/1.6' or 'tags/1.6.001'
|
'svnbranch' => 'branches/Stylite-EPL-9.2', // 'branches/1.6' or 'tags/1.6.001'
|
||||||
'svnalias' => 'epl-ssh', // default alias
|
'svnalias' => 'epl-ssh', // default alias
|
||||||
'aliasdir' => 'egroupware', // directory created by the alias
|
'aliasdir' => 'egroupware', // directory created by the alias
|
||||||
'extra' => array('stylite','$egwbase/$svnbranch/egw-pear','$egwbase/$svnbranch/gallery','$egwbase/$svnbranch/phpfreechat'),
|
'extra' => array('stylite','$egwbase/$svnbranch/egw-pear','$egwbase/$svnbranch/gallery','$egwbase/$svnbranch/phpfreechat','svn+ssh://stylite@svn.stylite.de/stylite/trunk/eventmgr'),
|
||||||
'types' => array('tar.bz2','tar.gz','zip'),
|
'types' => array('tar.bz2','tar.gz','zip'),
|
||||||
'svn' => '/usr/bin/svn',
|
'svn' => '/usr/bin/svn',
|
||||||
'clamscan' => '/usr/bin/clamscan',
|
'clamscan' => '/usr/bin/clamscan',
|
||||||
@ -125,8 +125,10 @@ function do_obs()
|
|||||||
$n = 0;
|
$n = 0;
|
||||||
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($config['obs'])) as $path)
|
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($config['obs'])) as $path)
|
||||||
{
|
{
|
||||||
if (basename(dirname($path)) != '.osc' &&
|
if (basename(dirname($path)) == '.osc') continue;
|
||||||
preg_match('/\/('.preg_quote($config['packagename']).'[a-z-]*)-'.preg_quote($config['version']).'\.[0-9]+(\.tar\.(gz|bz2))$/',$path,$matches) &&
|
if (!preg_match('/\/'.preg_quote($config['packagename']).'[a-z-]*-'.preg_quote($config['version']).'/',$path)) continue;
|
||||||
|
|
||||||
|
if (preg_match('/\/('.preg_quote($config['packagename']).'[a-z-]*)-'.preg_quote($config['version']).'\.[0-9]+(\.tar\.(gz|bz2))$/',$path,$matches) &&
|
||||||
file_exists($new_name=$config['sourcedir'].'/'.$matches[1].'-'.$config['version'].'.'.$config['packaging'].$matches[2]))
|
file_exists($new_name=$config['sourcedir'].'/'.$matches[1].'-'.$config['version'].'.'.$config['packaging'].$matches[2]))
|
||||||
{
|
{
|
||||||
if (basename($path) != basename($new_name))
|
if (basename($path) != basename($new_name))
|
||||||
@ -138,6 +140,25 @@ function do_obs()
|
|||||||
if ($verbose) echo "cp $new_name ".dirname($path)."/\n";
|
if ($verbose) echo "cp $new_name ".dirname($path)."/\n";
|
||||||
++$n;
|
++$n;
|
||||||
}
|
}
|
||||||
|
// updating dsc and spec files
|
||||||
|
if (substr($path,-4) == '.dsc' || substr($path,-5) == '.spec')
|
||||||
|
{
|
||||||
|
$content = $content_was = file_get_contents($path);
|
||||||
|
$content = preg_replace('/^Version: '.preg_quote($config['version']).'\.[0-9]+/m','Version: '.$config['version'].'.'.$config['packaging'],$content);
|
||||||
|
|
||||||
|
if (substr($path,-4) == '.dsc')
|
||||||
|
{
|
||||||
|
$content = preg_replace('/^(Debtransform-Tar: '.preg_quote($config['packagename']).'[a-z-]*)-'.
|
||||||
|
preg_quote($config['version']).'\.[0-9]+(\.tar\.(gz|bz2))$/m',
|
||||||
|
'\\1-'.$config['version'].'.'.$config['packaging'].'\\2',$content);
|
||||||
|
}
|
||||||
|
if ($content != $content_was)
|
||||||
|
{
|
||||||
|
file_put_contents($path,$content);
|
||||||
|
if ($verbose) echo "Updated $path\n";
|
||||||
|
++$n;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($n)
|
if ($n)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user