Merge pull request #12 from ThomasRubini/arch_fixup
This commit is contained in:
		
						commit
						bc5b41122c
					
				| @ -107,8 +107,9 @@ public class ArchDistribution implements Distribution { | ||||
|                 // unknown package, probably an abstract dependency | ||||
|                 logger.fine("Completing callback INVALID for package %s (depth=%s)".formatted(packageName, depth)); | ||||
|                 futurePackage.complete(null); | ||||
|                 return; | ||||
|             } | ||||
|             JSONObject resultJson = json.getJSONArray("results").getJSONObject(0); | ||||
|             JSONObject resultJson = resultsArrayJson.getJSONObject(0); | ||||
| 
 | ||||
|             // get infos except dependencies | ||||
|             name = resultJson.getString("pkgname"); | ||||
| @ -120,7 +121,8 @@ public class ArchDistribution implements Distribution { | ||||
|             if(depth==0) { | ||||
|                 logger.fine("Completing callback NODEP for package %s (depth=%s)".formatted(packageName, depth)); | ||||
|                 futurePackage.complete(new Package(name, version, repo, description, Collections.emptyList())); | ||||
|             } else { | ||||
|                 return; | ||||
|             } | ||||
|             // iterate for every package in the list | ||||
|             List<CompletableFuture<Package>> futureDeps = new ArrayList<>(); | ||||
|             for (Object depPackageNameObj : resultJson.getJSONArray("depends")) { | ||||
| @ -140,7 +142,6 @@ public class ArchDistribution implements Distribution { | ||||
|             // TODO this doesn't seem clean | ||||
|             logger.fine("Completing callback DEPS for package %s (depth=%s)".formatted(packageName, depth)); | ||||
|             futurePackage.complete(new Package(name, version, repo, description, deps)); | ||||
|             } | ||||
|         }).exceptionally((e2->{ | ||||
|             logger.warning("Error while fetching package %s (depth=%s) from the API : \n%s".formatted(packageName, depth, e2)); | ||||
|             e2.printStackTrace(); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user