From patchwork Sat Dec 16 12:55:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 849504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c0c::23d; helo=mail-wr0-x23d.google.com; envelope-from=swupdate+bncbcxploxj6ikrbznp2tiqkgqesusfx5y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="hwOKU00G"; dkim-atps=neutral Received: from mail-wr0-x23d.google.com (mail-wr0-x23d.google.com [IPv6:2a00:1450:400c:c0c::23d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yzS3D6228z9t2d for ; Sat, 16 Dec 2017 23:56:07 +1100 (AEDT) Received: by mail-wr0-x23d.google.com with SMTP id y15sf6565912wrc.6 for ; Sat, 16 Dec 2017 04:56:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1513428965; cv=pass; d=google.com; s=arc-20160816; b=fcGvR5NVgTucxeuAP/AIUK3dQz2hcKPxW5hp+rUjewi0nN2RI6SbLgSEu7JOEqdq4/ zVkblOY0cYuhekA1BDD9PX9Q2Bu2yrwWHmizvINNlwTSwTbB8NhEh3yKIP5Hsa0vtHKv E1s8re72K5v2kTxdTnwzNU7Fsm29LidLjOWceqquZ9eXdcFPQJIjBslZsCGI0VlLIHiF TJuQr989CbjS5fCgXWsjdKnBwkcgOhODbc/fIE7tYqbAaSynGX5aTwJqSGJEd/K9BvQf jyh/I49y0PIDevcyiZu9sQ9OtiQjOSgSWUkcTFQ39ovPcC96uFLbjHQW29/rEDJ/2vav QbOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=6UHmh2ulaGVNhXwsF6HpHLhAHogAUOXgFx8Hs5hHx54=; b=z4M/DK9+xWfoYKYd/3iK9KDa3LnKKrll0hh0AX1UHHKfNQBmhHhXoRywBWwIsrqKC5 48uArzDhCqwP4pHSj/0J/B9WpqeNQy/Hmf0h/zRYFI2//fn3+RhP0UnCJsG5XauJr5ll N7QlAuXYQrbdsuvIlNZxSgYEmfPuI9efxNPiOL8NebE7kT82i5feF3HjwnF5gyE0oTHn Y0F7b/r44dEYkyVguMC2NR2xsmZcfKZoDUSpBLsJ+UKRbRxooatJiAvitvzeehxcjkYS FXopZZmUTQR0uQ+R0uOppMiKe59aKjAV8F/wbWro2HxWFemTHg/4Dnntg6YOeZNGOF3T 753A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=6UHmh2ulaGVNhXwsF6HpHLhAHogAUOXgFx8Hs5hHx54=; b=hwOKU00Gb7vPYJ7rZEKdCpoJaLFWeqV+meIiSPF1dwvWdfFew8pu6H6mpvBbjwm7vJ NE8emnLBZ1nuaQvmBIlnp8NNoewjDJNurv7HoirKLc5dSGxSLuGbGwNXFHtDNTAznDKk u5xBYomllAu5qHyOfpC8EBx1TMoUP4WgaFTLjwKaCJkM7AX03S4fApGxSkHJ/jzy05TV iHz8noXi43QmzndkQlswIKXwBhT5PydHES2JzMbFMVuaPqwfDPXYjaaIDW7tOoAThObm NMkDl7eHZvlaCgtHfq3vd8MV6ogP2k1FxQOERXD6mDpR5rLpF43YshA4MNncfSggt+xE eaDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=6UHmh2ulaGVNhXwsF6HpHLhAHogAUOXgFx8Hs5hHx54=; b=d3ZtbdVxbKKb9E4v08UvaRnrdHmGjCneavWTMM6t6hoIodJy6+IaZOydXMzE3vfto6 EIlZFtunsH+ZR1UpRf8nX4q1A9GeC76+Rm/U6QRqKZBCQxXym674Ro5Hr4XITvhkUrG5 P7HBnKOhb62gboy1D8YkHXR7n/UIEkHFoTg1pE4qVqwGoYrCm+OLoGlz+FoVY3YwEUiH 7bKPH0l+FkDsXqcXx8sh8pmVp7AC+Qj1d74M8aC+SBOJWkNrinrE9b8GqRut2U8CbTn7 /ZauBPnnAfqfFVdDwXJSt75grj+VK8EvZnpnCSaRkb1M4z6UGfDnu7RFPrBTNf1y4pvK 6E6A== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKGB3mJGt1i4mjb+tukugGk9WWiK/VGEqEMIqeVaoZJeRHuOxYmSQDjc KsbPTrEe+v+sK2XCHbKS8ns= X-Google-Smtp-Source: ACJfBouJ7oqalLH/1Hvqo3dqPWSfItPe676XuLtQEzsW3GOYHfUxNf+yZRj74YW2UyBuZ62uFCH54Q== X-Received: by 10.28.133.11 with SMTP id h11mr81453wmd.0.1513428965387; Sat, 16 Dec 2017 04:56:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.223.160.131 with SMTP id m3ls2469005wrm.3.gmail; Sat, 16 Dec 2017 04:56:04 -0800 (PST) X-Received: by 10.28.241.16 with SMTP id p16mr794911wmh.27.1513428964873; Sat, 16 Dec 2017 04:56:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513428964; cv=none; d=google.com; s=arc-20160816; b=eeVcC+vzVDR/p6nSWEdk5sWM/ELxZ52XHSxmzw262iK4iyhWtrHjElLO7+fiE/abc8 1GgCx2yTDR8RQ3gMyplWDZkNq/c40p9Her1bQJdRDOF3Wl8NuzgH3G42AHa3UNpVr2dR qfx2DY364FqZx06kUPEKZM14h5vgMrsFpuDMwaDirEseTwnZkqnbqhsjqIZqWHzAR85T zmwKoifvBZb+fByKyE6NXl1zX7UO3bcCUPRwxvqx3PFCTNhgJdb4Lh6W/KIktgEpX6TE Ezh4exRJ0oFtUfvDnZzKgnY5Jp3M+e367yGC0eOmzfHfrKT/ZzovRYkFXxNokOJNlwPl ajhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=u9ebg0IwNrgyAqB9GcaXkUj//0SFzDwpFICLRCIaX8I=; b=bQaPpIHm2AehtJ8JK+oEZW//f22S4U7rr648f59Fj/v9pM2Fx6zjI7w23Nf8saFFFh FZ/w2B7mzlHFmc9PnK5hCP0yTZWZ6Zgeu80XkR7jHCfk5URNTyEXUfJS7DhFcQo9wRU9 PHncihRjeoDk9V0dYcodFLXuZuqfhy28tvCTGU7zC+L3ctNlGEEw/OiYQbH1T8XlAA+E PV++13laExSbHA4MyemT2M2JHK3XvOJrCEkxUJlDR2Ku2h+U57SflU4G1XDCUYWWT+TS OAYVLa5dZP1qRtyiEZtyppF4jev1ag6TH/5/Pf2oDuvvSF7/KMyfuV4jc+/gSItxba7W 7+bw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id m4si1019427wrm.4.2017.12.16.04.56.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Dec 2017 04:56:04 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3yzS384J81z1qrNh; Sat, 16 Dec 2017 13:56:04 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3yzS3843D6z1qqkb; Sat, 16 Dec 2017 13:56:04 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id u38OyXtp2bFf; Sat, 16 Dec 2017 13:56:03 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sat, 16 Dec 2017 13:56:03 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 11B084540507; Sat, 16 Dec 2017 13:56:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eriRYQ0NYogC; Sat, 16 Dec 2017 13:56:00 +0100 (CET) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 75EA9454027E; Sat, 16 Dec 2017 13:56:00 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Jose.DiazdeGrenu@digi.com, Stefano Babic Subject: [swupdate] [meta-swupdate][PATCH] Fix build without network Date: Sat, 16 Dec 2017 13:55:33 +0100 Message-Id: <1513428933-10902-1-git-send-email-sbabic@denx.de> X-Mailer: git-send-email 2.7.4 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , bitbake runs git ls-remote if a recipe contains AUTOREV as SRCREV. This forbids to build SWUpdate without network (setting BB_NO_NETWORK), because the git version uses the last commit via AUTOREV. Add a function to provide SRCREV for swupdate_git. This returns a fix commit if the git version is not chosen, or AUTOREV if swupdate_git is selected. Signed-off-by: Stefano Babic Reported-by: Diaz de Grenu, Jose --- recipes-support/swupdate/swupdate.inc | 2 -- recipes-support/swupdate/swupdate_git.bb | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc index 1431d15..7175848 100644 --- a/recipes-support/swupdate/swupdate.inc +++ b/recipes-support/swupdate/swupdate.inc @@ -16,8 +16,6 @@ SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=https \ file://swupdate-progress.service \ " -SRCREV = "${AUTOREV}" - INSANE_SKIP_${PN} = "ldflags" PACKAGES =+ "${PN}-www" diff --git a/recipes-support/swupdate/swupdate_git.bb b/recipes-support/swupdate/swupdate_git.bb index 6aff30c..4fc15ad 100644 --- a/recipes-support/swupdate/swupdate_git.bb +++ b/recipes-support/swupdate/swupdate_git.bb @@ -2,3 +2,19 @@ require swupdate.inc require swupdate_tools.inc DEFAULT_PREFERENCE = "-1" + +# If a recipe sets SRCREV to ${AUTOREV}, bitbake tries +# a git ls-remote. This breaks when a mirror is built +# and BB_NO_NETWORK is set. +# To work-around the issue, sets the revision for the git +# version to a fix commit (not relevant) +# In casethe _git version is chosen, sets the revision +# to TOT to test with last commit-id. +def version_git(d): + version = d.getVar("PREFERRED_VERSION_%s" % d.getVar('PN')) + if version is not None and "git" in version: + return d.getVar("AUTOREV") + else: + return "c0fec16b3fc82b0db12d8ac58be7055ed1b8d439" + +SRCREV ?= '${@version_git(d)}'