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: 856854 X-Patchwork-Delegate: mschiffer@universe-factory.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Yh0Bf64T"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFdrV6vbhz9s7c for ; Tue, 9 Jan 2018 02:06:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=/FQPcC/JArAhkjwIZ9+KJq41s5Igs+zcd34xp2pgRKs=; b=Yh0Bf64TthKXUjdoB74XW8W6LD cZ5MTWSSROiA930FjHuo9diPsw0SHRmQxRpmygTYQHJdV3d2cmp/TrMmz78eTFiStsx1kFL9TCMd3 2NKylAw6s7oKKVis8hT4+GjUg7Hy+cNI6uxDRIbHmbZltMTb1VzFArTng9qdfv65WvGAlHqt7IAfG mG/qNP+WrWtPT3uGOnxku84M9z6S/0uqRCLgyBEhe80ccb79DQOB2C9FxGvc7klCFyWL7Rr/tLOUl Y9XJZFnwnFFKkuES3SGNZ7pMK7O7y56d534Bnox4SBAOPSoFhRBVwhJp+F3djQVZLOYwB6a1eN0bl WyTV5v8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYYzn-0000Jt-85; Mon, 08 Jan 2018 15:05:51 +0000 Received: from orthanc.universe-factory.net ([2001:19f0:6c01:100::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYYuc-0003UU-Bo for lede-dev@lists.infradead.org; Mon, 08 Jan 2018 15:01:57 +0000 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180108_070031_880213_BD2C6CC2 X-CRM114-Status: UNSURE ( 8.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 04/15] metadata: move 'builddepends' from binary to source packages X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;