aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2014-06-15 18:18:55 +0200
committerManuel Hiebel <leuhmanu@mageia.org>2014-06-15 18:18:55 +0200
commit9a48117e8c00a92152bb5188ff6ef4ed37f5d8da (patch)
treec354f81d8d39c59f5cc2c07b6736d29b9d0f7931 /lib
parent9328a596f4a4c16342f73f085a770267ca538fc2 (diff)
downloadfidd-9a48117e8c00a92152bb5188ff6ef4ed37f5d8da.tar
fidd-9a48117e8c00a92152bb5188ff6ef4ed37f5d8da.tar.gz
fidd-9a48117e8c00a92152bb5188ff6ef4ed37f5d8da.tar.bz2
fidd-9a48117e8c00a92152bb5188ff6ef4ed37f5d8da.tar.xz
fidd-9a48117e8c00a92152bb5188ff6ef4ed37f5d8da.zip
-Fix regex for comming 4.1 release
-Fix torrents path for stable release
Diffstat (limited to 'lib')
-rw-r--r--lib/FIDD.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/FIDD.php b/lib/FIDD.php
index 8cf78fe..f224796 100644
--- a/lib/FIDD.php
+++ b/lib/FIDD.php
@@ -99,7 +99,7 @@ class FIDD
*/
private static function rsync_get_filesizes($url)
{
- $cmd = sprintf('/usr/bin/rsync -a --list-only %s | awk \'{print $2"\t"$5}\'',
+ $cmd = sprintf('/usr/bin/rsync -a --list-only --no-h %s | awk \'{print $2"\t"$5}\'',
escapeshellarg($url));
$isos = array();
@@ -157,7 +157,10 @@ class FIDD
$ret['release'] == '' ? sprintf('iso/%s', $ret['version']) : 'iso/cauldron',
str_replace('.iso', '', $data['file'])
);
- $data['torrent'] = sprintf('iso/cauldron/torrents/%s', str_replace('.iso', '.torrent', $data['file']));
+ $data['torrent'] = sprintf('%s/%s',
+ $ret['release'] == '' ? sprintf('iso/%s/torrents', $ret['version']) : 'iso/cauldron',
+ str_replace('.iso', '.torrent', $data['file'])
+ );
$data['name'] = str_replace(array('-', '.iso', 'i586', 'x86_64'), array(' ', '', '32bit', '64bit'), $data['file']);
$data['size'] = $filesizes[$data['file']];
@@ -196,7 +199,7 @@ class FIDD
*/
public static function is_correct_name($s)
{
- $re = '/^(Mageia)-(\d+)(-(alpha|beta|RC|rc)(\d*))?(-(.*))?-(i586|x86_64|dual)?(-(CD|DVD|BR))?(-(build\_\w+))?\.(.*)$/';
+ $re = '/^(Mageia)-(\d+(.\d)?)(-(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],
@@ -212,4 +215,4 @@ class FIDD
}
return false;
}
-} \ No newline at end of file
+}