Compare release versions by package creation date

This commit is contained in:
JFronny 2021-11-11 18:41:34 +01:00
parent 2be5da93e2
commit 5a61749aea
No known key found for this signature in database
GPG Key ID: BEC5ACBBD4EE17E5
2 changed files with 8 additions and 6 deletions

View File

@ -61,7 +61,7 @@ public class Inceptum {
}
}
if (cmd == null) {
System.out.println("Command not found");
System.out.println("Command not found: " + arg.command);
return;
}
if (cmd.enableLog()) {

View File

@ -25,17 +25,19 @@ public class UpdateChecker {
GitlabProject project = GitlabApi.getProject(PROJECT_ID);
PackageInfo experimental = null;
PackageInfo stable = null;
packageIter: for (PackageInfo info : GitlabApi.getPackages(project)) {
if (info.status.equals("default"))
for (PackageInfo info : GitlabApi.getPackages(project)) {
if (info.status.equals("default")) {
for (Pipeline pipeline : info.pipelines) {
if (pipeline.ref.equals("master") && pipeline.status.equals("success")) {
if (experimental == null) experimental = info;
if (!info.version.contains("+")) {
if (experimental == null || experimental.created_at.compareTo(pipeline.created_at) < 0) {
experimental = info;
}
if (!info.version.contains("+") && (stable == null || stable.created_at.compareTo(pipeline.created_at) < 0)) {
stable = info;
break packageIter;
}
}
}
}
}
if (experimental == null) {
throw new IOException("No version could be found");