aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fidd.php8
-rw-r--r--lib/FIDD.php34
2 files changed, 28 insertions, 14 deletions
diff --git a/fidd.php b/fidd.php
index 62ad91d..a8462d8 100644
--- a/fidd.php
+++ b/fidd.php
@@ -14,12 +14,14 @@
// params
$prefix = '';
-$bcd_path = '8';
+$bcd_path = 'cauldron';
+
+$netinstall_rename = '9-alpha1';
//$bcd_url = 'rsync://isoqa@bcd.mageia.org/isos/%s/';
$bcd_url = 'rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/iso/%s/';
-$netinstall = 'rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/8/';
+$netinstall = 'rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/cauldron/';
// don't touch below
@@ -27,7 +29,7 @@ $ts0 = microtime(true);
require_once __DIR__ . '/lib/FIDD.php';
-FIDD::run(__DIR__, $netinstall, $prefix, true);
+FIDD::run(__DIR__, $netinstall, $prefix, true, $netinstall_rename);
FIDD::run(__DIR__, sprintf($bcd_url, $bcd_path), $prefix);
echo sprintf("done in %2.2f s.\n", microtime(true) - $ts0);
diff --git a/lib/FIDD.php b/lib/FIDD.php
index 655c5e1..6add12a 100644
--- a/lib/FIDD.php
+++ b/lib/FIDD.php
@@ -23,7 +23,7 @@ class FIDD
*
* @return boolean
*/
- public static function run($app_path, $url, $prefix, $netinstall = false)
+ public static function run($app_path, $url, $prefix, $netinstall = false, $netinstall_rename = '')
{
$tmp_path = $app_path . '/var/tmp';
@@ -38,7 +38,7 @@ class FIDD
if (!$netinstall) {
$info = self::build_definitions($prefix, $tmp_path, $filesizes);
} else {
- $info = self::build_definitions_net_install($prefix, $tmp_path, $filesizes);
+ $info = self::build_definitions_net_install($prefix, $tmp_path, $filesizes, $netinstall_rename);
}
self::save_definitions($info, $app_path . '/var/definitions');
@@ -215,7 +215,7 @@ class FIDD
*
* @return array
*/
- function build_definitions_net_install($prefix, $dir, $filesizes)
+ function build_definitions_net_install($prefix, $dir, $filesizes, $netinstall_rename)
{
$info = array();
$isos = glob($dir . '/*/install/images/');
@@ -243,13 +243,25 @@ class FIDD
if ( count($data) == 0) {
// skip the first one
} else if (null !== ($ret = self::is_correct_name($data['file']))) {
- $data['path'] = sprintf('%s/%s/install/images',
- $ret['release'] == '' ? sprintf('distrib/%s', $ret['version']) : sprintf('distrib/cauldron%s', $prefix),
- $ret['arch']
- );
- $data['name'] = str_replace(array('-', '.iso', 'i586', 'x86_64'), array(' ', '', '32bit', '64bit'), $data['file']);
- $data['size'] = $filesizes[$data['file']];
- $info[$data['file']] = $data;
+ if ($ret['version'] == 'Cauldron')
+ {
+ $rename = str_replace('Cauldron', $netinstall_rename, $data['file']);
+ $data['path'] = sprintf('%s/%s/install/images',
+ sprintf('distrib/cauldron%s', $prefix),
+ $ret['arch']
+ );
+ $data['name'] = str_replace(array('-', '.iso', 'i586', 'x86_64'), array(' ', '', '32bit', '64bit'), $rename);
+ $data['size'] = $filesizes[$data['file']];
+ $info[$rename] = $data;
+ } else {
+ $data['path'] = sprintf('%s/%s/install/images',
+ $ret['release'] == '' ? sprintf('distrib/%s', $ret['version']) : sprintf('distrib/cauldron%s', $prefix),
+ $ret['arch']
+ );
+ $data['name'] = str_replace(array('-', '.iso', 'i586', 'x86_64'), array(' ', '', '32bit', '64bit'), $data['file']);
+ $data['size'] = $filesizes[$data['file']];
+ $info[$data['file']] = $data;
+ }
} else {
$info['invalid'][] = $data;
}
@@ -284,7 +296,7 @@ class FIDD
*/
public static function is_correct_name($s)
{
- $re = '/^(Mageia)-(\d+(.\d)?)(-(alpha|beta|RC|rc)(\d*))?(-(.*))?-(i586|x86_64|dual)?(-(CD|DVD|BR))?(-(build\_\w+))?\.(.*)$/';
+ $re = '/^(Mageia)-(\d+(.\d)?|Cauldron)(-(alpha|beta|RC|rc)(\d*))?(-(.*))?-(i586|x86_64|dual)?(-(CD|DVD|BR))?(-(build\_\w+))?\.(.*)$/';
if (preg_match($re, $s, $arr)) {
$ret = array(
'name' => $arr[1],