From patchwork Fri Nov 18 11:50:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Koen Kooi X-Patchwork-Id: 82870 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp39897qge; Fri, 18 Nov 2016 04:11:59 -0800 (PST) X-Received: by 10.99.36.65 with SMTP id k62mr18679562pgk.88.1479471119406; Fri, 18 Nov 2016 04:11:59 -0800 (PST) Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 84si8001063pgg.198.2016.11.18.04.11.58; Fri, 18 Nov 2016 04:11:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 026EB71B0A; Fri, 18 Nov 2016 12:11:53 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by mail.openembedded.org (Postfix) with ESMTP id A08F771AA7 for ; Fri, 18 Nov 2016 11:51:31 +0000 (UTC) Received: by mail-wm0-f49.google.com with SMTP id t79so32493428wmt.0 for ; Fri, 18 Nov 2016 03:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kKkVAzZFsIOx4vJgQioiw9YASc5nfi6EGd+AQThwAMQ=; b=RVNV7qcftZ7gbUKaw0OTEI3wrajJrxJNQtgShFtFuSoP47RJqoPRJzc0Yq9JfplttL NxOSsGKFeXCpFkqS95SH50nmsLaHzNcsbkPNJdipa5lkY829N4wbG2UUJ/itmm9Bhx8q zHYvMEh/G9zF9OrmW13SCO4rYvF3mlPLDHV6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kKkVAzZFsIOx4vJgQioiw9YASc5nfi6EGd+AQThwAMQ=; b=P/baaveJQXPcXuD7aTYYn5GXs6lnlZKVkIvg2cKrWpUTLBMsn231HJy/4r5gfYgk4I S3bB8oB8+Tu1QlMKpvNbPqVpLEhVDN1GvdqW2hBvUcOci+zTHtt/CfJCOs8rLEeCYYTy YzZUfx7+67qGID01zJrPFUv6UUqcku0t+ku7mLaEmRUzGrqshLBSTen2EIWsSFY4j4xd ab5Iot8yT+hJR89WvyfIJE+2Mqfo/i6p1nGKMmgdgqUiFoGajxOcreDcwZquSplZdNNs iLr7g3f2ievytMjdqTwNeSRkhnQmo2m+hIoZZJJNdbCHntFq8TXA7rC6t58hxH6r9ct/ g/yQ== X-Gm-Message-State: AKaTC00xL9oI0EiPskBtwlKS8E9WbhHPE8PSffxBFdv3U9NLM7gX+moa7RjR6+l6sZANx5dc X-Received: by 10.194.201.133 with SMTP id ka5mr6065251wjc.151.1479469892315; Fri, 18 Nov 2016 03:51:32 -0800 (PST) Received: from thinkpad.localdomain (ip4da29576.direct-adsl.nl. [77.162.149.118]) by smtp.gmail.com with ESMTPSA id c202sm4050054wme.1.2016.11.18.03.51.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 03:51:31 -0800 (PST) From: Koen Kooi To: openembedded-devel@lists.openembedded.org Date: Fri, 18 Nov 2016 12:50:40 +0100 Message-Id: <1479469840-9275-1-git-send-email-koen.kooi@linaro.org> X-Mailer: git-send-email 2.4.11 MIME-Version: 1.0 Cc: Koen Kooi Subject: [oe] [meta-oe][PATCHv2] android-tools: fix do_install X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: openembedded-devel@lists.openembedded.org Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org The previous patch introduced 2 bugs that made packaging fail: 1) Always failing grep 2) Conditionally install systemd files Systemd.bbclass doesn't handle conditional installation and will throw an error. Tested with -native and regular cross builds. Signed-off-by: Koen Kooi --- Changes since v1: * don't use an intermediate file for grep (ndec) * Always create $bindir (André) * remove stray 'i' (André) .../android-tools/android-tools_5.1.1.r37.bb | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb index 1769b6a..a9e7d5d 100644 --- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb +++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb @@ -108,7 +108,7 @@ do_compile() { } do_install() { - if [ grep -q "ext4_utils" "${TOOLS}" ] ; then + if echo ${TOOLS} | grep -q "ext4_utils" ; then install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg @@ -120,22 +120,28 @@ do_install() { install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir} fi - if [ grep -q "adb " "${TOOLS}" ] ; then - install -m0755 ${B}/adb/adb ${D}${bindir}i + if echo ${TOOLS} | grep -q "adb " ; then + install -d ${D}${bindir} + install -m0755 ${B}/adb/adb ${D}${bindir} fi - if [ grep -q "adbd" "${TOOLS}" ] ; then + if echo ${TOOLS} | grep -q "adbd" ; then + install -d ${D}${bindir} install -m0755 ${B}/adbd/adbd ${D}${bindir} - install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ - ${D}${systemd_unitdir}/system/android-tools-adbd.service fi - if [ grep -q "fastboot" "${TOOLS}" ] ; then + # Outside the if statement to avoid errors during do_package + install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ + ${D}${systemd_unitdir}/system/android-tools-adbd.service + + if echo ${TOOLS} | grep -q "fastboot" ; then + install -d ${D}${bindir} install -m0755 ${B}/fastboot/fastboot ${D}${bindir} fi - if [ grep -q "mkbootimg" "${TOOLS}" ] ; then - install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir} + if echo ${TOOLS} | grep -q "mkbootimg" ; then + install -d ${D}${bindir} + install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir} fi }