[oe] [PATCH] autoconf.inc: check if files exist before using sed on them

Khem Raj raj.khem at gmail.com
Fri Mar 11 08:13:40 UTC 2011


On (10/03/11 14:10), Denis 'GNUtoo' Carikli wrote:
> Without the that fix we have
>   | + sed -i '-es,^SUBDIRS = .*,SUBDIRS = bin . lib,' .../work/x86_64-linux/autoconf213-native-2.13-r14.0/autoconf-2.13/Makefile.am
>   | sed: can't read .../work/x86_64-linux/autoconf213-native-2.13-r14.0/autoconf-2.13/Makefile.am: No such file or directory
> and:
>   | + sed -i -e '1s:#!.*:#! /usr/bin/env perl:' '.../work/x86_64-linux/autoconf213-native-2.13-r14.0/autoconf-2.13/bin/*.in'
>   | sed: can't read .../work/x86_64-linux/autoconf213-native-2.13-r14.0/autoconf-2.13/bin/*.in: No such file or directory
>   NOTE: package autoconf213-native-2.13-r14.0: task do_configure: Failed
> 
> Thanks a lot for all help in #oe on Freenode on irc for telling me
>   which command to use for the *.in at the end pb__ found the best command:
> <pb__> or ls ${S} | grep -q '\.in$'
> 
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>

Did you do a build from scratch ? This change might impact other autconf
recipes besids autoconf213-native.

> ---
>  recipes/autoconf/autoconf.inc |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/recipes/autoconf/autoconf.inc b/recipes/autoconf/autoconf.inc
> index 7f22c2b..e0eecd3 100644
> --- a/recipes/autoconf/autoconf.inc
> +++ b/recipes/autoconf/autoconf.inc
> @@ -8,7 +8,7 @@ RDEPENDS_${PN} = "m4 perl gnu-config"
>  DEPENDS_virtclass-native = "m4-native gnu-config-native perl-native"
>  RDEPENDS_${PN}_virtclass-native = "m4-native gnu-config-native perl-native"
>  
> -INC_PR = "r13"
> +INC_PR = "r14"
>  
>  SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.bz2;name=autoconf \
>  	   file://program_prefix.patch"
> @@ -25,13 +25,19 @@ do_configure_prepend () {
>  		export ac_cv_path_M4="${ac_cv_path_M4=${bindir}/m4}"
>  		export ac_cv_prog_gnu_m4="${ac_cv_prog_gnu_m4=yes}"
>  	fi
> -
> -	sed -i -e's,^SUBDIRS = .*,SUBDIRS = ${SUBDIRS},' ${S}/Makefile.am
> +	if [ -e ${S}/Makefile.am ]
> +	then
> +		sed -i -e's,^SUBDIRS = .*,SUBDIRS = ${SUBDIRS},' ${S}/Makefile.am
> +	fi
>  }
>  
>  do_configure_append() {
>  	# replace paths to STAGING_BINDIR_NATIVE/perl with ${bindir}/perl
> -	sed -i -e "1s:#!.*:#! /usr/bin/env perl:" ${S}/bin/*.in
> +	ls ${S} | grep -q '\.in$'
> +	if [ $? -eq 0 ]
> +	then
> +		sed -i -e "1s:#!.*:#! /usr/bin/env perl:" ${S}/bin/*.in
> +	fi
>  }
>  
>  PARALLEL_MAKE = ""
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

-- 
-Khem




More information about the Openembedded-devel mailing list