[packages/jpackage-utils] replace `which` with `command -v`; rel 15

atler atler at pld-linux.org
Thu May 7 12:13:10 CEST 2026


commit d315935bc3d2b7a4221b3bb2ab9bf284c44dc20d
Author: Jan Palus <atler at pld-linux.org>
Date:   Thu May 7 12:07:16 2026 +0200

    replace `which` with `command -v`; rel 15
    
    zsh's `which` builtin outputs to stdout on missing command
    https://zsh.sourceforge.io/FAQ/zshfaq03.html#l47

 jpackage-utils.spec |  5 +++--
 no-which.patch      | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/jpackage-utils.spec b/jpackage-utils.spec
index 5337b60..2550340 100644
--- a/jpackage-utils.spec
+++ b/jpackage-utils.spec
@@ -3,7 +3,7 @@ Summary:	JPackage utilities
 Summary(pl.UTF-8):	Narzędzia JPackage
 Name:		jpackage-utils
 Version:	1.7.5
-Release:	14
+Release:	15
 License:	BSD-like
 Group:		Development/Languages/Java
 Source0:	%{name}-%{version}.tar.bz2
@@ -14,11 +14,11 @@ Patch2:		%{name}-errors.patch
 Patch3:		%{name}-readlink.patch
 Patch4:		%{name}-jvm_exports_via_link.patch
 Patch5:		java_version.patch
+Patch6:		no-which.patch
 URL:		http://www.jpackage.org/
 BuildRequires:	rpmbuild(macros) >= 1.555
 Requires:	/bin/egrep
 Requires:	/bin/sed
-Requires:	which
 Conflicts:	rpmbuild(macros) < 1.409
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -86,6 +86,7 @@ pliki XSL dla programu maven2, plik nagłówkowy dla plików spec itp.
 %patch -P3 -p1
 %patch -P4 -p1
 %patch -P5 -p1
+%patch -P6 -p1
 
 # we cp -a complete dir from source
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
diff --git a/no-which.patch b/no-which.patch
new file mode 100644
index 0000000..1799297
--- /dev/null
+++ b/no-which.patch
@@ -0,0 +1,25 @@
+--- jpackage-utils-1.7.5/java-utils/java-functions.orig	2026-05-07 01:27:33.158554132 +0200
++++ jpackage-utils-1.7.5/java-utils/java-functions	2026-05-07 01:29:06.790627562 +0200
+@@ -37,11 +37,11 @@
+   # try to find it from java command
+ 
+   # try javac first, or we might get the location of the jre instead - djw
+-  java=`which javac 2>/dev/null || :`
++  java=`command -v javac 2>/dev/null || :`
+ 
+   # if we don't have the jdk, then maybe we have the jre - djw
+   if [ -z "$java" ] ; then
+-    java=`which java 2>/dev/null || :`
++    java=`command -v java 2>/dev/null || :`
+   fi
+ 
+   if [ -n "$java" ] ; then
+@@ -81,7 +81,7 @@
+   elif [ -x "$JAVA_HOME/bin/java" ]; then
+     JAVACMD="$JAVA_HOME/bin/java"
+   else
+-    JAVACMD=`which java 2>/dev/null`
++    JAVACMD=`command -v java 2>/dev/null`
+   fi
+ 
+   if [ ! -x "$JAVACMD" ]; then
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/jpackage-utils.git/commitdiff/d315935bc3d2b7a4221b3bb2ab9bf284c44dc20d



More information about the pld-cvs-commit mailing list