Skip to content

Commit b6d6145

Browse files
authored
Call cp(1) relative to PATH (#205)
In contrast to other coreutils binaries used throughout the code, cp(1) gets called with an absolute path which assumes the binary resides in `/bin`. This commit removes the absolute path to search for cp(1) relative to the search paths given in the `PATH` environment variable. Using an absolute path to call binaries is incompatible with distributions which do not follow the Filesystem Hierachy Standard; NixOS is an example. Also, as other coreutils binaries merely mention the binary's name, it is more consistent to call cp(1) in the same way. Signed-off-by: Vincent Haupert <[email protected]>
1 parent 7695e7f commit b6d6145

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

QuoteGeneration/buildenv.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ SGX_VER:= $(shell awk '$$2 ~ /STRFILEVER/ { print substr($$3, 2, length($$3) - 2
5252
SGX_MAJOR_VER:= $(shell echo $(SGX_VER) |awk -F. '{print $$1}')
5353
SPLIT_VERSION=$(word $2,$(subst ., ,$1))
5454

55-
CP := /bin/cp -f
55+
CP := cp -f
5656
MKDIR := mkdir -p
5757
STRIP := strip
5858
OBJCOPY := objcopy

tools/SGXPlatformRegistration/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#
3030
#
3131

32-
CP := /bin/cp -f
32+
CP := cp -f
3333
MKDIR := mkdir -p
3434

3535
PACKAGE_DIR := package

tools/SGXPlatformRegistration/buildenv.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LOCAL_COMMON_DIR := $(ROOT_DIR)/common
3737
INCLUDE_DIR := $(ROOT_DIR)/include
3838
LIBS_DIR := $(ROOT_DIR)/build/lib64
3939
BINS_DIR := $(ROOT_DIR)/build/bin
40-
CP := /bin/cp -f
40+
CP := cp -f
4141

4242

4343
RA_VERSION= $(shell awk '$$2 ~ /STRFILEVER/ { print substr($$3, 2, length($$3) - 2); }' $(ROOT_DIR)/../../QuoteGeneration/common/inc/internal/se_version.h)

0 commit comments

Comments
 (0)