Add support for WCOS ReleaseType

This commit is contained in:
abbodi1406 2021-02-06 16:28:40 +03:00
parent 088cea8302
commit 0c0318fc65
4 changed files with 40 additions and 8 deletions

View File

@ -5,6 +5,7 @@ $flight = isset($argv[3]) ? $argv[3] : 'Active';
$build = isset($argv[4]) ? intval($argv[4]) : 16251;
$minor = isset($argv[5]) ? intval($argv[5]) : 0;
$sku = isset($argv[6]) ? intval($argv[6]) : 48;
$type = isset($argv[7]) ? $argv[7] : 'Production';
require_once dirname(__FILE__).'/api/fetchupd.php';
require_once dirname(__FILE__).'/shared/main.php';
@ -16,7 +17,7 @@ if(!get7ZipLocation()) {
throwError('NO_7ZIP');
}
$fetchedUpdate = uupFetchUpd($arch, $ring, $flight, $build, $minor, $sku);
$fetchedUpdate = uupFetchUpd($arch, $ring, $flight, $build, $minor, $sku, $type);
if(isset($fetchedUpdate['error'])) {
throwError($fetchedUpdate['error']);
}

View File

@ -5,12 +5,13 @@ $flight = isset($argv[3]) ? $argv[3] : 'Active';
$build = isset($argv[4]) ? intval($argv[4]) : 16251;
$minor = isset($argv[5]) ? intval($argv[5]) : 0;
$sku = isset($argv[6]) ? intval($argv[6]) : 48;
$type = isset($argv[7]) ? $argv[7] : 'Production';
require_once dirname(__FILE__).'/api/fetchupd.php';
require_once dirname(__FILE__).'/shared/main.php';
consoleLogger(brand('fetchupd'));
$fetchedUpdate = uupFetchUpd($arch, $ring, $flight, $build, $minor, $sku);
$fetchedUpdate = uupFetchUpd($arch, $ring, $flight, $build, $minor, $sku, $type);
if(isset($fetchedUpdate['error'])) {
throwError($fetchedUpdate['error']);
}

View File

@ -60,7 +60,7 @@ function generatePack($updateId) {
$files = preg_grep('/Path = /', $out);
$files = preg_replace('/Path = /', '', $files);
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\./i', $files);
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\.|ModernPCTargetCompDB_.*\.|HolographicTargetCompDB_.*\./i', $files);
unset($out);
exec("$z7z x -o\"$tmp\" \"$loc\" -y", $out, $errCode);
@ -80,7 +80,7 @@ function generatePack($updateId) {
throwError('7ZIP_ERROR');
}
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\.|^-.*ServerTargetCompDB_.*_.*\./i', $out);
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\.|^-.*ServerTargetCompDB_.*_.*\.|^-.*ModernPCTargetCompDB_.*\.|^-.*HolographicTargetCompDB_.*\./i', $out);
sort($temp);
$temp = preg_replace('/^- /', '', $temp[0]);
@ -94,7 +94,7 @@ function generatePack($updateId) {
unlink($loc);
unset($loc, $checkFile, $checkEd, $dataFiles);
} else {
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\./i', $filesKeys);
$dataFiles = preg_grep('/DesktopTargetCompDB_.*_.*\.|ServerTargetCompDB_.*_.*\.|ModernPCTargetCompDB\.|HolographicTargetCompDB\./i', $filesKeys);
foreach($dataFiles as $val) {
$url = $files[$val]['url'];
@ -113,7 +113,7 @@ function generatePack($updateId) {
throwError('7ZIP_ERROR');
}
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\./i', $out);
$temp = preg_grep('/^-.*DesktopTargetCompDB_.*_.*\.|^-.*ServerTargetCompDB_.*_.*\.|^-.*ModernPCTargetCompDB\.|^-.*HolographicTargetCompDB\./i', $out);
sort($temp);
$temp = preg_replace('/^- /', '', $temp[0]);
@ -127,6 +127,12 @@ function generatePack($updateId) {
unset($loc, $checkEd, $dataFiles);
}
$keepPath = 0;
foreach($filesKeys as $val) {
if(preg_match('/^appx\/(.*?)\//i', $val)) $keepPath = 1;
if(preg_match('/^(retail)\/(.{3,5})\/fre\//i', $val)) $keepPath = 1;
}
$langsEditions = array();
$packages = array();
foreach($filesToRead as $val) {
@ -136,6 +142,14 @@ function generatePack($updateId) {
$lang = preg_replace('/.*DesktopTargetCompDB_.*_|.*ServerTargetCompDB_.*_/', '', $filNam);
$edition = preg_replace('/.*DesktopTargetCompDB_|.*ServerTargetCompDB_|_'.$lang.'/', '', $filNam);
if($sku == 189) {
$lang = 'en-us';
$edition = 'Lite';
}
if($sku == 135) {
$lang = 'en-us';
$edition = 'Holographic';
}
$lang = strtolower($lang);
$edition = strtoupper($edition);
@ -143,7 +157,23 @@ function generatePack($updateId) {
foreach($xml->Packages->Package as $val) {
foreach($val->Payload->PayloadItem as $PayloadItem) {
$name = $PayloadItem['Path'];
$name = preg_replace('/.*\\\/', '', $name);
if($keepPath) {
$name = str_replace('\\', '_', $name);
} else {
$name = preg_replace('/.*\\\/', '', $name);
}
$packages[$lang][$edition][] = $name;
}
}
if(@count($xml->AppX)) foreach($xml->AppX->AppXPackages->Package as $val) {
foreach($val->Payload->PayloadItem as $PayloadItem) {
$name = $PayloadItem['Path'];
if($keepPath) {
$name = str_replace('\\', '_', $name);
} else {
$name = preg_replace('/.*\\\/', '', $name);
}
$packages[$lang][$edition][] = $name;
}
}

View File

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