System.out.println("Installing feature " + feature.getName() + " " + feature.getVersion());
}
for (Feature dependency : feature.getDependencies()) {
VersionRange range = FeatureImpl.DEFAULT_VERSION.equals(dependency.getVersion())
? VersionRange.ANY_VERSION : new VersionRange(dependency.getVersion(), true, true);
Feature fi = null;
for (Feature f : installed.keySet()) {
if (f.getName().equals(dependency.getName())) {
Version v = VersionTable.getVersion(f.getVersion());
if (range.contains(v)) {
if (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0) {
fi = f;
}
}
}
}
if (fi == null) {
Map<String, Feature> avail = getFeatures().get(dependency.getName());
if (avail != null) {
for (Feature f : avail.values()) {
Version v = VersionTable.getVersion(f.getVersion());
if (range.contains(v)) {
if (fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0) {
fi = f;
}
}
}
}
}
if (fi == null) {
throw new Exception("No feature named '" + dependency.getName()
+ "' with version '" + dependency.getVersion() + "' available");
}
if (state.features.containsKey(fi)) {
LOGGER.debug("Feature {} with version {} is already being installed", feature.getName(), feature.getVersion());
} else {
if (!(fi.getName().equals(feature.getName())
&& fi.getVersion().equals(feature.getVersion()))) {
doInstallFeature(state, fi, verbose);
}
}
}
for (String config : feature.getConfigurations().keySet()) {