Patchwork [22/32] quilt: fix perl path in target perl scripts

login
register
mail settings
Submitter Scott Garman
Date May 24, 2012, 9:38 p.m.
Message ID <c8c394bd806978c867f2fe82e4bde65c98764880.1337892418.git.scott.a.garman@intel.com>
Download mbox | patch
Permalink /patch/28695/
State New
Headers show

Comments

Scott Garman - May 24, 2012, 9:38 p.m.
From: Nitin A Kamble <nitin.a.kamble@intel.com>

While building on distros like fedora17, which has /bin/perl,
the target perl scripts get perl path also as /bin/perl.
And that is not correction path of perl on the target.

This commit avoids this error.

| error: Failed dependencies:
|       /bin/perl is needed by quilt-0.51-r2.i586
NOTE: package core-image-sato-sdk-1.0-r0: task do_rootfs: Failed
ERROR: Task 8
(/home/nitin/prj/poky.git/meta/recipes-sato/images/core-image-sato-sdk.bb,
do_rootfs) failed with exit code '1'

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 meta/recipes-devtools/quilt/quilt_0.51.bb |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-devtools/quilt/quilt_0.51.bb b/meta/recipes-devtools/quilt/quilt_0.51.bb
index 6865cd8..4e51b49 100644
--- a/meta/recipes-devtools/quilt/quilt_0.51.bb
+++ b/meta/recipes-devtools/quilt/quilt_0.51.bb
@@ -4,4 +4,17 @@  RDEPENDS_${PN} += "patch diffstat bzip2 util-linux"
 SRC_URI += "file://aclocal.patch \
             file://gnu_patch_test_fix_target.patch \
            "
-PR = "r3"
+PR = "r4"
+
+PERLPATH = "${bindir}/env perl"
+PERLPATH_virtclass-nativesdk = "/usr/bin/env perl"
+
+# fix build-distro specific perl path in the target perl scripts
+do_install_append() {
+	for perlscript in ${D}${datadir}/quilt/scripts/remove-trailing-ws ${D}${datadir}/quilt/scripts/dependency-graph ${D}${datadir}/quilt/scripts/edmail ${D}${bindir}/guards
+	do
+		if [ -f $perlscript ]; then
+			sed -i -e '1s,#!.*perl,#! ${PERLPATH},' $perlscript
+		fi
+	done
+}