[vlc-commits] [Git][videolan/vlc][master] contrib: avoid which

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Jan 20 20:47:35 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
bb7e67dc by Rémi Denis-Courmont at 2022-01-20T18:03:49+00:00
contrib: avoid which

which is nonstandard and deprecated on Debian.
Use POSIX shell built-in command -v instead.

- - - - -


3 changed files:

- contrib/src/fxc2/rules.mak
- contrib/src/main.mak
- contrib/src/protobuf/rules.mak


Changes:

=====================================
contrib/src/fxc2/rules.mak
=====================================
@@ -26,10 +26,10 @@ FXC2_DLL=dll/d3dcompiler_47.dll
 else ifeq ($(ARCH),i386)
 FXC2_CXX=$(CXX)
 FXC2_DLL=dll/d3dcompiler_47_32.dll
-else ifeq ($(shell which x86_64-w64-mingw32-g++ >/dev/null 2>&1 || echo FAIL),)
+else ifeq ($(shell command -v x86_64-w64-mingw32-g++ >/dev/null 2>&1 || echo FAIL),)
 FXC2_CXX=x86_64-w64-mingw32-g++
 FXC2_DLL=dll/d3dcompiler_47.dll
-else ifeq ($(shell which i686-w64-mingw32-g++ >/dev/null 2>&1 || echo FAIL),)
+else ifeq ($(shell command -v i686-w64-mingw32-g++ >/dev/null 2>&1 || echo FAIL),)
 FXC2_CXX=i686-w64-mingw32-g++
 FXC2_DLL=dll/d3dcompiler_47_32.dll
 else


=====================================
contrib/src/main.mak
=====================================
@@ -254,7 +254,7 @@ download = (rm -f $@.tmp && \
 	wget --passive -c -p -O $@.tmp "$(1)" && \
 	touch $@.tmp && \
 	mv $@.tmp $@ )
-else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
+else ifeq ($(command -v fetch >/dev/null 2>&1 || echo FAIL),)
 download = (rm -f $@.tmp && \
 	fetch -p -o $@.tmp "$(1)" && \
 	touch $@.tmp && \
@@ -266,7 +266,7 @@ endif
 download_pkg = $(call download,$(CONTRIB_VIDEOLAN)/$(2)/$(lastword $(subst /, ,$(@)))) || \
 	( $(call download,$(1)) && echo "Please upload this package $(lastword $(subst /, ,$(@))) to our FTP" )
 
-ifeq ($(shell which xz >/dev/null 2>&1 || echo FAIL),)
+ifeq ($(shell command -v xz >/dev/null 2>&1 || echo FAIL),)
 XZ = xz
 else
 XZ ?= $(error XZ (LZMA) compressor not found)


=====================================
contrib/src/protobuf/rules.mak
=====================================
@@ -8,7 +8,7 @@ ifeq ($(call need_pkg, "protobuf-lite >= 3.1.0 protobuf-lite < 3.2.0"),)
 PKGS_FOUND += protobuf
 else
 # check we have a matching protoc to use
-PROTOC_ABSPATH = $(shell PATH="$(PATH)" which protoc)
+PROTOC_ABSPATH = $(shell PATH="$(PATH)" command -v protoc)
 ifeq ($(PROTOC_ABSPATH),)
 PROTOC = $(error protoc not found (search path: $(PATH)))
 else



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bb7e67dc4383596b08f4276864b020fdbbf0d11d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/bb7e67dc4383596b08f4276864b020fdbbf0d11d
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list