forked from uup-dump/api
		
	Ignore updates which do not have architecture and build specified
This commit is contained in:
		
							
								
								
									
										21
									
								
								fetchupd.php
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								fetchupd.php
									
									
									
									
									
								
							| @@ -43,15 +43,7 @@ function uupFetchUpd( | |||||||
|             $ids['builds'] = array(); |             $ids['builds'] = array(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         $ids = $ids['builds']; |         $build = $ids['builds'][0]['build']; | ||||||
|         foreach($ids as $val) { |  | ||||||
|             $builds[] = $val['build']; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         $builds = array_unique($builds); |  | ||||||
|         rsort($builds); |  | ||||||
|  |  | ||||||
|         $build = $builds[0]; |  | ||||||
|         unset($builds, $ids); |         unset($builds, $ids); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -193,9 +185,9 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     preg_match('/ProductReleaseInstalled Name\="(.*?)\..*\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info); |     preg_match('/ProductReleaseInstalled Name\="(.*?)\..*\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info); | ||||||
|     $foundType = strtolower($info[1]); |     $foundType = @strtolower($info[1]); | ||||||
|     $foundArch = strtolower($info[2]); |     $foundArch = @strtolower($info[2]); | ||||||
|     $foundBuild = $info[3]; |     $foundBuild = @$info[3]; | ||||||
|  |  | ||||||
|     $updateTitle = preg_grep('/<Title>.*<\/Title>/', $updateMeta); |     $updateTitle = preg_grep('/<Title>.*<\/Title>/', $updateMeta); | ||||||
|     sort($updateTitle); |     sort($updateTitle); | ||||||
| @@ -267,6 +259,11 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku | |||||||
|     consoleLogger("Update ID:    ".$updateString); |     consoleLogger("Update ID:    ".$updateString); | ||||||
|     consoleLogger("--- UPDATE INFORMATION ---"); |     consoleLogger("--- UPDATE INFORMATION ---"); | ||||||
|  |  | ||||||
|  |     if((!$foundBuild) && (!$foundArch)) { | ||||||
|  |         consoleLogger('No architecture nor build number specified! What the hell is this?'); | ||||||
|  |         return array('error' => 'BROKEN_UPDATE'); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     if(preg_match('/Corpnet Required/i', $updateTitle)) { |     if(preg_match('/Corpnet Required/i', $updateTitle)) { | ||||||
|         consoleLogger('Skipping corpnet only update...'); |         consoleLogger('Skipping corpnet only update...'); | ||||||
|         return array('error' => 'CORPNET_ONLY_UPDATE'); |         return array('error' => 'CORPNET_ONLY_UPDATE'); | ||||||
|   | |||||||
| @@ -16,7 +16,7 @@ limitations under the License. | |||||||
| */ | */ | ||||||
|  |  | ||||||
| function uupApiVersion() { | function uupApiVersion() { | ||||||
|     return '1.27.1'; |     return '1.27.2'; | ||||||
| } | } | ||||||
|  |  | ||||||
| require_once dirname(__FILE__).'/auths.php'; | require_once dirname(__FILE__).'/auths.php'; | ||||||
|   | |||||||
| @@ -108,6 +108,10 @@ function branchFromBuild($build) { | |||||||
|             $branch = '19h1_release'; |             $branch = '19h1_release'; | ||||||
|             break; |             break; | ||||||
|  |  | ||||||
|  |         case 18363: //18363 is a fake build based on 18362 | ||||||
|  |             $branch = '19h1_release'; | ||||||
|  |             break; | ||||||
|  |  | ||||||
|         default: |         default: | ||||||
|             $branch = 'rs_prerelease'; |             $branch = 'rs_prerelease'; | ||||||
|             break; |             break; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user