From c6b5a20d99e23393c594ed4ee78bae6530c801bd Mon Sep 17 00:00:00 2001 From: Jacob Wilder Date: Tue, 28 May 2019 15:24:15 -0400 Subject: [PATCH] Do include the depends field in the control file if and only if it was set. When the change to no longer include the default depends was made in #209 to fix #208 it entirely eliminated the ability to set the depends programatically. In fact, the field DebMaker.depends is never read. --- src/main/java/org/vafer/jdeb/DebMaker.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/vafer/jdeb/DebMaker.java b/src/main/java/org/vafer/jdeb/DebMaker.java index 8121fe2c6..e98ce3678 100644 --- a/src/main/java/org/vafer/jdeb/DebMaker.java +++ b/src/main/java/org/vafer/jdeb/DebMaker.java @@ -503,6 +503,12 @@ public BinaryPackageControlFile createSignedDeb(Compression compression, final P if (packageControlFile.get("Description") == null) { packageControlFile.set("Description", description); } + if (packageControlFile.get("Depends") == null) { + // Only add a depends entry to the control file if the field in this object has actually been set + if (depends != null && depends.length() > 0) { + packageControlFile.set("Depends", depends); + } + } if (packageControlFile.get("Homepage") == null) { packageControlFile.set("Homepage", homepage); }