Add packsgen.php

generate missing packs based on fileinfo builds, skipping unreachable builds
This commit is contained in:
abbodi1406 2021-01-21 20:35:43 +03:00
parent 3506fdfd7f
commit 1c68d4c8c2
5 changed files with 48 additions and 26 deletions

View File

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

View File

@ -15,14 +15,16 @@ if(isset($fetchedUpdate['error'])) {
throwError($fetchedUpdate['error']);
}
echo $fetchedUpdate['foundBuild'];
echo '|';
echo $fetchedUpdate['arch'];
echo '|';
echo $fetchedUpdate['updateId'];
echo '|';
echo $fetchedUpdate['updateTitle'];
echo '|';
echo $fetchedUpdate['fileWrite'];
echo "\n";
foreach($fetchedUpdate['updateArray'] as $update) {
echo $update['foundBuild'];
echo '|';
echo $update['arch'];
echo '|';
echo $update['updateId'];
echo '|';
echo $update['updateTitle'];
echo '|';
echo $update['fileWrite'];
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;
}
if($updateId == 'd7ac1db8-230e-47df-8e6f-49fb976f6f5c') return 2;
consoleLogger('Generating packs for '.$updateId.'...');
$files = uupGetFiles($updateId, 0, 0);
if(isset($files['error'])) {
throwError($files['error']);
return 0;
}
$files = $files['files'];
@ -58,7 +60,7 @@ function generatePack($updateId) {
$files = preg_grep('/Path = /', $out);
$files = preg_replace('/Path = /', '', $files);
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\./i', $files);
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\./i', $files);
unset($out);
exec("$z7z x -o\"$tmp\" \"$loc\" -y", $out, $errCode);
@ -78,7 +80,7 @@ function generatePack($updateId) {
throwError('7ZIP_ERROR');
}
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\./i', $out);
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\.|^-.*ServerTargetCompDB_.*_.*\./i', $out);
sort($temp);
$temp = preg_replace('/^- /', '', $temp[0]);
@ -132,8 +134,8 @@ function generatePack($updateId) {
$file = $tmp.'/'.$val;
$xml = simplexml_load_file($file);
$lang = preg_replace('/.*DesktopTargetCompDB_.*_/', '', $filNam);
$edition = preg_replace('/.*DesktopTargetCompDB_|_'.$lang.'/', '', $filNam);
$lang = preg_replace('/.*DesktopTargetCompDB_.*_|.*ServerTargetCompDB_.*_/', '', $filNam);
$edition = preg_replace('/.*DesktopTargetCompDB_|.*ServerTargetCompDB_|_'.$lang.'/', '', $filNam);
$lang = strtolower($lang);
$edition = strtoupper($edition);

View File

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