Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 9FA9AE00C06; Tue, 8 Dec 2015 13:17:56 -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.42 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-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id D5319E00B5A for ; Tue, 8 Dec 2015 13:17:36 -0800 (PST) Received: by pacdm15 with SMTP id dm15so17819143pac.3 for ; Tue, 08 Dec 2015 13:17:36 -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=909UZHvLoo7GO7NR551YIakeOR4lRxGmO6c5GPVAPuQ=; b=HlQbn6Ly8C0r1a4UQslBVQ2b+OqyK1FKyHgtilewdR8401wUkinPrisR/Sl+JwzZIT X8cuy4csbJX9bvcVBkvrIeXOywPAkAaHTXX3HTh43jinhKHCA9wwrMvmPPUnxNTHB67x 7tu6/gb5TimFFiv+OTbdVXZR9X9BGTwle8R8ErTv3x3sbeX8ImED/ELWC3Kuq1Rz3tKS W+ur/X9FnsQDT9e9CWgGkK28iAes06EfKpkDlBQsEjem2lcjTm7ElUpm32fR1g4iDQ5F wH1EF0qD87piWlAt6pcPqyCXUbqSlHqYdWhIEm3Z9fLO7zyLKKh0r/T/nyXTdnyKrnaJ /gfg== 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=909UZHvLoo7GO7NR551YIakeOR4lRxGmO6c5GPVAPuQ=; b=UUCX6sMKAO56QOLQZbL7unPj4oAf7qL0SNXMOtB1+JlePORBrHRWgZxG8Cx7euvI+i 4y7mAk3bIEY8FYVg2xyRcfSxX6QUvdeR1LPB5ptQqGb/3hxbiRcRGRCqvzd2YjZECHIy vN9mzZkpZ7u93n+B+vElc9Ty7qJUcrV9fAzS7d6iDzXogJpbpYPxhP5ErvhvLLC78BM3 1O5p/KQN5vCJvgjr7oSSggsfeoSV6A4gDwCHfiu9tGxzu/fHk9TPxR1jnZ79I6xgWYvg QTfm9zwu+Ooen+MaNFFCV+JHCGzmBza1VPfbr3B1/BpTHf2N/DRDhKSZ+lai2a/oyr1a s6CQ== X-Gm-Message-State: ALoCoQkdqwUpQPQ2Mo6rTtvJ6ZgbVAwMiJCDQcMiYU7NfZU78aehBfqlzGwFYAvh0U2d4b6L23MkHCrnQpSGZBe46dl4il1O/A== X-Received: by 10.66.234.226 with SMTP id uh2mr2967496pac.6.1449609456159; Tue, 08 Dec 2015 13:17:36 -0800 (PST) Received: from draco.ger.corp.intel.com ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id v64sm6675766pfi.50.2015.12.08.13.17.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 13:17:34 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Tue, 8 Dec 2015 21:16:09 +0000 Message-Id: <1449609380-11073-24-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449609380-11073-1-git-send-email-michael.g.wood@intel.com> References: <1449609380-11073-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 23/34] toaster: orm Add convenience method to get all pkgs in a CustomImageRecipe 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: Tue, 08 Dec 2015 21:17:56 -0000 Returns a queryset of the all the packages that we expect to have in a CustomImageRecipe. Signed-off-by: Michael Wood --- bitbake/lib/toaster/orm/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 3c64212..b292cd9 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -1265,6 +1265,12 @@ class CustomImageRecipe(Recipe): base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe') project = models.ForeignKey(Project) + def get_all_packages(self): + """Get the included packages and any appended packages""" + return ProjectPackage.objects.filter((Q(recipe_appends=self) | + Q(recipe_includes=self)) & + ~Q(recipe_excludes=self)) + def generate_recipe_file_contents(self): """Generate the contents for the recipe file.""" # If we have no excluded packages we only need to _append -- 2.1.4