From edc96eb4da1b661e353f66c1bd213e3702d9c8106d071f6e96c62c7d361945b2 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 7 Oct 2024 20:05:14 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/javapackages-tools?expand=0&rev=161 --- 0001-Don-t-fail-if-which-does-not-exist.patch | 48 ------------------- do-not-require-which.patch | 20 ++++++++ javapackages-tools.changes | 2 +- javapackages-tools.spec | 2 +- 4 files changed, 22 insertions(+), 50 deletions(-) delete mode 100644 0001-Don-t-fail-if-which-does-not-exist.patch create mode 100644 do-not-require-which.patch diff --git a/0001-Don-t-fail-if-which-does-not-exist.patch b/0001-Don-t-fail-if-which-does-not-exist.patch deleted file mode 100644 index 7da45d7..0000000 --- a/0001-Don-t-fail-if-which-does-not-exist.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 1cf5d460d05584189633dd34f255962239ca12c4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fridrich=20=C5=A0trba?= -Date: Mon, 7 Oct 2024 19:32:25 +0200 -Subject: [PATCH] Don't fail if which does not exist - ---- - java-utils/java-functions | 25 +++++++++++++++++-------- - 1 file changed, 17 insertions(+), 8 deletions(-) - -diff --git a/java-utils/java-functions b/java-utils/java-functions -index cdc1c2ea..b75c208e 100644 ---- a/java-utils/java-functions -+++ b/java-utils/java-functions -@@ -171,14 +171,23 @@ set_javacmd() - - JAVACMD=$(which java 2>/dev/null || :) - if [ -x "${JAVACMD}" ]; then -- _log "Using JAVACMD from PATH: $JAVACMD" -- if [ -n "${JAVACMD_OPTS}" ]; then -- _log "Using java-wrapper with extra options: ${JAVACMD_OPTS}" -- export _JP_JAVACMD="${JAVACMD}" -- export _JP_JAVACMD_OPTS="${JAVACMD_OPTS}" -- JAVACMD="@{javadir}-utils/java-wrapper" -- fi -- return 0 -+ _log "Using JAVACMD from PATH: $JAVACMD" -+ else -+ if java -version >/dev/null 2>&1; then -+ JAVACMD="java" -+ _log "Using simple ${JAVACMD} call" -+ else -+ unset JAVACMD -+ fi -+ fi -+ if [ -n "${JAVACMD}" ]; then -+ if [ -n "${JAVACMD_OPTS}" ]; then -+ _log "Using java-wrapper with extra options: ${JAVACMD_OPTS}" -+ export _JP_JAVACMD="${JAVACMD}" -+ export _JP_JAVACMD_OPTS="${JAVACMD_OPTS}" -+ JAVACMD="@{javadir}-utils/java-wrapper" -+ fi -+ return 0 - fi - - _err "Failed to set JAVACMD" --- -2.46.1 - diff --git a/do-not-require-which.patch b/do-not-require-which.patch new file mode 100644 index 0000000..589c8e2 --- /dev/null +++ b/do-not-require-which.patch @@ -0,0 +1,20 @@ +--- javapackages-6.3.2/java-utils/java-functions 2024-10-07 22:01:07.498351430 +0200 ++++ javapackages-6.3.2/java-utils/java-functions 2024-10-07 22:01:41.697647647 +0200 +@@ -169,7 +169,7 @@ + done + fi + +- JAVACMD=$(which java 2>/dev/null || :) ++ JAVACMD=$(type -p java 2>/dev/null || :) + if [ -x "${JAVACMD}" ]; then + _log "Using JAVACMD from PATH: $JAVACMD" + if [ -n "${JAVACMD_OPTS}" ]; then +@@ -315,7 +315,7 @@ + { + local IFS=: + local artifact="${1}" +- local cmd=$(which xmvn-resolve 2>/dev/null || :) ++ local cmd=$(type -p xmvn-resolve 2>/dev/null || :) + + # If artifact contains semicolon then assume it specifies Maven + # artifact coordinates. diff --git a/javapackages-tools.changes b/javapackages-tools.changes index 3e6a563..873a72a 100644 --- a/javapackages-tools.changes +++ b/javapackages-tools.changes @@ -2,7 +2,7 @@ Mon Oct 7 17:38:56 UTC 2024 - Fridrich Strba - Added patch: - * 0001-Don-t-fail-if-which-does-not-exist.patch + * do-not-require-which.patch + do not fail launching scripts if which is not installed (bsc#1231347) diff --git a/javapackages-tools.spec b/javapackages-tools.spec index ec7afe2..6ba591b 100644 --- a/javapackages-tools.spec +++ b/javapackages-tools.spec @@ -47,7 +47,7 @@ Patch1: python-optional.patch Patch2: suse-no-epoch.patch # #PATCH-FIX-UPSTREAM: do not fail if which does not exist -Patch3: 0001-Don-t-fail-if-which-does-not-exist.patch +Patch3: do-not-require-which.patch BuildRequires: fdupes BuildRequires: perl