diff --git a/rockcraft/src/main/java/com/canonical/rockcraft/builder/RockCrafter.java b/rockcraft/src/main/java/com/canonical/rockcraft/builder/RockCrafter.java index b436cf4..c004169 100644 --- a/rockcraft/src/main/java/com/canonical/rockcraft/builder/RockCrafter.java +++ b/rockcraft/src/main/java/com/canonical/rockcraft/builder/RockCrafter.java @@ -133,10 +133,10 @@ private Map getImageProjectParts(List images) { HashMap parts = new HashMap(); int id = 0; for (String image : images) { - parts.put(settings.getGeneratorName() + "/rockcraft/dump"+id, getImageDumpPart(image)); + parts.put(String.format("%s/rockcraft/dump%d",settings.getGeneratorName(), id), getImageDumpPart(image)); ++id; } - parts.put(settings.getGeneratorName() + "/rockcraft/deps", getDepsPart()); + parts.put(String.format("%s/rockcraft/deps", settings.getGeneratorName()) , getDepsPart()); return parts; } @@ -144,7 +144,7 @@ private Map getImageDumpPart(String image) { Map part = new HashMap(); part.put("source", "."); part.put("plugin", "nil"); - part.put("override-build", "cp --archive --link --no-dereference " + image + " /"); + part.put("override-build", String.format("cp --archive --link --no-dereference %s /", image)); return part; } @@ -164,7 +164,7 @@ public boolean accept(File file, String name) { Map serviceDefinition = new HashMap(); serviceDefinition.put("override", "replace"); serviceDefinition.put("summary", serviceName); - serviceDefinition.put("command", "/" + relativeImage + "/bin/" + serviceName); + serviceDefinition.put("command", String.format("/%s/bin/%s", relativeImage, serviceName)); services.put(serviceName, serviceDefinition); } }