]> code.ossystems Code Review - openembedded-core.git/commitdiff
cpan.bbclass: matches more lines
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 28 Aug 2014 05:40:06 +0000 (22:40 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 Aug 2014 14:11:10 +0000 (15:11 +0100)
Fixed:
- There might be a space between "#!" and "/pat/to/usr/bin/perl", e.g.:
  "#! /usr/bin/perl", now also matches it.

- There might be the lines like the following in the body:
  eval 'exec /path/to/usr/bin/perl-native/perl -S $0 ${1+"$@"}'

  Now we only check "#! */path/to/usr/bin/perl" to make sure it is a
  perl script, but match and fix the lines in both header and body.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/cpan.bbclass

index 7088039fa01b0501a28158408c85cb9cbca41cbf..e2bbd2f63ac60434c29ff84fc884dc83c4fc5e80 100644 (file)
@@ -47,8 +47,8 @@ cpan_do_compile () {
 
 cpan_do_install () {
        oe_runmake DESTDIR="${D}" install_vendor
-       for PERLSCRIPT in `grep -rIEl '#!${bindir}/perl-native.*/perl' ${D}`; do
-               sed -i -e 's|^#!${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' $PERLSCRIPT
+       for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' ${D}`; do
+               sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env nativeperl|' $PERLSCRIPT
        done
 }