From patchwork Mon Jan 8 14:52:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkBR0S9Pz9ryk for ; Wed, 10 Jan 2018 20:25:18 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D8433B91593; Wed, 10 Jan 2018 10:21:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:33 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id ACF7BB80DF1 for ; Mon, 8 Jan 2018 15:52:47 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:46 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id B602F20468; Mon, 8 Jan 2018 15:52:45 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:14 +0100 Message-Id: <8dcc1f30a14d5f09463417d398f977869ced1134.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 01/15] metadata: remove 'base-files' special case X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Nothing explicitly depends on base-files, and even if it would, it would not cause any problems. Remove the unused special case. Signed-off-by: Matthias Schiffer --- scripts/package-metadata.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index fbd458bf2a..46446e994b 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -539,7 +539,7 @@ sub gen_package_mk() { } elsif (defined($srcpackage{$dep})) { $idx = $subdir{$dep}.$dep; } - undef $idx if $idx eq 'base-files'; + if ($idx) { $idx .= $suffix; From patchwork Mon Jan 8 14:52:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGsPp25KJz9ryv for ; Thu, 11 Jan 2018 01:50:38 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id F0CCBB915DF; Wed, 10 Jan 2018 10:22:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:14 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B03DFB80DFA for ; Mon, 8 Jan 2018 15:52:47 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:46 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id E627220469; Mon, 8 Jan 2018 15:52:45 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:15 +0100 Message-Id: <5a3e92806056c07ac818ca2000189e61150e7d29.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 02/15] metadata: make srcpackage extensible X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Turn the srcpackage values into hashes to allow storing more information than just binary package names. Signed-off-by: Matthias Schiffer --- scripts/feeds | 2 +- scripts/metadata.pm | 6 ++++-- scripts/package-metadata.pl | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index 55c294ad0a..42f7b3b116 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -525,7 +525,7 @@ sub install_package { }; # install all dependencies referenced from the source package - foreach my $vpkg (@{$feed_src->{$src}}) { + foreach my $vpkg (@{$feed_src->{$src}->{packages}}) { foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) { next if $dep =~ /@/; $dep =~ s/^\+//; diff --git a/scripts/metadata.pm b/scripts/metadata.pm index d446892e2b..297abc9f12 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -212,7 +212,9 @@ sub parse_package_metadata($) { $src = $3; $subdir =~ s/^package\///; $subdir{$src} = $subdir; - $srcpackage{$src} = []; + $srcpackage{$src} = { + packages => [], + }; $override = ""; undef $pkg; }; @@ -237,7 +239,7 @@ sub parse_package_metadata($) { $pkg->{tristate} = 1; $pkg->{override} = $override; $package{$1} = $pkg; - push @{$srcpackage{$src}}, $pkg; + push @{$srcpackage{$src}->{packages}}, $pkg; }; /^Feature:\s*(.+?)\s*$/ and do { undef $pkg; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 46446e994b..3a176c8024 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -445,7 +445,7 @@ sub gen_package_mk() { print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n"; } - foreach my $spkg (@{$srcpackage{$pkg->{src}}}) { + foreach my $spkg (@{$srcpackage{$pkg->{src}}->{packages}}) { foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) { $dep =~ /@/ or do { $dep =~ s/\+//g; From patchwork Mon Jan 8 14:52:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkCB5wj1z9ryk for ; Wed, 10 Jan 2018 20:25:58 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 47B6BB9159E; Wed, 10 Jan 2018 10:21:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:40 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C3893B90BE0 for ; Mon, 8 Jan 2018 15:52:47 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:46 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 1FD022046A; Mon, 8 Jan 2018 15:52:46 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:16 +0100 Message-Id: X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 03/15] metadata: move 'buildtypes' from binary to source packages X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Build types are a property of source rather than binary packages. This is a preparation for followup cleanup. Signed-off-by: Matthias Schiffer --- scripts/metadata.pm | 4 ++-- scripts/package-metadata.pl | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 297abc9f12..985e6237a6 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -214,6 +214,7 @@ sub parse_package_metadata($) { $subdir{$src} = $subdir; $srcpackage{$src} = { packages => [], + buildtypes => [], }; $override = ""; undef $pkg; @@ -234,7 +235,6 @@ sub parse_package_metadata($) { $pkg->{depends} = []; $pkg->{mdepends} = []; $pkg->{builddepends} = []; - $pkg->{buildtypes} = []; $pkg->{subdir} = $subdir; $pkg->{tristate} = 1; $pkg->{override} = $override; @@ -258,6 +258,7 @@ sub parse_package_metadata($) { /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t"); next; }; + /^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}->{buildtypes} = [ split /\s+/, $1 ]; next unless $pkg; /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; @@ -290,7 +291,6 @@ sub parse_package_metadata($) { /^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1; /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ]; /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ]; - /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ]; /^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1; /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 3a176c8024..08c2343ade 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -421,6 +421,7 @@ sub gen_package_mk() { foreach my $name (sort {uc($a) cmp uc($b)} keys %package) { my $config; my $pkg = $package{$name}; + my $src = $srcpackage{$pkg->{src}}; my @srcdeps; next if defined $pkg->{vdepends}; @@ -441,11 +442,11 @@ sub gen_package_mk() { next if $done{$pkg->{src}}; $done{$pkg->{src}} = 1; - if (@{$pkg->{buildtypes}} > 0) { - print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n"; + if (@{$src->{buildtypes}} > 0) { + print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n"; } - foreach my $spkg (@{$srcpackage{$pkg->{src}}->{packages}}) { + foreach my $spkg (@{$src->{packages}}) { foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) { $dep =~ /@/ or do { $dep =~ s/\+//g; @@ -453,7 +454,7 @@ sub gen_package_mk() { }; } } - foreach my $type (@{$pkg->{buildtypes}}) { + foreach my $type (@{$src->{buildtypes}}) { my @extra_deps; my %deplines; @@ -476,7 +477,7 @@ sub gen_package_mk() { my $idx = ""; my $pkg_dep = $package{$dep}; if (defined($pkg_dep) && defined($pkg_dep->{src})) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) { + unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", $pkg->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; next; @@ -530,7 +531,7 @@ sub gen_package_mk() { foreach my $dep (@deps) { $pkg_dep = $package{$deps}; if (defined $pkg_dep->{src}) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) { + unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", $pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; next; From patchwork Mon Jan 8 14:52:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkCb2jWfz9ryk for ; Wed, 10 Jan 2018 20:26:19 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 69245B9169D; Wed, 10 Jan 2018 10:21:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:43 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CDD5CB90E9E for ; Mon, 8 Jan 2018 15:52:47 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:46 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 4DB512046B; Mon, 8 Jan 2018 15:52:46 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:17 +0100 Message-Id: X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 04/15] metadata: move 'builddepends' from binary to source packages X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Matthias Schiffer --- scripts/feeds | 20 +++++++++++--------- scripts/metadata.pm | 6 +++--- scripts/package-metadata.pl | 16 +++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index 42f7b3b116..31481edcb1 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -525,15 +525,17 @@ sub install_package { }; # install all dependencies referenced from the source package - foreach my $vpkg (@{$feed_src->{$src}->{packages}}) { - foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) { - next if $dep =~ /@/; - $dep =~ s/^\+//; - $dep =~ s/^.+://; - $dep =~ s/\/.+$//; - next unless $dep; - install_package($feed, $dep, 0) == 0 or $ret = 1; - } + foreach my $dep ( + @{$feed_src->{$src}->{builddepends}}, + @{$feed_src->{$src}->{"builddepends/host"}}, + map { @{$_->{depends}} } @{$feed_src->{$src}->{packages}} + ) { + next if $dep =~ /@/; + $dep =~ s/^\+//; + $dep =~ s/^.+://; + $dep =~ s/\/.+$//; + next unless $dep; + install_package($feed, $dep, 0) == 0 or $ret = 1; } return $ret; diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 985e6237a6..c150b547f1 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -215,6 +215,7 @@ sub parse_package_metadata($) { $srcpackage{$src} = { packages => [], buildtypes => [], + builddepends => [], }; $override = ""; undef $pkg; @@ -234,7 +235,6 @@ sub parse_package_metadata($) { $pkg->{title} = ""; $pkg->{depends} = []; $pkg->{mdepends} = []; - $pkg->{builddepends} = []; $pkg->{subdir} = $subdir; $pkg->{tristate} = 1; $pkg->{override} = $override; @@ -258,6 +258,8 @@ sub parse_package_metadata($) { /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t"); next; }; + /^Build-Depends: \s*(.+)\s*$/ and $srcpackage{$src}->{builddepends} = [ split /\s+/, $1 ]; + /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $srcpackage{$src}->{"builddepends/$1"} = [ split /\s+/, $2 ]; /^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}->{buildtypes} = [ split /\s+/, $1 ]; next unless $pkg; /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; @@ -289,8 +291,6 @@ sub parse_package_metadata($) { /^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1; /^Default-Variant: .*/ and $pkg->{variant_default} = 1; /^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1; - /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ]; - /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ]; /^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1; /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 08c2343ade..a6cff40696 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -446,20 +446,18 @@ sub gen_package_mk() { print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n"; } - foreach my $spkg (@{$src->{packages}}) { - foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) { - $dep =~ /@/ or do { - $dep =~ s/\+//g; - push @srcdeps, $dep; - }; - } + foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) { + $dep =~ /@/ or do { + $dep =~ s/\+//g; + push @srcdeps, $dep; + }; } foreach my $type (@{$src->{buildtypes}}) { my @extra_deps; my %deplines; - next unless $pkg->{"builddepends/$type"}; - foreach my $dep (@{$pkg->{"builddepends/$type"}}) { + next unless $src->{"builddepends/$type"}; + foreach my $dep (@{$src->{"builddepends/$type"}}) { my $suffix = ""; my $deptype = ""; my $condition; From patchwork Mon Jan 8 14:52:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkCy5q7fz9ryk for ; Wed, 10 Jan 2018 20:26:38 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B8685B916B1; Wed, 10 Jan 2018 10:21:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:46 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1CC47B801E9 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 7BA6B2046C; Mon, 8 Jan 2018 15:52:46 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:18 +0100 Message-Id: <19bdf1c953948d8e4e96512974bdb25715dee9b2.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 05/15] metadata: interate over source packages when generating Makefile X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" All build dependencies are between source packages. Interating over source rather than binary packages simplifies parts of the code and prepares further improvement. As a side effect, this changes the implicit default variant of a few packages (the first defined is used now instead of the lexicographically first). Signed-off-by: Matthias Schiffer --- scripts/metadata.pm | 1 + scripts/package-metadata.pl | 61 ++++++++++++++++++++++++++------------------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index c150b547f1..404309dc4e 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -213,6 +213,7 @@ sub parse_package_metadata($) { $subdir =~ s/^package\///; $subdir{$src} = $subdir; $srcpackage{$src} = { + makefile => $makefile, packages => [], buildtypes => [], builddepends => [], diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index a6cff40696..077956e6a1 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -414,36 +414,45 @@ sub get_conditional_dep($$) { sub gen_package_mk() { my %conf; my %dep; - my %done; my $line; parse_package_metadata($ARGV[0]) or exit 1; - foreach my $name (sort {uc($a) cmp uc($b)} keys %package) { - my $config; - my $pkg = $package{$name}; - my $src = $srcpackage{$pkg->{src}}; + foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) { + my $src = $srcpackage{$srcname}; + my $path = $subdir{$srcname}.$srcname; + my $variant_default; my @srcdeps; - next if defined $pkg->{vdepends}; + foreach my $pkg (@{$src->{packages}}) { + next if defined $pkg->{vdepends}; + + my $config = ''; + $config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly}; + + $pkg->{prereq} and print "prereq-$config += $path\n"; + + next if $pkg->{buildonly}; + + print "package-$config += $path\n"; - $config = "\$(CONFIG_PACKAGE_$name)"; - if ($config) { - $pkg->{buildonly} and $config = ""; - print "package-$config += $pkg->{subdir}$pkg->{src}\n"; if ($pkg->{variant}) { - if (!defined($done{$pkg->{src}}) or $pkg->{variant_default}) { - print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n"; + if (!defined($variant_default) or $pkg->{variant_default}) { + $variant_default = $pkg->{variant}; } - print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n" + print "\$(curdir)/$path/variants += \$(if $config,$pkg->{variant})\n"; } - $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n"; } - next if $done{$pkg->{src}}; - $done{$pkg->{src}} = 1; + if (defined($variant_default)) { + print "\$(curdir)/$path/default-variant := $variant_default\n"; + } + + unless (grep {!$_->{buildonly}} @{$src->{packages}}) { + print "package- += $path\n"; + } if (@{$src->{buildtypes}} > 0) { - print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n"; + print "buildtypes-$path = ".join(' ', @{$src->{buildtypes}})."\n"; } foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) { @@ -477,7 +486,7 @@ sub gen_package_mk() { if (defined($pkg_dep) && defined($pkg_dep->{src})) { unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $pkg->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; + $src->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; next; } $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; @@ -494,7 +503,7 @@ sub gen_package_mk() { } my $depline = join(" ", sort keys %deplines); if ($depline) { - $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/$type/compile += $depline\n"; + $line .= "\$(curdir)/$path/$type/compile += $depline\n"; } } @@ -531,7 +540,7 @@ sub gen_package_mk() { if (defined $pkg_dep->{src}) { unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; + $src->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; next; } $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; @@ -543,17 +552,17 @@ sub gen_package_mk() { $idx .= $suffix; my $depline; - next if $pkg->{src} eq $pkg_dep->{src}.$suffix; - next if $dep{$condition.":".$pkg->{src}."->".$idx}; - next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends}; + next if $srcname eq $pkg_dep->{src}.$suffix; + next if $dep{$condition.":".$srcname."->".$idx}; + next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends}; my $depstr; if ($pkg_dep->{vdepends}) { $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)"; - $dep{$pkg->{src}."->($dep)".$idx} = 1; + $dep{$srcname."->($dep)".$idx} = 1; } else { $depstr = "\$(curdir)/$idx/compile"; - $dep{$pkg->{src}."->".$idx} = 1; + $dep{$srcname."->".$idx} = 1; } $depline = get_conditional_dep($condition, $depstr); if ($depline) { @@ -564,7 +573,7 @@ sub gen_package_mk() { } my $depline = join(" ", sort keys %deplines); if ($depline) { - $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n"; + $line .= "\$(curdir)/$path/compile += $depline\n"; } } From patchwork Mon Jan 8 14:52:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkDK1ZSjz9ryk for ; Wed, 10 Jan 2018 20:26:57 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 710A8B916BA; Wed, 10 Jan 2018 10:21:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:50 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1CCE2B80DF1 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id A89712046D; Mon, 8 Jan 2018 15:52:46 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:19 +0100 Message-Id: <6ac2562ff76fa02627200e0ac74548b666b98156.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 06/15] metadata: change pkg->{src} field to hold a reference X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" We often want to access fields of a source packages through pkg->{src}. Allow accessing them directly instead of resolving the source hash through srcpackages. Signed-off-by: Matthias Schiffer --- scripts/feeds | 4 ++-- scripts/metadata.pm | 51 ++++++++++++++++++++++----------------------- scripts/package-metadata.pl | 14 ++++++------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index 31481edcb1..b531fbac62 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -494,7 +494,7 @@ sub install_package { warn "WARNING: Package '$name' is not available in feed $feed->[1].\n"; return 0; }; - my $src = $pkg->{src}; + my $src = $pkg->{src}->{name}; my $type = $feed->[0]; $src or $src = $name; @@ -663,7 +663,7 @@ sub uninstall { warn "WARNING: $name not installed\n"; next; }; - $pkg->{src} and $name = $pkg->{src}; + $pkg->{src} and $name = $pkg->{src}->{name}; warn "Uninstalling package '$name'\n"; system("rm -f ./package/feeds/*/$name"); $uninstall = 1; diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 404309dc4e..0577390eda 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -193,9 +193,7 @@ sub parse_package_metadata($) { my $file = shift; my $pkg; my $feature; - my $makefile; my $preconfig; - my $subdir; my $src; my $override; my %ignore = map { $_ => 1 } @ignore; @@ -206,41 +204,42 @@ sub parse_package_metadata($) { }; while () { chomp; - /^Source-Makefile: \s*((.+\/)([^\/]+)\/Makefile)\s*$/ and do { - $makefile = $1; - $subdir = $2; - $src = $3; - $subdir =~ s/^package\///; - $subdir{$src} = $subdir; - $srcpackage{$src} = { - makefile => $makefile, + /^Source-Makefile: \s*(package\/((?:.+\/)?)([^\/]+)\/Makefile)\s*$/ and do { + $subdir{$3} = $2; + + $src = { + makefile => $1, + subdir => $2, + name => $3, + ignore => $ignore{$3}, packages => [], buildtypes => [], builddepends => [], }; + $srcpackage{$3} = $src; $override = ""; undef $pkg; }; /^Override: \s*(.+?)\s*$/ and do { $override = $1; - $overrides{$src} = 1; + $overrides{$src->{name}} = 1; }; next unless $src; /^Package:\s*(.+?)\s*$/ and do { undef $feature; $pkg = {}; - $pkg->{ignore} = $ignore{$src}; + $pkg->{ignore} = $src->{ignore}; $pkg->{src} = $src; - $pkg->{makefile} = $makefile; + $pkg->{makefile} = $src->{makefile}; $pkg->{name} = $1; $pkg->{title} = ""; $pkg->{depends} = []; $pkg->{mdepends} = []; - $pkg->{subdir} = $subdir; + $pkg->{subdir} = $src->{subdir}; $pkg->{tristate} = 1; $pkg->{override} = $override; $package{$1} = $pkg; - push @{$srcpackage{$src}->{packages}}, $pkg; + push @{$src->{packages}}, $pkg; }; /^Feature:\s*(.+?)\s*$/ and do { undef $pkg; @@ -251,7 +250,7 @@ sub parse_package_metadata($) { $feature and do { /^Target-Name:\s*(.+?)\s*$/ and do { $features{$1} or $features{$1} = []; - push @{$features{$1}}, $feature unless $ignore{$src}; + push @{$features{$1}}, $feature unless $src->{ignore}; }; /^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1; /^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1; @@ -259,9 +258,9 @@ sub parse_package_metadata($) { /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t"); next; }; - /^Build-Depends: \s*(.+)\s*$/ and $srcpackage{$src}->{builddepends} = [ split /\s+/, $1 ]; - /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $srcpackage{$src}->{"builddepends/$1"} = [ split /\s+/, $2 ]; - /^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}->{buildtypes} = [ split /\s+/, $1 ]; + /^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ]; + /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ]; + /^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ]; next unless $pkg; /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; @@ -279,8 +278,8 @@ sub parse_package_metadata($) { name => $vpkg, vdepends => [], src => $src, - subdir => $subdir, - makefile => $makefile + subdir => $src->{subdir}, + makefile => $src->{makefile}, }; push @{$package{$vpkg}->{vdepends}}, $pkg->{name}; } @@ -296,8 +295,8 @@ sub parse_package_metadata($) { /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; defined $category{$1} or $category{$1} = {}; - defined $category{$1}->{$src} or $category{$1}->{$src} = []; - push @{$category{$1}->{$src}}, $pkg; + defined $category{$1}->{$src->{name}} or $category{$1}->{$src->{name}} = []; + push @{$category{$1}->{$src->{name}}}, $pkg; }; /^Description: \s*(.*)\s*$/ and $pkg->{description} = "\t\t $1\n". get_multiline(*FILE, "\t\t "); /^Type: \s*(.+)\s*$/ and do { @@ -318,7 +317,7 @@ sub parse_package_metadata($) { $preconfig = { id => $1 }; - $preconfig{$pkgname}->{$1} = $preconfig unless $ignore{$src}; + $preconfig{$pkgname}->{$1} = $preconfig unless $src->{ignore}; } }; /^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1; @@ -329,9 +328,9 @@ sub parse_package_metadata($) { for my $ugspec (@ugspecs) { my @ugspec = split /:/, $ugspec, 2; - parse_package_metadata_usergroup($makefile, "user", \%usernames, \%userids, $ugspec[0]) or return 0; + parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0; if (@ugspec > 1) { - parse_package_metadata_usergroup($makefile, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; + parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; } } }; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 077956e6a1..2369c37e2b 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -484,12 +484,12 @@ sub gen_package_mk() { my $idx = ""; my $pkg_dep = $package{$dep}; if (defined($pkg_dep) && defined($pkg_dep->{src})) { - unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) { + unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $src->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; + $src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype; next; } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; + $idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name}; } elsif (defined($srcpackage{$dep})) { $idx = $subdir{$dep}.$dep; } else { @@ -538,12 +538,12 @@ sub gen_package_mk() { foreach my $dep (@deps) { $pkg_dep = $package{$deps}; if (defined $pkg_dep->{src}) { - unless (!$deptype || grep { $_ eq $deptype } @{$srcpackage{$pkg_dep->{src}}->{buildtypes}}) { + unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $src->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; + $src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype; next; } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; + $idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name}; } elsif (defined($srcpackage{$dep})) { $idx = $subdir{$dep}.$dep; } @@ -552,7 +552,7 @@ sub gen_package_mk() { $idx .= $suffix; my $depline; - next if $srcname eq $pkg_dep->{src}.$suffix; + next if $srcname eq $pkg_dep->{src}->{name}.$suffix; next if $dep{$condition.":".$srcname."->".$idx}; next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends}; my $depstr; From patchwork Mon Jan 8 14:52:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkDj4Jd7z9ryk for ; Wed, 10 Jan 2018 20:27:17 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6270EB916C3; Wed, 10 Jan 2018 10:21:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:54 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 5470AB90BE0 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id D6FC42047D; Mon, 8 Jan 2018 15:52:46 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:20 +0100 Message-Id: <84af005afc6dea3a5d6d787549b22a5c01eace6a.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 07/15] metadata: replace %subdir hash with a path field in source packages X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Every single reference to subdir was concatenated with the source package name, so it makes sense to store the concatenated value instead. Signed-off-by: Matthias Schiffer --- scripts/metadata.pm | 12 +++--------- scripts/package-metadata.pl | 25 ++++++++++++------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 0577390eda..e636a45a33 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,13 +2,12 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %srcpackage %category %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; our %preconfig; our %srcpackage; our %category; -our %subdir; our %features; our %overrides; our @ignore; @@ -178,7 +177,6 @@ sub parse_target_metadata($) { } sub clear_packages() { - %subdir = (); %preconfig = (); %package = (); %srcpackage = (); @@ -204,12 +202,10 @@ sub parse_package_metadata($) { }; while () { chomp; - /^Source-Makefile: \s*(package\/((?:.+\/)?)([^\/]+)\/Makefile)\s*$/ and do { - $subdir{$3} = $2; - + /^Source-Makefile: \s*(package\/((?:.+\/)?([^\/]+))\/Makefile)\s*$/ and do { $src = { makefile => $1, - subdir => $2, + path => $2, name => $3, ignore => $ignore{$3}, packages => [], @@ -235,7 +231,6 @@ sub parse_package_metadata($) { $pkg->{title} = ""; $pkg->{depends} = []; $pkg->{mdepends} = []; - $pkg->{subdir} = $src->{subdir}; $pkg->{tristate} = 1; $pkg->{override} = $override; $package{$1} = $pkg; @@ -278,7 +273,6 @@ sub parse_package_metadata($) { name => $vpkg, vdepends => [], src => $src, - subdir => $src->{subdir}, makefile => $src->{makefile}, }; push @{$package{$vpkg}->{vdepends}}, $pkg->{name}; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 2369c37e2b..c98db46d36 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -419,7 +419,6 @@ sub gen_package_mk() { parse_package_metadata($ARGV[0]) or exit 1; foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) { my $src = $srcpackage{$srcname}; - my $path = $subdir{$srcname}.$srcname; my $variant_default; my @srcdeps; @@ -429,30 +428,30 @@ sub gen_package_mk() { my $config = ''; $config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly}; - $pkg->{prereq} and print "prereq-$config += $path\n"; + $pkg->{prereq} and print "prereq-$config += $src->{path}\n"; next if $pkg->{buildonly}; - print "package-$config += $path\n"; + print "package-$config += $src->{path}\n"; if ($pkg->{variant}) { if (!defined($variant_default) or $pkg->{variant_default}) { $variant_default = $pkg->{variant}; } - print "\$(curdir)/$path/variants += \$(if $config,$pkg->{variant})\n"; + print "\$(curdir)/$src->{path}/variants += \$(if $config,$pkg->{variant})\n"; } } if (defined($variant_default)) { - print "\$(curdir)/$path/default-variant := $variant_default\n"; + print "\$(curdir)/$src->{path}/default-variant := $variant_default\n"; } unless (grep {!$_->{buildonly}} @{$src->{packages}}) { - print "package- += $path\n"; + print "package- += $src->{path}\n"; } if (@{$src->{buildtypes}} > 0) { - print "buildtypes-$path = ".join(' ', @{$src->{buildtypes}})."\n"; + print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n"; } foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) { @@ -489,9 +488,9 @@ sub gen_package_mk() { $src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype; next; } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name}; + $idx = $pkg_dep->{src}->{path}; } elsif (defined($srcpackage{$dep})) { - $idx = $subdir{$dep}.$dep; + $idx = $srcpackage{$dep}->{path}; } else { next; } @@ -503,7 +502,7 @@ sub gen_package_mk() { } my $depline = join(" ", sort keys %deplines); if ($depline) { - $line .= "\$(curdir)/$path/$type/compile += $depline\n"; + $line .= "\$(curdir)/$src->{path}/$type/compile += $depline\n"; } } @@ -543,9 +542,9 @@ sub gen_package_mk() { $src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype; next; } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}->{name}; + $idx = $pkg_dep->{src}->{path}; } elsif (defined($srcpackage{$dep})) { - $idx = $subdir{$dep}.$dep; + $idx = $srcpackage{$dep}->{path}; } if ($idx) { @@ -573,7 +572,7 @@ sub gen_package_mk() { } my $depline = join(" ", sort keys %deplines); if ($depline) { - $line .= "\$(curdir)/$path/compile += $depline\n"; + $line .= "\$(curdir)/$src->{path}/compile += $depline\n"; } } From patchwork Mon Jan 8 14:52:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGsRg0mPyz9ryv for ; Thu, 11 Jan 2018 01:52:14 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E13DFB915AD; Wed, 10 Jan 2018 10:21:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:21:57 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 6EFF5B90E9E for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 1044C20480; Mon, 8 Jan 2018 15:52:47 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:21 +0100 Message-Id: X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 08/15] metadata: remove redundant fields from package hash X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Matthias Schiffer --- scripts/metadata.pm | 3 --- scripts/package-metadata.pl | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index e636a45a33..50f91407d6 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -224,9 +224,7 @@ sub parse_package_metadata($) { /^Package:\s*(.+?)\s*$/ and do { undef $feature; $pkg = {}; - $pkg->{ignore} = $src->{ignore}; $pkg->{src} = $src; - $pkg->{makefile} = $src->{makefile}; $pkg->{name} = $1; $pkg->{title} = ""; $pkg->{depends} = []; @@ -273,7 +271,6 @@ sub parse_package_metadata($) { name => $vpkg, vdepends => [], src => $src, - makefile => $src->{makefile}, }; push @{$package{$vpkg}->{vdepends}}, $pkg->{name}; } diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index c98db46d36..233fb0eabf 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -290,7 +290,7 @@ sub print_package_config_category($) { print "menu \"$menu\"\n"; } foreach my $pkg (@pkgs) { - next if $pkg->{ignore}; + next if $pkg->{src}->{ignore}; my $title = $pkg->{name}; my $c = (72 - length($pkg->{name}) - length($pkg->{title})); if ($c > 0) { @@ -485,7 +485,7 @@ sub gen_package_mk() { if (defined($pkg_dep) && defined($pkg_dep->{src})) { unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype; + $src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype; next; } $idx = $pkg_dep->{src}->{path}; @@ -539,7 +539,7 @@ sub gen_package_mk() { if (defined $pkg_dep->{src}) { unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) { warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{makefile}, $deptype; + $src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype; next; } $idx = $pkg_dep->{src}->{path}; @@ -640,7 +640,7 @@ sub gen_package_license($) { } else { if ($level == 1) { print "$pkg->{name}: Missing license! "; - print "Please fix $pkg->{makefile}\n"; + print "Please fix $pkg->{src}->{makefile}\n"; } } } From patchwork Mon Jan 8 14:52:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858140 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkF62wlYz9ryk for ; Wed, 10 Jan 2018 20:27:38 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 80723B915C3; Wed, 10 Jan 2018 10:22:04 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:04 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 89FBCB801E9 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 40B1F20492; Mon, 8 Jan 2018 15:52:47 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:22 +0100 Message-Id: <9d04b622ea42433df5de48e0064a5397a2efbf12.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 09/15] build: remove package preconfig feature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" This feature has been unused for years, and its scope is too limited to be actually useful. Signed-off-by: Matthias Schiffer --- include/package-dumpinfo.mk | 16 +--------------- package/Makefile | 3 --- scripts/metadata.pm | 20 +------------------- scripts/package-metadata.pl | 36 ------------------------------------ 4 files changed, 2 insertions(+), 73 deletions(-) diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index 1be7d958d4..7cc8f3f6dc 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -9,19 +9,6 @@ ifneq ($(DUMP),) dumpinfo: FORCE -define Config/template -Preconfig: $(1) -Preconfig-Type: $(2) -Preconfig-Default: $(3) -Preconfig-Label: $(4) - -endef - -define Config - Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4)) - preconfig_$$(1) += $(1) -endef - define Dumpinfo/Package $(info Package: $(1) $(if $(MENU),Menu: $(MENU) @@ -59,8 +46,7 @@ $(if $(URL),$(URL) $(if $(Package/$(1)/config),Config: $(Package/$(1)/config) @@ -)$(foreach pc,$(preconfig_$(1)), -$(Preconfig/$(pc)))) +)) endef define Feature/Default diff --git a/package/Makefile b/package/Makefile index 4fdf415046..0aefbb8023 100644 --- a/package/Makefile +++ b/package/Makefile @@ -72,7 +72,6 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \ done; \ done || true - @-$(MAKE) package/preconfig $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG) @@ -96,8 +95,6 @@ ifdef CONFIG_SIGNED_PACKAGES ); done endif -$(curdir)/preconfig: - $(curdir)/flags-install:= -j1 $(eval $(call stampfile,$(curdir),package,prereq,.config)) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 50f91407d6..bb3fa72403 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,10 +2,9 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %srcpackage %category %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; -our %preconfig; our %srcpackage; our %category; our %features; @@ -177,7 +176,6 @@ sub parse_target_metadata($) { } sub clear_packages() { - %preconfig = (); %package = (); %srcpackage = (); %category = (); @@ -191,7 +189,6 @@ sub parse_package_metadata($) { my $file = shift; my $pkg; my $feature; - my $preconfig; my $src; my $override; my %ignore = map { $_ => 1 } @ignore; @@ -299,21 +296,6 @@ sub parse_package_metadata($) { }; /^Config:\s*(.*)\s*$/ and $pkg->{config} = "$1\n".get_multiline(*FILE, "\t"); /^Prereq-Check:/ and $pkg->{prereq} = 1; - /^Preconfig:\s*(.+)\s*$/ and do { - my $pkgname = $pkg->{name}; - $preconfig{$pkgname} or $preconfig{$pkgname} = {}; - if (exists $preconfig{$pkgname}->{$1}) { - $preconfig = $preconfig{$pkgname}->{$1}; - } else { - $preconfig = { - id => $1 - }; - $preconfig{$pkgname}->{$1} = $preconfig unless $src->{ignore}; - } - }; - /^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1; - /^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1; - /^Preconfig-Default:\s*(.*?)\s*$/ and $preconfig->{default} = $1; /^Require-User:\s*(.*?)\s*$/ and do { my @ugspecs = split /\s+/, $1; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 233fb0eabf..9372191166 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -372,19 +372,6 @@ sub print_package_overrides() { sub gen_package_config() { parse_package_metadata($ARGV[0]) or exit 1; print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n"; - foreach my $preconfig (keys %preconfig) { - foreach my $cfg (keys %{$preconfig{$preconfig}}) { - my $conf = $preconfig{$preconfig}->{$cfg}->{id}; - $conf =~ tr/\.-/__/; - print <{$cfg}->{label}" if IMAGEOPT - depends on PACKAGE_$preconfig - default "$preconfig{$preconfig}->{$cfg}->{default}" - -EOF - } - } print "source \"package/*/image-config.in\"\n"; if (scalar glob "package/feeds/*/*/image-config.in") { print "source \"package/feeds/*/*/image-config.in\"\n"; @@ -579,29 +566,6 @@ sub gen_package_mk() { if ($line ne "") { print "\n$line"; } - foreach my $preconfig (keys %preconfig) { - my $cmds; - foreach my $cfg (keys %{$preconfig{$preconfig}}) { - my $conf = $preconfig{$preconfig}->{$cfg}->{id}; - $conf =~ tr/\.-/__/; - $cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n"; - } - next unless $cmds; - print < \$@ - -ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),) - package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig -endif -endif - -EOF - } } sub gen_package_source() { From patchwork Mon Jan 8 14:52:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858328 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGsQb33SHz9ryv for ; Thu, 11 Jan 2018 01:51:19 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 242D6B916CF; Wed, 10 Jan 2018 10:22:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:01 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 92EE5B80DF1 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 6F02D2049E; Mon, 8 Jan 2018 15:52:47 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:23 +0100 Message-Id: <5fca97c979a72cc8b5b72574cb0f108459fb72a0.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 10/15] treewide: fix build depends to refer to source package names X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Build depends must refer to source packages rather than binary package names. Signed-off-by: Matthias Schiffer --- include/autotools.mk | 4 ++-- include/nls.mk | 2 +- package/network/config/ltq-adsl-app/Makefile | 2 +- package/network/config/ltq-vdsl-app/Makefile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/autotools.mk b/include/autotools.mk index 7bd400ab36..aa044aa0b4 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -105,14 +105,14 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),) endif ifneq ($(filter libtool,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool libintl libiconv + PKG_BUILD_DEPENDS += libtool gettext libiconv ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) Hooks/Configure/Pre += autoreconf_target endif endif ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool libintl libiconv + PKG_BUILD_DEPENDS += libtool gettext libiconv ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) Hooks/Configure/Pre += autoreconf_target endif diff --git a/include/nls.mk b/include/nls.mk index 51463b9f12..04838821b4 100644 --- a/include/nls.mk +++ b/include/nls.mk @@ -23,7 +23,7 @@ else endif PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS -PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl +PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext ICONV_DEPENDS:=+BUILD_NLS:libiconv-full ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index cf8eaf247d..153cf9a26c 100644 --- a/package/network/config/ltq-adsl-app/Makefile +++ b/package/network/config/ltq-adsl-app/Makefile @@ -24,7 +24,7 @@ PKG_CONFIG_DEPENDS:=\ CONFIG_LTQ_DSL_ENABLE_SOAP \ CONFIG_LTQ_DSL_ENABLE_DSL_EVENT_POLLING -PKG_BUILD_DEPENDS:=TARGET_lantiq_xway:kmod-ltq-adsl-danube TARGET_lantiq_xway_legacy:kmod-ltq-adsl-danube TARGET_lantiq_ase:kmod-ltq-adsl-ase +PKG_BUILD_DEPENDS:=ltq-adsl PKG_FLAGS:=nonshared diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile index baf63f9d13..71842ce345 100644 --- a/package/network/config/ltq-vdsl-app/Makefile +++ b/package/network/config/ltq-vdsl-app/Makefile @@ -17,7 +17,7 @@ PKG_HASH:=da8bb929526a61aea0e153ef524331fcd472a1ebbc6d88ca017735a4f82ece02 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION) PKG_LICENSE:=BSD-2-Clause -PKG_BUILD_DEPENDS:=kmod-ltq-vdsl-vr9 +PKG_BUILD_DEPENDS:=ltq-vdsl PKG_FLAGS:=nonshared From patchwork Mon Jan 8 14:52:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858331 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGsRS5vg2z9ryv for ; Thu, 11 Jan 2018 01:52:04 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9F9ECB915D1; Wed, 10 Jan 2018 10:22:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:11 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C2196B90E9E for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 9E58C2049F; Mon, 8 Jan 2018 15:52:47 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:24 +0100 Message-Id: X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 11/15] metadata: handle target build depends together with host build depends X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Target build depends are similar to host build depends in that they refer to source packages rather than binary packages. Therefore, it makes sense to handle them together, rather than putting them in a list together with runtime depends and trying to figure out if the entries refer to source or to binary packages afterwards. This does lead to PKG_BUILD_DEPENDS entries referring to binary package names not working anymore, which requires some fixes in the package repositories. Signed-off-by: Matthias Schiffer --- scripts/package-metadata.pl | 60 +++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 9372191166..e492cc8a09 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -408,6 +408,7 @@ sub gen_package_mk() { my $src = $srcpackage{$srcname}; my $variant_default; my @srcdeps; + my %deplines = ('' => {}); foreach my $pkg (@{$src->{packages}}) { next if defined $pkg->{vdepends}; @@ -441,19 +442,23 @@ sub gen_package_mk() { print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n"; } - foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) { + foreach my $dep (map { @{$_->{depends}} } @{$src->{packages}}) { $dep =~ /@/ or do { $dep =~ s/\+//g; push @srcdeps, $dep; }; } - foreach my $type (@{$src->{buildtypes}}) { - my @extra_deps; - my %deplines; + foreach my $type ('', @{$src->{buildtypes}}) { + my $suffix = ''; - next unless $src->{"builddepends/$type"}; - foreach my $dep (@{$src->{"builddepends/$type"}}) { - my $suffix = ""; + $suffix = "/$type" if $type; + + next unless $src->{"builddepends$suffix"}; + + defined $deplines{$suffix} or $deplines{$suffix} = {}; + + foreach my $dep (@{$src->{"builddepends$suffix"}}) { + my $depsuffix = ""; my $deptype = ""; my $condition; @@ -464,37 +469,26 @@ sub gen_package_mk() { if ($dep =~ /^(.+)\/(.+)/) { $dep = $1; $deptype = $2; - $suffix = "/$2"; + $depsuffix = "/$2"; } - my $idx = ""; - my $pkg_dep = $package{$dep}; - if (defined($pkg_dep) && defined($pkg_dep->{src})) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) { - warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $src->{makefile}, $type, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype; - next; - } - $idx = $pkg_dep->{src}->{path}; - } elsif (defined($srcpackage{$dep})) { - $idx = $srcpackage{$dep}->{path}; - } else { + next if $srcname.$suffix eq $dep.$depsuffix; + + my $src_dep = $srcpackage{$dep}; + unless (defined($src_dep) && (!$deptype || grep { $_ eq $deptype } @{$src_dep->{buildtypes}})) { + warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s%s', which does not exist\n", + $src->{makefile}, $dep, $depsuffix; next; } - my $depstr = "\$(curdir)/$idx$suffix/compile"; + + my $depstr = "\$(curdir)/$src_dep->{path}$depsuffix/compile"; my $depline = get_conditional_dep($condition, $depstr); if ($depline) { - $deplines{$depline}++; + $deplines{$suffix}->{$depline}++; } } - my $depline = join(" ", sort keys %deplines); - if ($depline) { - $line .= "\$(curdir)/$src->{path}/$type/compile += $depline\n"; - } } - my $hasdeps = 0; - my %deplines; foreach my $deps (@srcdeps) { my $idx; my $condition; @@ -552,14 +546,16 @@ sub gen_package_mk() { } $depline = get_conditional_dep($condition, $depstr); if ($depline) { - $deplines{$depline}++; + $deplines{''}->{$depline}++; } } } } - my $depline = join(" ", sort keys %deplines); - if ($depline) { - $line .= "\$(curdir)/$src->{path}/compile += $depline\n"; + foreach my $suffix (sort keys %deplines) { + my $depline = join(" ", sort keys %{$deplines{$suffix}}); + if ($depline) { + $line .= "\$(curdir)/$src->{path}$suffix/compile += $depline\n"; + } } } From patchwork Mon Jan 8 14:52:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGsQV5yB3z9ryv for ; Thu, 11 Jan 2018 01:51:14 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 2A0C9B916D5; Wed, 10 Jan 2018 10:22:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:08 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B72ABB90BE0 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id CCE04204A1; Mon, 8 Jan 2018 15:52:47 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:25 +0100 Message-Id: X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 12/15] metadata: simplify generation of build depends from runtime depends X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Runtime depends cannot have a buildtype suffix, and they never refer to source package names. In addition, this adds warnings about unsatisfiable dependencies. Furthermore, this change fixes the generation of conditional build dependencies for virtual packages provided by different source packages. Signed-off-by: Matthias Schiffer --- scripts/package-metadata.pl | 112 ++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 71 deletions(-) diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index e492cc8a09..980ad24dc0 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -399,18 +399,56 @@ sub get_conditional_dep($$) { } sub gen_package_mk() { - my %conf; - my %dep; my $line; parse_package_metadata($ARGV[0]) or exit 1; foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) { my $src = $srcpackage{$srcname}; my $variant_default; - my @srcdeps; my %deplines = ('' => {}); foreach my $pkg (@{$src->{packages}}) { + foreach my $dep (@{$pkg->{depends}}) { + next if ($dep =~ /@/); + + my $condition; + + $dep =~ s/\+//g; + if ($dep =~ /^(.+):(.+)/) { + $condition = $1; + $dep = $2; + } + + my $pkg_dep = $package{$dep}; + unless (defined $pkg_dep) { + warn sprintf "WARNING: Makefile '%s' has a dependency on '%s', which does not exist\n", + $src->{makefile}, $dep; + next; + } + + unless ($pkg_dep->{vdepends}) { + next if $srcname eq $pkg_dep->{src}->{name}; + + my $depstr = "\$(curdir)/$pkg_dep->{src}->{path}/compile"; + my $depline = get_conditional_dep($condition, $depstr); + if ($depline) { + $deplines{''}->{$depline}++; + } + next; + } + + foreach my $vdep (@{$pkg_dep->{vdepends}}) { + my $pkg_vdep = $package{$vdep}; + next if $srcname eq $pkg_vdep->{src}->{name}; + + my $depstr = "\$(if \$(CONFIG_PACKAGE_$vdep),\$(curdir)/$pkg_vdep->{src}->{path}/compile)"; + my $depline = get_conditional_dep($condition, $depstr); + if ($depline) { + $deplines{''}->{$depline}++; + } + } + } + next if defined $pkg->{vdepends}; my $config = ''; @@ -442,12 +480,6 @@ sub gen_package_mk() { print "buildtypes-$src->{path} = ".join(' ', @{$src->{buildtypes}})."\n"; } - foreach my $dep (map { @{$_->{depends}} } @{$src->{packages}}) { - $dep =~ /@/ or do { - $dep =~ s/\+//g; - push @srcdeps, $dep; - }; - } foreach my $type ('', @{$src->{buildtypes}}) { my $suffix = ''; @@ -489,68 +521,6 @@ sub gen_package_mk() { } } - foreach my $deps (@srcdeps) { - my $idx; - my $condition; - my $prefix = ""; - my $suffix = ""; - my $deptype = ""; - - if ($deps =~ /^(.+):(.+)/) { - $condition = $1; - $deps = $2; - } - if ($deps =~ /^(.+)\/(.+)/) { - $deps = $1; - $deptype = $2; - $suffix = "/$2"; - } - - my $pkg_dep = $package{$deps}; - my @deps; - - if ($pkg_dep->{vdepends}) { - @deps = @{$pkg_dep->{vdepends}}; - } else { - @deps = ($deps); - } - - foreach my $dep (@deps) { - $pkg_dep = $package{$deps}; - if (defined $pkg_dep->{src}) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}->{buildtypes}}) { - warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $src->{makefile}, $pkg_dep->{src}->{name}, $deptype, $pkg_dep->{src}->{makefile}, $deptype; - next; - } - $idx = $pkg_dep->{src}->{path}; - } elsif (defined($srcpackage{$dep})) { - $idx = $srcpackage{$dep}->{path}; - } - - if ($idx) { - $idx .= $suffix; - - my $depline; - next if $srcname eq $pkg_dep->{src}->{name}.$suffix; - next if $dep{$condition.":".$srcname."->".$idx}; - next if $dep{$srcname."->($dep)".$idx} and $pkg_dep->{vdepends}; - my $depstr; - - if ($pkg_dep->{vdepends}) { - $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)"; - $dep{$srcname."->($dep)".$idx} = 1; - } else { - $depstr = "\$(curdir)/$idx/compile"; - $dep{$srcname."->".$idx} = 1; - } - $depline = get_conditional_dep($condition, $depstr); - if ($depline) { - $deplines{''}->{$depline}++; - } - } - } - } foreach my $suffix (sort keys %deplines) { my $depline = join(" ", sort keys %{$deplines{$suffix}}); if ($depline) { From patchwork Mon Jan 8 14:52:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkFl5B1sz9ryk for ; Wed, 10 Jan 2018 20:28:11 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8755EB915EA; Wed, 10 Jan 2018 10:22:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:24 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 05995B80DF1 for ; Mon, 8 Jan 2018 15:52:49 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 090ED204A3; Mon, 8 Jan 2018 15:52:48 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:26 +0100 Message-Id: <575ae0aa149ab00eb714fb6c4f238767e3222848.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 13/15] metadata: always resolve dependencies through provides list X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Instead of adding virtual packages to the normal package list, keep a separate list for provides, make each package provide itself, and resolve all dependencies through this list. This allows to use PROVIDES to replace existing packages. Fixes FS#837. Signed-off-by: Matthias Schiffer --- scripts/feeds | 4 +-- scripts/metadata.pm | 15 ++++++------ scripts/package-metadata.pl | 60 +++++++++++++++++++-------------------------- 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/scripts/feeds b/scripts/feeds index b531fbac62..626edc6665 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -252,7 +252,6 @@ sub search_feed { my $substr; my $pkgmatch = 1; - next if $pkg->{vdepends}; foreach my $substr (@substr) { my $match; foreach my $key (qw(name title description src)) { @@ -306,7 +305,6 @@ sub list_feed { get_feed($feed); foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) { my $pkg = $feed_package->{$name}; - next if $pkg->{vdepends}; if($pkg->{name}) { printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title}; } @@ -530,6 +528,7 @@ sub install_package { @{$feed_src->{$src}->{"builddepends/host"}}, map { @{$_->{depends}} } @{$feed_src->{$src}->{packages}} ) { + # TODO: handle virtual packages and PROVIDES next if $dep =~ /@/; $dep =~ s/^\+//; $dep =~ s/^.+://; @@ -590,7 +589,6 @@ sub install { get_feed($f->[1]); foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) { my $p = $feed_package->{$name}; - next if $p->{vdepends}; if( $p->{name} ) { install_package($feed, $p->{name}, exists($opts{f})) == 0 or $ret = 1; get_feed($f->[1]); diff --git a/scripts/metadata.pm b/scripts/metadata.pm index bb3fa72403..bf93271749 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,9 +2,10 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %vpackage %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; +our %vpackage; our %srcpackage; our %category; our %features; @@ -177,6 +178,7 @@ sub parse_target_metadata($) { sub clear_packages() { %package = (); + %vpackage = (); %srcpackage = (); %category = (); %features = (); @@ -230,6 +232,9 @@ sub parse_package_metadata($) { $pkg->{override} = $override; $package{$1} = $pkg; push @{$src->{packages}}, $pkg; + + $vpackage{$1} or $vpackage{$1} = []; + unshift @{$vpackage{$1}}, $pkg; }; /^Feature:\s*(.+?)\s*$/ and do { undef $pkg; @@ -264,12 +269,8 @@ sub parse_package_metadata($) { /^Provides: \s*(.+)\s*$/ and do { my @vpkg = split /\s+/, $1; foreach my $vpkg (@vpkg) { - $package{$vpkg} or $package{$vpkg} = { - name => $vpkg, - vdepends => [], - src => $src, - }; - push @{$package{$vpkg}->{vdepends}}, $pkg->{name}; + $vpackage{$vpkg} or $vpackage{$vpkg} = []; + push @{$vpackage{$vpkg}}, $pkg; } }; /^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ]; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 980ad24dc0..41e7108322 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -101,14 +101,16 @@ my %dep_check; sub __find_package_dep($$) { my $pkg = shift; my $name = shift; - my $deps = ($pkg->{vdepends} or $pkg->{depends}); + my $deps = $pkg->{depends}; return 0 unless defined $deps; - foreach my $dep (@{$deps}) { - next if $dep_check{$dep}; - $dep_check{$dep} = 1; - return 1 if $dep eq $name; - return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1)); + foreach my $vpkg (@{$deps}) { + foreach my $dep (@{$vpackage{$vpkg}}) { + next if $dep_check{$dep->{name}}; + $dep_check{$dep->{name}} = 1; + return 1 if $dep->{name} eq $name; + return 1 if (__find_package_dep($dep, $name) == 1); + } } return 0; } @@ -156,7 +158,6 @@ sub mconf_depends { my $m = "depends on"; my $flags = ""; $depend =~ s/^([@\+]+)// and $flags = $1; - my $vdep; my $condition = $parent_condition; next if $condition eq $depend; @@ -173,23 +174,21 @@ sub mconf_depends { } $depend = $2; } - next if $package{$depend} and $package{$depend}->{buildonly}; if ($flags =~ /\+/) { - if ($vdep = $package{$depend}->{vdepends}) { + my $vdep = $vpackage{$depend}; + if ($vdep) { my @vdeps; - $depend = undef; foreach my $v (@$vdep) { - if ($package{$v} && $package{$v}->{variant_default}) { - $depend = $v; + next if $v->{buildonly}; + if ($v->{variant_default}) { + unshift @vdeps, $v->{name}; } else { - push @vdeps, $v; + push @vdeps, $v->{name}; } } - if (!$depend) { - $depend = shift @vdeps; - } + $depend = shift @vdeps; if (@vdeps > 1) { $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')'; @@ -209,7 +208,8 @@ sub mconf_depends { $flags =~ /@/ or $depend = "PACKAGE_$depend"; } else { - if ($vdep = $package{$depend}->{vdepends}) { + my $vdep = $vpackage{$depend}; + if ($vdep) { $depend = join("||", map { "PACKAGE_".$_ } @$vdep); } else { $flags =~ /@/ or $depend = "PACKAGE_$depend"; @@ -419,29 +419,21 @@ sub gen_package_mk() { $dep = $2; } - my $pkg_dep = $package{$dep}; - unless (defined $pkg_dep) { + my $vpkg_dep = $vpackage{$dep}; + unless (defined $vpkg_dep) { warn sprintf "WARNING: Makefile '%s' has a dependency on '%s', which does not exist\n", $src->{makefile}, $dep; next; } - unless ($pkg_dep->{vdepends}) { - next if $srcname eq $pkg_dep->{src}->{name}; + # Filter out self-depends + my @vdeps = grep { $srcname ne $_->{src}->{name} } @{$vpkg_dep}; - my $depstr = "\$(curdir)/$pkg_dep->{src}->{path}/compile"; - my $depline = get_conditional_dep($condition, $depstr); - if ($depline) { - $deplines{''}->{$depline}++; + foreach my $vdep (@vdeps) { + my $depstr = "\$(curdir)/$vdep->{src}->{path}/compile"; + if (@vdeps > 1) { + $depstr = "\$(if \$(CONFIG_PACKAGE_$vdep->{name}),$depstr)"; } - next; - } - - foreach my $vdep (@{$pkg_dep->{vdepends}}) { - my $pkg_vdep = $package{$vdep}; - next if $srcname eq $pkg_vdep->{src}->{name}; - - my $depstr = "\$(if \$(CONFIG_PACKAGE_$vdep),\$(curdir)/$pkg_vdep->{src}->{path}/compile)"; my $depline = get_conditional_dep($condition, $depstr); if ($depline) { $deplines{''}->{$depline}++; @@ -449,8 +441,6 @@ sub gen_package_mk() { } } - next if defined $pkg->{vdepends}; - my $config = ''; $config = "\$(CONFIG_PACKAGE_$pkg->{name})" unless $pkg->{buildonly}; From patchwork Mon Jan 8 14:52:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGsQq1mVrz9s74 for ; Thu, 11 Jan 2018 01:51:31 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D2439B91535; Wed, 10 Jan 2018 10:22:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:20 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E709BB801E9 for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 376D3204A4; Mon, 8 Jan 2018 15:52:48 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:27 +0100 Message-Id: <763d2f7bf22cf8d223a04c647b17f492716512de.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 14/15] build: remove obsolete "package feature" feature X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Package "features" seem to be unused for some time. In any case, custom Config.in snippets and package PROVIDES are a much more flexible way to express similar options. Signed-off-by: Matthias Schiffer --- include/package-dumpinfo.mk | 25 ------------------------- scripts/metadata.pm | 23 +---------------------- scripts/package-metadata.pl | 26 -------------------------- 3 files changed, 1 insertion(+), 73 deletions(-) diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index 7cc8f3f6dc..68a66d0769 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -49,29 +49,4 @@ $(Package/$(1)/config) )) endef -define Feature/Default - TARGET_NAME:= - TARGET_TITLE:= - PRIORITY:= - NAME:= -endef - -define Feature - $(eval $(Feature/Default)) - $(eval $(Feature/$(1))) - $(if $(DUMP),$(call Dumpinfo/Feature,$(1))) -endef - -define Dumpinfo/Feature -$(info Feature: $(TARGET_NAME)_$(1) -Target-Name: $(TARGET_NAME) -Target-Title: $(TARGET_TITLE) -Feature-Name: $(NAME) -$(if $(PRIORITY),Feature-Priority: $(PRIORITY) -)Feature-Description: -$(Feature/$(1)/description) -@@ -) -endef - endif diff --git a/scripts/metadata.pm b/scripts/metadata.pm index bf93271749..18d5e5da24 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,13 +2,12 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %vpackage %srcpackage %category %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; our %vpackage; our %srcpackage; our %category; -our %features; our %overrides; our @ignore; @@ -181,7 +180,6 @@ sub clear_packages() { %vpackage = (); %srcpackage = (); %category = (); - %features = (); %overrides = (); %usernames = (); %groupnames = (); @@ -190,7 +188,6 @@ sub clear_packages() { sub parse_package_metadata($) { my $file = shift; my $pkg; - my $feature; my $src; my $override; my %ignore = map { $_ => 1 } @ignore; @@ -221,7 +218,6 @@ sub parse_package_metadata($) { }; next unless $src; /^Package:\s*(.+?)\s*$/ and do { - undef $feature; $pkg = {}; $pkg->{src} = $src; $pkg->{name} = $1; @@ -236,23 +232,6 @@ sub parse_package_metadata($) { $vpackage{$1} or $vpackage{$1} = []; unshift @{$vpackage{$1}}, $pkg; }; - /^Feature:\s*(.+?)\s*$/ and do { - undef $pkg; - $feature = {}; - $feature->{name} = $1; - $feature->{priority} = 0; - }; - $feature and do { - /^Target-Name:\s*(.+?)\s*$/ and do { - $features{$1} or $features{$1} = []; - push @{$features{$1}}, $feature unless $src->{ignore}; - }; - /^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1; - /^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1; - /^Feature-Name:\s*(.+?)\s*$/ and $feature->{title} = $1; - /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t"); - next; - }; /^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ]; /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ]; /^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ]; diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 41e7108322..e601a77e1b 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -337,31 +337,6 @@ sub print_package_config_category($) { undef $category{$cat}; } -sub print_package_features() { - keys %features > 0 or return; - print "menu \"Package features\"\n"; - foreach my $n (keys %features) { - my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}}; - print <{target_title}" - default FEATURE_$features[0]->{name} -EOF - - foreach my $feature (@features) { - print <{name} - bool "$feature->{title}" -EOF - $feature->{description} =~ /\w/ and do { - print "\t\thelp\n".$feature->{description}."\n"; - }; - } - print "endchoice\n" - } - print "endmenu\n\n"; -} - sub print_package_overrides() { keys %overrides > 0 or return; print "\tconfig OVERRIDE_PKGS\n"; @@ -376,7 +351,6 @@ sub gen_package_config() { if (scalar glob "package/feeds/*/*/image-config.in") { print "source \"package/feeds/*/*/image-config.in\"\n"; } - print_package_features(); print_package_config_category 'Base system'; foreach my $cat (sort {uc($a) cmp uc($b)} keys %category) { print_package_config_category $cat; From patchwork Mon Jan 8 14:52:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 858142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGkFV3Jr7z9s8J for ; Wed, 10 Jan 2018 20:27:58 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D4F2CB91517; Wed, 10 Jan 2018 10:22:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Wed, 10 Jan 2018 10:22:17 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1E41EB90BE0 for ; Mon, 8 Jan 2018 15:52:49 +0100 (CET) X-policyd-weight: using cached result; rate: -6.1 Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [104.238.176.138]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Mon, 8 Jan 2018 15:52:48 +0100 (CET) Received: from avalon.lan (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id 6555E204A5; Mon, 8 Jan 2018 15:52:48 +0100 (CET) From: Matthias Schiffer To: lede-dev@lists.infradead.org, openwrt-devel@lists.openwrt.org, jo@mein.io, nbd@nbd.name Date: Mon, 8 Jan 2018 15:52:28 +0100 Message-Id: <8d6fb4e335e1ce91d84eeba5cb48ece7c916d36b.1515421834.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.15.1 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH 15/15] include/package-dumpinfo.mk: don't duplicate source package information for every binary package X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Eventually the BUILDONLY package flag could be replaced by simply creating a package Makefile without any BuildPackage calls. This will fail for now, as BuildPackage also causes the Makefile's compile target etc. to do something useful at all. Signed-off-by: Matthias Schiffer --- include/package-dumpinfo.mk | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index 68a66d0769..8a42be5bd1 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -7,10 +7,17 @@ ifneq ($(DUMP),) -dumpinfo: FORCE + +define SOURCE_INFO +$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS) +)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS) +)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES) +) + +endef define Dumpinfo/Package -$(info Package: $(1) +$(info $(SOURCE_INFO)Package: $(1) $(if $(MENU),Menu: $(MENU) )$(if $(SUBMENU),Submenu: $(SUBMENU) )$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP) @@ -23,10 +30,7 @@ Menu-Depends: $(MDEPENDS) Provides: $(PROVIDES) $(if $(VARIANT),Build-Variant: $(VARIANT) $(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT) -))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS) -)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS) -)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES) -)Section: $(SECTION) +))Section: $(SECTION) Category: $(CATEGORY) $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base) )Title: $(TITLE) @@ -47,6 +51,10 @@ $(if $(Package/$(1)/config),Config: $(Package/$(1)/config) @@ )) +SOURCE_INFO := endef +dumpinfo: FORCE + $(if $(SOURCE_INFO),$(info $(SOURCE_INFO))) + endif