Skip to contentSkip to conversation

infra/pkg-generic: use readlink instead of realpath

PATCH New Yann E. MORIN 2 participants 2 messages Dec 1, 2018 – Dec 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infra/pkg-generic: use readlink instead of realpath

realpath is missing on oldish distributions, like Debian 7, which is still sued in the wild.

Use readlink instead; that has been available since the dawn of ages now (well, coreutils had it in 2003).

---
 package/pkg-generic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/pkg-generic.mk +2 -2
index 649a7ad187..6a0c9377ca 100644
@@ -280,8 +280,8 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
 				-e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \
 				-e "s,-I/usr/,-I at STAGING_DIR@/usr/,g" \
 				-e "s,-L/usr/,-L at STAGING_DIR@/usr/,g" \
-				-e 's, at STAGING_DIR@,$$(dirname $$(realpath -e $$0))/../..,g' \
-				-e 's, at HOST_DIR@,$$(dirname $$(realpath -e $$0))/../../../..,g' \
+				-e 's, at STAGING_DIR@,$$(dirname $$(readlink -e $$0))/../..,g' \
+				-e 's, at HOST_DIR@,$$(dirname $$(readlink -e $$0))/../../../..,g' \
 				-e "s, at BASE_DIR@,$(BASE_DIR),g" \
 				$(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\
 	fi
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 infra/pkg-generic: use readlink instead of realpath

Hello,

Quoted 6 lines · Yann E. MORIN

realpath is missing on oldish distributions, like Debian 7, which is still sued in the wild.

Use readlink instead; that has been available since the dawn of ages now (well, coreutils had it in 2003).

Quoted 6 lines
---
 package/pkg-generic.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Seems like I forgot to say that I had applied this patch, on December
2. So: applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com