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;