From 7ed7f1467fbff237286cfc11a7dcc74ecaf3c711 Mon Sep 17 00:00:00 2001 From: JF Denise Date: Thu, 10 Dec 2020 10:04:27 +0100 Subject: [PATCH] Fix for GAL-326, GAV based FP breaks update --- .../java/org/jboss/galleon/cli/cmd/state/StateInfoUtil.java | 4 ++-- core/src/main/java/org/jboss/galleon/universe/Channel.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/src/main/java/org/jboss/galleon/cli/cmd/state/StateInfoUtil.java b/cli/src/main/java/org/jboss/galleon/cli/cmd/state/StateInfoUtil.java index 0f9918508..781edc8f7 100644 --- a/cli/src/main/java/org/jboss/galleon/cli/cmd/state/StateInfoUtil.java +++ b/cli/src/main/java/org/jboss/galleon/cli/cmd/state/StateInfoUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 Red Hat, Inc. and/or its affiliates + * Copyright 2016-2020 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -629,7 +629,7 @@ public static String buildOptions(ResolvedPlugins plugins) { public static String formatChannel(FeaturePackLocation loc) { String channel = loc.getFrequency() == null ? loc.getChannel().getName() : loc.getChannel().getName() + "/" + loc.getFrequency(); - return (loc.getUniverse() == null ? "" : loc.getUniverse() + "@") + channel; + return (loc.getUniverse() == null ? "" : loc.getUniverse() + "@") + (channel == null ? "" : channel); } private static String buildOptionsTable(Set options) { diff --git a/core/src/main/java/org/jboss/galleon/universe/Channel.java b/core/src/main/java/org/jboss/galleon/universe/Channel.java index aa71ae522..a5a3ed8aa 100644 --- a/core/src/main/java/org/jboss/galleon/universe/Channel.java +++ b/core/src/main/java/org/jboss/galleon/universe/Channel.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 Red Hat, Inc. and/or its affiliates + * Copyright 2016-2020 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,7 +50,7 @@ default FeaturePackUpdatePlan getUpdatePlan(FeaturePackUpdatePlan.Request update } catch(LatestVersionNotAvailableException e) { // that also means no update } - if (latestBuild != null && !(latestBuild.equals(fpl.getBuild()))) { + if (latestBuild != null && !latestBuild.isEmpty() && !(latestBuild.equals(fpl.getBuild()))) { updateRequest.setNewLocation(fpl.replaceBuild(latestBuild)); } return updateRequest.buildPlan();