From patchwork Wed Jan 13 01:10:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1425574 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=krbw9wbl; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DFqG50zxMz9sWr for ; Wed, 13 Jan 2021 12:13:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=QtISGoWtwQTZyGAvxxodXKO4riWCxqselwlqp0tmzew=; b=krbw9wbl3cWNg0RBETycUvF+HI JWD7+341cY7ogHv742znylAgl3ICRVqjkUgq6BT3+vvOvh6jp3yf1RRH0S77cH2/F6YysbOmmjAd3 ZuURvJ0kDAEoOOaV9q+yP8hrT8ellZ2m9+klrSr9Plap8s51alSkEMjeMqH8j/sahFyzXtihc4Fq3 3h8o7FTlII+wHpgvA/G2k9UfyS5QSG1aQt406nXa+woF8M7zspubNfvFjEuCItjv43qMzmZ9eSPP6 YRbof3dSvaaqqC7cFAscqGCXKTL2bABokwk+H+l+2mu6te2Km3d1Y8tMNLAfqtZZ815PlZVi78fZ9 aAGRSc2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzUhX-00086u-IL; Wed, 13 Jan 2021 01:11:55 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzUhV-00085a-92 for openwrt-devel@lists.openwrt.org; Wed, 13 Jan 2021 01:11:54 +0000 X-Originating-IP: 72.235.129.18 Received: from dawn.lan (udp100268uds.hawaiiantel.net [72.235.129.18]) (Authenticated sender: mail@aparcar.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPA id 9C72BFF805; Wed, 13 Jan 2021 01:11:46 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Subject: [PATCH v3] scripts: target-metadata don't add PROFILES twice Date: Tue, 12 Jan 2021 15:10:03 -1000 Message-Id: <20210113011002.721316-1-mail@aparcar.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210112_201153_435922_1DA7DAC6 X-CRM114-Status: GOOD ( 10.25 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.199 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.199 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Spooren Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Since 4ee3cf2b5a profiles with alternative vendor names may appear multiple times in `tmp/.targetinfo` or `.targetinfo` (for ImageBuilders). The `target-metadata.pl` script adds these profiles then twice to `PROFILE_NAMES` and the ImageBuilder show the profile twice when running `make info`. This patch removes duplicate profile IDs and only adds them once to `.profiles.mk`. Signed-off-by: Paul Spooren --- v3: don't use the Apache-2 licensed uniq function from a Perl lib This duplicate entries were reported recently via this PR: https://github.com/openwrt/openwrt/pull/3777 scripts/target-metadata.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index bf6413d315..78f77b16d5 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -429,7 +429,8 @@ sub gen_profile_mk() { my @targets = parse_target_metadata($file); foreach my $cur (@targets) { next unless $cur->{id} eq $target; - print "PROFILE_NAMES = ".join(" ", map { $_->{id} } @{$cur->{profiles}})."\n"; + my @profile_ids_unique = do { my %seen; grep { !$seen{$_}++} map { $_->{id} } @{$cur->{profiles}}}; + print "PROFILE_NAMES = ".join(" ", @profile_ids_unique)."\n"; foreach my $profile (@{$cur->{profiles}}) { print $profile->{id}.'_NAME:='.$profile->{name}."\n"; print $profile->{id}.'_HAS_IMAGE_METADATA:='.$profile->{has_image_metadata}."\n";