console.info("Building conffiles");
List<String> tempConffiles = populateConffiles(conffilesProducers);
console.debug("Building control");
ControlBuilder controlBuilder = new ControlBuilder(console, variableResolver, openReplaceToken, closeReplaceToken);
BinaryPackageControlFile packageControlFile = controlBuilder.createPackageControlFile(new File(control, "control"), size);
if (packageControlFile.get("Package") == null) {
packageControlFile.set("Package", packageName);
}
if (packageControlFile.get("Depends") == null) {
packageControlFile.set("Depends", depends);
}
if (packageControlFile.get("Section") == null) {
packageControlFile.set("Section", section);
}
if (packageControlFile.get("Description") == null) {
packageControlFile.set("Description", description);
}
if (packageControlFile.get("Homepage") == null) {
packageControlFile.set("Homepage", homepage);
}
controlBuilder.buildControl(packageControlFile, control.listFiles(), tempConffiles , md5s, tempControl);
if (!packageControlFile.isValid()) {
throw new PackagingException("Control file fields are invalid " + packageControlFile.invalidFields() +
". The following fields are mandatory: " + packageControlFile.getMandatoryFields() +
". Please check your pom.xml/build.xml and your control file.");
}
deb.getParentFile().mkdirs();