From 9a48117e8c00a92152bb5188ff6ef4ed37f5d8da Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Sun, 15 Jun 2014 18:18:55 +0200 Subject: -Fix regex for comming 4.1 release -Fix torrents path for stable release --- lib/FIDD.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') 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 +} -- cgit v1.2.1