Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5D9ECE00B46; Mon, 7 Mar 2016 08:07:28 -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: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.220.51 listed in list.dnswl.org] * -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 Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 08D37E0083D for ; Mon, 7 Mar 2016 08:07:12 -0800 (PST) Received: by mail-pa0-f51.google.com with SMTP id fy10so80613719pac.1 for ; Mon, 07 Mar 2016 08:07:12 -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=iCz6Xpx5PUuTpj+6fgO82FkJael1eIxQllYrQVoosUZtpOoMb0pMdyIBZ4Lk5c/pfH HJ7GjVjGkJtDVtgM9rlmXsJQPtUhCV4ddukaByWJXW1W6/vkiUxkb9QfRkPHnLyqgm69 wm2/EwB7L0cn7YdsaMEfzhsGfj7GH/xH5p2m1r0lHXnVmrP17OlcVwWY+5a0uaSxwO+w FRUU0OECOkQ7fAz6vEBSKJO4FV/VDjg7EovpyYG12/hUxWvFh69kM2DRKEfj8sbu08of ZzpfzlAu1yWigYYhhFR+cQeG1wkVqWhUDwXGFnMncRfTzPi5/PLo0stQhM3pY3qtunwQ IIkA== 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=A6+kQc0k3I+eOzmKdbMyiTaLmKUMf57b28l2fYQg1suNB1sJn31TpMJQANAbhgVAK4 HlS9F+HbOMgfSZPtuQiquxW9ARt5O/C8N4x5qR0Wd10G0Tw8UGrfbyblu0qeg2w9FBvY SU0/S00wAVltVACzc26H9m/39bkC9o1w6mmY8JVjarWr1ZN55ozwm7K01IUnm4FXbauI JvrXzZq5jmOPSPkWEt6wCzxybxSqJbgcefn7L3SvgW8ULaOvuAFgm3SpwVbxoKQCzT9T yVVfwb/rFcsKmHIQFKda8230NP0mmq5phGe7jqiU5Tz92zwBU2t60utc+syKyU4QE5+u ZFBA== X-Gm-Message-State: AD7BkJJIrhh+D8aNmgBgD8YLAE3OrJDj8oj7NSVz9SBuTGflB6qGGgn5YD13N3/lNrmD0eF3 X-Received: by 10.66.144.134 with SMTP id sm6mr34540903pab.158.1457366832542; Mon, 07 Mar 2016 08:07:12 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by smtp.gmail.com with ESMTPSA id yj1sm25182440pac.16.2016.03.07.08.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Mar 2016 08:07:11 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Mon, 7 Mar 2016 16:03:19 +0000 Message-Id: <1457366599-12973-5-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457366599-12973-1-git-send-email-michael.g.wood@intel.com> References: <1457114340-16784-1-git-send-email-michael.g.wood@intel.com> <1457366599-12973-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH v2 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: Mon, 07 Mar 2016 16:07:28 -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