Skip to contentSkip to conversation

p7zip: do not hardcode path in native wrapper script

PATCH New Jonathan Liu 1 participant 1 message Sep 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 p7zip: do not hardcode path in native wrapper script

---
 meta-oe/recipes-extended/p7zip/p7zip_16.02.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta-oe/recipes-extended/p7zip/p7zip_16.02.bb +4 -2
index 9f87e9f..fdd51db 100644
@@ -29,8 +29,10 @@ do_install_class-native() {
 
     # Create a shell script wrapper to execute next to 7z.so
     mv ${D}${bindir}/7z ${D}${bindir}/7z.bin
-    echo "#! /bin/sh" > ${D}${bindir}/7z
-    echo "exec ${D}${bindir}/7z.bin \"\$@\"" >> ${D}${bindir}/7z
+    cat > ${D}${bindir}/7z << 'EOF'
+#!/bin/sh
+exec "$(dirname "$0")"/7z.bin "$@"
+EOF
     chmod 0755 ${D}${bindir}/7z
 }
 
Signature · 1 line
2.10.0