Patchwork autotools.bbclass: Enhance sed regexp to avoid extra subshell

login
register
mail settings
Submitter Matthieu CRAPET
Date July 24, 2014, 9:39 a.m.
Message ID <1406194783-29393-1-git-send-email-Matthieu.Crapet@ingenico.com>
Download mbox | patch
Permalink /patch/76573/
State Accepted
Commit 5a7f510a68d449e0ae1d972ad2d78fb9853665b5
Headers show

Comments

Matthieu CRAPET - July 24, 2014, 9:39 a.m.
head -n1 can be done using sed.

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
---
 meta/classes/autotools.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 19edc54..afca760 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -195,7 +195,7 @@  autotools_do_configure() {
 		else
 			acpaths="${acpaths}"
 		fi
-		AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
+		AUTOV=`automake --version | sed -e '1{s/.* //;s/\.[0-9]\+$//};q'`
 		automake --version
 		echo "AUTOV is $AUTOV"
 		if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then