Skip to content

Commit

Permalink
Call cp(1) relative to PATH (#205)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
veehaitch authored Jan 6, 2022
1 parent 7695e7f commit b6d6145
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion QuoteGeneration/buildenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SGX_VER:= $(shell awk '$$2 ~ /STRFILEVER/ { print substr($$3, 2, length($$3) - 2
SGX_MAJOR_VER:= $(shell echo $(SGX_VER) |awk -F. '{print $$1}')
SPLIT_VERSION=$(word $2,$(subst ., ,$1))

CP := /bin/cp -f
CP := cp -f
MKDIR := mkdir -p
STRIP := strip
OBJCOPY := objcopy
Expand Down
2 changes: 1 addition & 1 deletion tools/SGXPlatformRegistration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#
#

CP := /bin/cp -f
CP := cp -f
MKDIR := mkdir -p

PACKAGE_DIR := package
Expand Down
2 changes: 1 addition & 1 deletion tools/SGXPlatformRegistration/buildenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LOCAL_COMMON_DIR := $(ROOT_DIR)/common
INCLUDE_DIR := $(ROOT_DIR)/include
LIBS_DIR := $(ROOT_DIR)/build/lib64
BINS_DIR := $(ROOT_DIR)/build/bin
CP := /bin/cp -f
CP := cp -f


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

0 comments on commit b6d6145

Please sign in to comment.