Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5DD6AE00CEC; Fri, 4 Mar 2016 09:59:40 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.192.173 listed in list.dnswl.org] Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id C17C8E00CE7 for ; Fri, 4 Mar 2016 09:59:26 -0800 (PST) Received: by mail-pf0-f173.google.com with SMTP id 124so39275948pfg.0 for ; Fri, 04 Mar 2016 09:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+PIh1UxTCipL3jZS+9OtNCpJDKMMehOkfUQXbG17cNs=; b=TfYc5yxEKDJo7Ed4actC8Mw2WPYoHjsfpbdubwRBoLFabkOSLGN723oSjv0FWBiAXj kYDXRJvRabP/iZGI8+LsWXOxDSApFBZL0Fcz8c+I56I2MS4sihSIniMb15/3gO8DqxTR 8IUzW6EGeUKXR3RCTfhFgzTTOKkCMsm2PKPO58VYs3bcOFmAple6oiAQnmmSvrppugpa gpGowPHdFLXCBpE04CqR8J6VZQ/5s8XihvzoL29FeenG3p1Mknttl1oWaOEDPx+eX26M ZlIsiECA/ik+diroFAgVvYMowDrHgjzgFyygkX6AUz/na8y2aO8D11l2nf5U9qHQeVEr gAsQ== 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:in-reply-to :references; bh=+PIh1UxTCipL3jZS+9OtNCpJDKMMehOkfUQXbG17cNs=; b=iwuvxEOppQBRJNiUZSrrEwGR9mxa7nz6KtBVkni6aK219YMKXaaV5z4OPr1QfzTIGx fcmtWMQHLw9jeOCCOJDGt3SEoFPtwh4cVlUH5JxFNpjmTeMGc1dGSig1hQYODTmmY/hg nZoYV3qw1iAg8hVI+B5ARC8r1LxV0YKtFRVVnXyiqXc5XZSIReoEgOdURZYdg2+vVmT5 4+mOLqg7XmLXgLDrU/BFIXI5wjWAwPusZExYTedRC5kbphiayUIN2t5qmX25B/WB7GsA wsxD26GnnriPg+Sdu76p31rWNEw9vpQqKBCO+I+PYlQWLm2GNHWj7alvwPjXujhcqmpC fmew== X-Gm-Message-State: AD7BkJJWnvG+Tv9ey9hfGHAU1aF89onb6+4UBEAPoSzZpiaNVRc9xTPjFHR275WVxjqu3z5x X-Received: by 10.98.7.11 with SMTP id b11mr14054025pfd.38.1457114366137; Fri, 04 Mar 2016 09:59:26 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr04-ext.fm.intel.com. [192.55.55.39]) by smtp.gmail.com with ESMTPSA id 9sm6972342pfc.69.2016.03.04.09.59.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 09:59:25 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Fri, 4 Mar 2016 17:59:00 +0000 Message-Id: <1457114340-16784-6-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457114340-16784-1-git-send-email-michael.g.wood@intel.com> References: <1457114340-16784-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 5/5] toaster: orm generate CustomImageRecipe contents try secondary path X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 17:59:40 -0000 Try a secondary file path if the first does not exist. When we get the recipe paths and layer information from the layer index it is not a complete path but we are usually able to reconstruct it. If the complete real path has been discovered by building then use this instead. [YOCTO #9206] Signed-off-by: Michael Wood --- bitbake/lib/toaster/orm/models.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index d451989..b89bfa9 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -1515,10 +1515,13 @@ class CustomImageRecipe(Recipe): packages_conf += pkg.name+' ' packages_conf += "\"" - - base_recipe = open("%s/%s" % - (self.base_recipe.layer_version.dirpath, - self.base_recipe.file_path), 'r').read() + try: + base_recipe = open("%s/%s" % + (self.base_recipe.layer_version.dirpath, + self.base_recipe.file_path), 'r').read() + except IOError: + # The path may now be the full path if the recipe has been built + base_recipe = open(self.base_recipe.file_path, 'r').read() # Add a special case for when the recipe we have based a custom image # recipe on requires another recipe. -- 2.5.0