From patchwork Thu May 29 20:38:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 353847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 1AA40140093 for ; Fri, 30 May 2014 06:38:50 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 89DC88BF60; Thu, 29 May 2014 20:38:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mexavzNN6CRM; Thu, 29 May 2014 20:38:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8D8A98BF73; Thu, 29 May 2014 20:38:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7C45E1BFA5B for ; Thu, 29 May 2014 20:38:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 79CD887A06 for ; Thu, 29 May 2014 20:38:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qn8RPuOn6yWO for ; Thu, 29 May 2014 20:38:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by hemlock.osuosl.org (Postfix) with ESMTPS id 110BC87A4B for ; Thu, 29 May 2014 20:38:34 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id w62so1018887wes.30 for ; Thu, 29 May 2014 13:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=UHNCRAZXjRgZ0jD7Q8/qUp5bqk92nbZbVf7/jQ+fhe0=; b=w7/RupGDQKWqSEIhsDtJ1gwzzAmt7Cr9GfA2w9fVORVT2oE8vkOMa7Uju8knY+Tt+r lsFyNc8zmn3qcz1x6MTG4YkdXkWztsqsqPMzfafCSMwBNgjkkyC5+8QS6q+6y44fi7XW qNdh+Yb+IbuFdAHWbW+lKwiLji1ja7JlvaPTl9f6Lb1lB+i1uIcUJ1WOMy4HHHv0BiXf e2ewURnwtfUOxsfXxSB2A7+uEv+bPN87J+0BpNyo2ZbLP5UkWYM6ksXRL2o3HsJRnrPz j9uhV+PQ78siOmpeAeQqhLMjqDRim57yuk2kh6tvKwt9IO7+ifK2CI+4HonJSYZJwTOP djBA== X-Received: by 10.194.1.242 with SMTP id 18mr14860042wjp.22.1401395913078; Thu, 29 May 2014 13:38:33 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id ej2sm4374906wjd.21.2014.05.29.13.38.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 May 2014 13:38:32 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Thu, 29 May 2014 22:38:19 +0200 Message-Id: <422547083c511f283426d0c0bae5ecc4d4dcee4e.1401395407.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 05/11 RFC] support/scripts: who's responsibile to decide what is a package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: "Yann E. MORIN" When generating the package lists, the reponsibility to decide what is actually a package symbol is currently split between the _is_package(), the get_symbol_subset() and the format_asciidoc_table() funtions. The two latter functions check that an item is really a symbol, and that is has a prompt. While this is currently correct for real packages, this will no longer be the case when we also generate a list of virtual packages, since they do not have a prompt. Move the responsibility to verify that a symbol is indeed a package symbol to is_package(), so it's all in one place, and makes it easier to change for virtual packages. Signed-off-by: "Yann E. MORIN" Cc: Samuel Martin --- support/scripts/gen-manual-lists.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/support/scripts/gen-manual-lists.py b/support/scripts/gen-manual-lists.py index 10dbbd3..7144ca3 100644 --- a/support/scripts/gen-manual-lists.py +++ b/support/scripts/gen-manual-lists.py @@ -75,8 +75,6 @@ def get_symbol_subset(root, filter_func): raise Exception(message) for item in get_items(): if item.is_symbol(): - if not item.prompts: - continue if not filter_func(item): continue yield item @@ -134,8 +132,6 @@ def format_asciidoc_table(root, get_label_func, filter_func=lambda x: True, return "| {0:<40}\n".format(item) lines = [] for item in get_symbol_subset(root, filter_func): - if not item.is_symbol() or not item.prompts: - continue loc = get_symbol_parents(item, root, enable_choice=enable_choice) lines.append(_format_entry(get_label_func(item), loc, sub_menu)) if sorted: @@ -247,6 +243,10 @@ class Buildroot: Note: only 'real' is (implictly) handled for now """ + if not symbol.is_symbol(): + return False + if type == 'real' and not symbol.prompts: + return False if not self.re_pkg_prefix.match(symbol.get_name()): return False pkg_name = self._get_pkg_name(symbol)