From eb8f8c3db390aa7e8f3f15cf7d3bc91ac694bad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6ser=2C=20Daniel?= Date: Tue, 10 Sep 2024 13:00:08 +0200 Subject: [PATCH] Remove 2nd required dependency entry added by scriptlet setter --- .../java/org/eclipse/packager/rpm/build/RpmBuilder.java | 3 --- .../java/org/eclipse/packager/rpm/ScriptletWriterTest.java | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/rpm/src/main/java/org/eclipse/packager/rpm/build/RpmBuilder.java b/rpm/src/main/java/org/eclipse/packager/rpm/build/RpmBuilder.java index c63f8d2..54de874 100644 --- a/rpm/src/main/java/org/eclipse/packager/rpm/build/RpmBuilder.java +++ b/rpm/src/main/java/org/eclipse/packager/rpm/build/RpmBuilder.java @@ -1259,12 +1259,9 @@ private void setScript(final RpmTag interpreterTag, final RpmTag scriptTag, fina private void addInterpreterRequirement(final String interpreter, RpmDependencyFlags scriptPhaseFlag) { if (isEmbeddedLuaInterpreter(interpreter)) { - addRequirement(EMBEDDED_LUA_INTERPRETER_REQUIREMENT_NAME, EMBEDDED_LUA_INTERPRETER_REQUIREMENT_VERSION, - RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB); addRequirement(EMBEDDED_LUA_INTERPRETER_REQUIREMENT_NAME, EMBEDDED_LUA_INTERPRETER_REQUIREMENT_VERSION, scriptPhaseFlag, RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB); } else { - addRequirement(interpreter, null, RpmDependencyFlags.INTERPRETER); addRequirement(interpreter, null, scriptPhaseFlag, RpmDependencyFlags.INTERPRETER); } } diff --git a/rpm/src/test/java/org/eclipse/packager/rpm/ScriptletWriterTest.java b/rpm/src/test/java/org/eclipse/packager/rpm/ScriptletWriterTest.java index 7d976a6..2a022a7 100644 --- a/rpm/src/test/java/org/eclipse/packager/rpm/ScriptletWriterTest.java +++ b/rpm/src/test/java/org/eclipse/packager/rpm/ScriptletWriterTest.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.stream.Stream; +import org.eclipse.packager.rpm.app.Dumper; import org.eclipse.packager.rpm.build.RpmBuilder; import org.eclipse.packager.rpm.deps.Dependency; import org.eclipse.packager.rpm.deps.RpmDependencyFlags; @@ -70,12 +71,9 @@ void combinedScriptTest() throws IOException { Path outFile; List expectedRequiredDependencies = List.of( - new Dependency("rpmlib(BuiltinLuaScripts)", "4.2.2-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB, RpmDependencyFlags.INTERPRETER), new Dependency("rpmlib(BuiltinLuaScripts)", "4.2.2-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB, RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.SCRIPT_PRE), new Dependency("rpmlib(BuiltinLuaScripts)", "4.2.2-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB, RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.PRETRANS), - new Dependency(customInterpreter, "", RpmDependencyFlags.INTERPRETER), new Dependency(customInterpreter, "", RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.SCRIPT_POST), - new Dependency(shellInterpreter, "", RpmDependencyFlags.INTERPRETER), new Dependency(shellInterpreter, "", RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.SCRIPT_POSTUN), new Dependency(shellInterpreter, "", RpmDependencyFlags.INTERPRETER, RpmDependencyFlags.POSTTRANS), new Dependency("rpmlib(CompressedFileNames)", "3.0.4-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB), @@ -137,7 +135,6 @@ public static Stream scriptSource() { public static List simpleLuaDependencyFor(RpmDependencyFlags scriptletPhase) { return List.of( - new Dependency("rpmlib(BuiltinLuaScripts)", "4.2.2-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB, RpmDependencyFlags.INTERPRETER), new Dependency("rpmlib(BuiltinLuaScripts)", "4.2.2-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB, RpmDependencyFlags.INTERPRETER, scriptletPhase), new Dependency("rpmlib(CompressedFileNames)", "3.0.4-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB), new Dependency("rpmlib(PayloadFilesHavePrefix)", "4.0-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB)); @@ -145,7 +142,6 @@ public static List simpleLuaDependencyFor(RpmDependencyFlags scriptl public static List simpleInterpreterDependencyFor(String interpreter, RpmDependencyFlags scriptletPhase) { return List.of( - new Dependency(interpreter, "", RpmDependencyFlags.INTERPRETER), new Dependency(interpreter, "", RpmDependencyFlags.INTERPRETER, scriptletPhase), new Dependency("rpmlib(CompressedFileNames)", "3.0.4-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB), new Dependency("rpmlib(PayloadFilesHavePrefix)", "4.0-1", RpmDependencyFlags.LESS, RpmDependencyFlags.EQUAL, RpmDependencyFlags.RPMLIB));