Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] autogen: fix autoopts script generation to handle shebang
@ 2017-05-12 13:59 Awais Belal
  2017-05-12 14:06 ` Alexander Kanavin
  0 siblings, 1 reply; 9+ messages in thread
From: Awais Belal @ 2017-05-12 13:59 UTC (permalink / raw)
  To: openembedded-core

With deep directory hierarchy of the build dir the shenbang
generated for the autoopts scripts fail due to shebang length
crossing 128 characters.
This patch handles such scenarios for most cases by following
the symlink in HOSTTOOLS to the actual host executable so the
problem is resolved in most cases.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 .../autogen/autogen-native_5.18.12.bb              |  1 +
 ...oopts-mk-tpl-config.sh-fix-shebang-length.patch | 49 ++++++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 meta/recipes-devtools/autogen/autogen/0001-autoopts-mk-tpl-config.sh-fix-shebang-length.patch

diff --git a/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb b/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb
index 853477cf7c..1d76810fd7 100644
--- a/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb
+++ b/meta/recipes-devtools/autogen/autogen-native_5.18.12.bb
@@ -14,6 +14,7 @@ SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \
            file://fix-script-err-when-processing-libguile.patch \
            file://0001-config-libopts.m4-regenerate-it-from-config-libopts..patch \
            file://0002-autoopts-mk-tpl-config.sh-fix-perl-path.patch \
+           file://0001-autoopts-mk-tpl-config.sh-fix-shebang-length.patch \
 "
 
 SRC_URI[md5sum] = "551d15ccbf5b5fc5658da375d5003389"
diff --git a/meta/recipes-devtools/autogen/autogen/0001-autoopts-mk-tpl-config.sh-fix-shebang-length.patch b/meta/recipes-devtools/autogen/autogen/0001-autoopts-mk-tpl-config.sh-fix-shebang-length.patch
new file mode 100644
index 0000000000..453ecb28d6
--- /dev/null
+++ b/meta/recipes-devtools/autogen/autogen/0001-autoopts-mk-tpl-config.sh-fix-shebang-length.patch
@@ -0,0 +1,49 @@
+From 2648a4064aff7ae82e74b8de6ade93dc9c04ce3b Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Fri, 12 May 2017 18:22:02 +0500
+Subject: [PATCH] autoopts/mk-tpl-config.sh: fix shebang length
+
+The shebang length cannot be more than 128 charaters
+and the change
+http://cgit.openembedded.org/openembedded-core/commit/meta/classes/base.bbclass?id=fa764a403da34bb0ca9fa3767a9e9dba8d685965
+requires that a user needs to make sure the HOSTTOOLS
+directory is under 128 characters in order to get
+the build through otherwise this causes
+bad interpreter: Permission denied
+when the builddir path is too long.
+This change now follows the path to actual host
+executable to be put in the final scripts that
+are generated so the shebang remains correct in
+most situations.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+---
+ autoopts/mk-tpl-config.sh | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/autoopts/mk-tpl-config.sh b/autoopts/mk-tpl-config.sh
+index c4708a2..7de546b 100755
+--- a/autoopts/mk-tpl-config.sh
++++ b/autoopts/mk-tpl-config.sh
+@@ -98,11 +98,14 @@ fix_scripts() {
+         st=`sed 1q $f`
+ 
+         case "$st" in
+-        *perl ) echo '#!/usr/bin/env perl'
++        *perl )  PERL=`which perl`
++                 PERL=`readlink -f ${PERL}`
++                 echo '#!' ${PERL}
+                  sed 1d $f
+                  ;;
+ 
+-        */sh )   echo '#!' ${POSIX_SHELL}
++        */sh )   SH=`readlink -f ${POSIX_SHELL}`
++                 echo '#!' ${SH}
+                  sed 1d $f
+                  ;;
+ 
+-- 
+2.11.1
+
-- 
2.11.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-17  8:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-12 13:59 [PATCH] autogen: fix autoopts script generation to handle shebang Awais Belal
2017-05-12 14:06 ` Alexander Kanavin
2017-05-15  9:01   ` Belal, Awais
2017-05-15 11:53     ` Alexander Kanavin
2017-05-15 15:03       ` Belal, Awais
2017-05-15 15:10         ` Alexander Kanavin
2017-05-16  5:36           ` Belal, Awais
2017-05-16 11:32             ` Alexander Kanavin
2017-05-17  8:50               ` Belal, Awais

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox