Merge pull request #1 from abbodi1406/master

Add packsgen.php
This commit is contained in:
luzea 2021-01-21 18:45:11 +01:00 committed by GitHub
commit 2afb15daa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 26 deletions

View File

@ -25,14 +25,16 @@ foreach($fetchedUpdate['updateArray'] as $update) {
generatePack($update['updateId']); generatePack($update['updateId']);
} }
echo $fetchedUpdate['foundBuild']; foreach($fetchedUpdate['updateArray'] as $update) {
echo $update['foundBuild'];
echo '|'; echo '|';
echo $fetchedUpdate['arch']; echo $update['arch'];
echo '|'; echo '|';
echo $fetchedUpdate['updateId']; echo $update['updateId'];
echo '|'; echo '|';
echo $fetchedUpdate['updateTitle']; echo $update['updateTitle'];
echo '|'; echo '|';
echo $fetchedUpdate['fileWrite']; echo $update['fileWrite'];
echo "\n"; echo "\n";
}
?> ?>

View File

@ -15,14 +15,16 @@ if(isset($fetchedUpdate['error'])) {
throwError($fetchedUpdate['error']); throwError($fetchedUpdate['error']);
} }
echo $fetchedUpdate['foundBuild']; foreach($fetchedUpdate['updateArray'] as $update) {
echo $update['foundBuild'];
echo '|'; echo '|';
echo $fetchedUpdate['arch']; echo $update['arch'];
echo '|'; echo '|';
echo $fetchedUpdate['updateId']; echo $update['updateId'];
echo '|'; echo '|';
echo $fetchedUpdate['updateTitle']; echo $update['updateTitle'];
echo '|'; echo '|';
echo $fetchedUpdate['fileWrite']; echo $update['fileWrite'];
echo "\n"; echo "\n";
}
?> ?>

16
packsgen.php Normal file
View File

@ -0,0 +1,16 @@
<?php
require_once dirname(__FILE__).'/api/listid.php';
require_once dirname(__FILE__).'/shared/main.php';
require_once dirname(__FILE__).'/shared/genpack.php';
consoleLogger(brand('listid'));
$ids = uupListIds();
if(isset($ids['error'])) {
throwError($ids['error']);
}
foreach($ids['builds'] as $val) {
generatePack($val['uuid']);
}
?>

View File

@ -26,10 +26,12 @@ function generatePack($updateId) {
return 2; return 2;
} }
if($updateId == 'd7ac1db8-230e-47df-8e6f-49fb976f6f5c') return 2;
consoleLogger('Generating packs for '.$updateId.'...'); consoleLogger('Generating packs for '.$updateId.'...');
$files = uupGetFiles($updateId, 0, 0); $files = uupGetFiles($updateId, 0, 0);
if(isset($files['error'])) { if(isset($files['error'])) {
throwError($files['error']); return 0;
} }
$files = $files['files']; $files = $files['files'];
@ -58,7 +60,7 @@ function generatePack($updateId) {
$files = preg_grep('/Path = /', $out); $files = preg_grep('/Path = /', $out);
$files = preg_replace('/Path = /', '', $files); $files = preg_replace('/Path = /', '', $files);
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\./i', $files); $dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\./i', $files);
unset($out); unset($out);
exec("$z7z x -o\"$tmp\" \"$loc\" -y", $out, $errCode); exec("$z7z x -o\"$tmp\" \"$loc\" -y", $out, $errCode);
@ -78,7 +80,7 @@ function generatePack($updateId) {
throwError('7ZIP_ERROR'); throwError('7ZIP_ERROR');
} }
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\./i', $out); $temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\.|^-.*ServerTargetCompDB_.*_.*\./i', $out);
sort($temp); sort($temp);
$temp = preg_replace('/^- /', '', $temp[0]); $temp = preg_replace('/^- /', '', $temp[0]);
@ -132,8 +134,8 @@ function generatePack($updateId) {
$file = $tmp.'/'.$val; $file = $tmp.'/'.$val;
$xml = simplexml_load_file($file); $xml = simplexml_load_file($file);
$lang = preg_replace('/.*DesktopTargetCompDB_.*_/', '', $filNam); $lang = preg_replace('/.*DesktopTargetCompDB_.*_|.*ServerTargetCompDB_.*_/', '', $filNam);
$edition = preg_replace('/.*DesktopTargetCompDB_|_'.$lang.'/', '', $filNam); $edition = preg_replace('/.*DesktopTargetCompDB_|.*ServerTargetCompDB_|_'.$lang.'/', '', $filNam);
$lang = strtolower($lang); $lang = strtolower($lang);
$edition = strtoupper($edition); $edition = strtoupper($edition);

View File

@ -2,7 +2,7 @@
require_once dirname(__FILE__).'/../api/shared/main.php'; require_once dirname(__FILE__).'/../api/shared/main.php';
function brand($script = null) { function brand($script = null) {
$projVersion = '1.0.1'; $projVersion = '1.0.2';
return 'UUP dump standalone v'.$projVersion; return 'UUP dump standalone v'.$projVersion;
} }