Mon, 02 Oct 2023 16:46:20 +0200
fix special chars in dependency names are breaking configure - fixes #312
--- a/src/main/java/de/unixwork/uwproj/NamedDependency.java Mon Oct 02 16:23:33 2023 +0200 +++ b/src/main/java/de/unixwork/uwproj/NamedDependency.java Mon Oct 02 16:46:20 2023 +0200 @@ -2,6 +2,8 @@ import java.util.List; +import static de.unixwork.uwproj.Util.shId; + public class NamedDependency { private String name; private List<Dependency> subdependencies; @@ -14,6 +16,10 @@ this.name = name; } + public String getId() { + return shId(name); + } + public List<Dependency> getSubdependencies() { return subdependencies; }
--- a/src/main/java/de/unixwork/uwproj/Target.java Mon Oct 02 16:23:33 2023 +0200 +++ b/src/main/java/de/unixwork/uwproj/Target.java Mon Oct 02 16:46:20 2023 +0200 @@ -8,8 +8,7 @@ import java.util.LinkedList; import java.util.List; -import static de.unixwork.uwproj.Util.isNotNullOrBlank; -import static de.unixwork.uwproj.Util.isNullOrBlank; +import static de.unixwork.uwproj.Util.*; public class Target { private String name = ""; @@ -105,7 +104,8 @@ } public void addDependency(String dependency) { - dependencies.add(dependency); + // we have to add the sanitized identifier to the list of dependencies + dependencies.add(shId(dependency)); } public boolean isAllDependencies() {
--- a/src/main/java/de/unixwork/uwproj/TargetData.java Mon Oct 02 16:23:33 2023 +0200 +++ b/src/main/java/de/unixwork/uwproj/TargetData.java Mon Oct 02 16:46:20 2023 +0200 @@ -8,6 +8,8 @@ import java.util.LinkedList; import java.util.List; +import static de.unixwork.uwproj.Util.shId; + public class TargetData { private final List<Define> defines = new LinkedList<>(); private final List<String> dependencies = new LinkedList<>(); @@ -60,7 +62,8 @@ } public void addDependency(String d) { - dependencies.add(d); + // we have to add the sanitized identifier to the list of dependencies + dependencies.add(shId(d)); } public void addMake(String m) {
--- a/test/make/configure.vm Mon Oct 02 16:23:33 2023 +0200 +++ b/test/make/configure.vm Mon Oct 02 16:46:20 2023 +0200 @@ -256,7 +256,7 @@ } #foreach( $dependency in $namedDependencies ) -dependency_error_${dependency.name}() +dependency_error_${dependency.id}() { printf "checking for ${dependency.name}... " #foreach( $sub in $dependency.getSubdependencies() )