From patchwork Tue Dec 9 19:32:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Perrad X-Patchwork-Id: 419233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 4EBAE14009B for ; Wed, 10 Dec 2014 06:32:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6D72C958BF; Tue, 9 Dec 2014 19:32:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7yzGPRduV17m; Tue, 9 Dec 2014 19:32:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 261FF95837; Tue, 9 Dec 2014 19:32:25 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2A3D31C2A75 for ; Tue, 9 Dec 2014 19:32:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 25BE491BFE for ; Tue, 9 Dec 2014 19:32:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dI5GRZQaCZ1N for ; Tue, 9 Dec 2014 19:32:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5026C91B4A for ; Tue, 9 Dec 2014 19:32:22 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id ex7so8983639wid.15 for ; Tue, 09 Dec 2014 11:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=nT5rpbYESsGJEq3PrANpHbh4YS7djEYgN4Q+k1EPI/I=; b=JGUNiGVMO7+qCUlSuzo76r0e/JHjwc9KWN/PkUEU9rP+XqI2tpY2lqggYK6SdrojMw peon+x6tCcFX7eNXkYUXV/2YUFYLu2MccXSaXprmQNEqpYX/NhkZmpObxMFJ1KtqFVzx JadiU8WT5I8IL6UcGPia1hsCS27IUMzz2zQ+D/+34skBThXabWPzuPd+3v6P+HMS7Y7M yERk4m5t4oCYg4qZnDWS/sc0ld7+XImPZ1uENqS8LHmW4bHVHoFrl25CCzGTtF0j9hVV VH3wepn6S/xNTY+CzHADFrr7ZU6uHHdW0JPkVBwwbuio5JRzoCm/34AJXgQu+AqOomQn SUfg== X-Received: by 10.180.102.135 with SMTP id fo7mr7006447wib.79.1418153540981; Tue, 09 Dec 2014 11:32:20 -0800 (PST) Received: from localhost.localdomain (152.96.92.92.rev.sfr.net. [92.92.96.152]) by mx.google.com with ESMTPSA id n8sm3017835wjx.0.2014.12.09.11.32.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Dec 2014 11:32:20 -0800 (PST) From: Francois Perrad X-Google-Original-From: Francois Perrad To: buildroot@busybox.net Date: Tue, 9 Dec 2014 20:32:03 +0100 Message-Id: <1418153523-10972-1-git-send-email-francois.perrad@gadz.org> X-Mailer: git-send-email 2.1.0 Subject: [Buildroot] [PATCH] support/script/scancpan: remove duplicated dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" dependency from metacpan comes as a list of module which is transformed in a list of distribution for BR. different modules could be included in the same distribution, so duplication is possible. Signed-off-by: Francois Perrad --- support/scripts/scancpan | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/support/scripts/scancpan b/support/scripts/scancpan index 0eac132..590c215 100755 --- a/support/scripts/scancpan +++ b/support/scripts/scancpan @@ -558,8 +558,8 @@ sub fetch { my $manifest = get_manifest( $result->{author}, $name, $result->{version} ); $need_dlopen{$name} = is_xs( $manifest ); $license_files{$name} = find_license_files( $manifest ); - my @deps_build = (); - my @deps_runtime = (); + my %build = (); + my %runtime = (); my $mb; foreach my $dep (@{$result->{dependency}}) { my $modname = ${$dep}{module}; @@ -578,19 +578,19 @@ sub fetch { next if !$recommend && ${$dep}{relationship} ne q{requires}; my $distname = $mcpan->module( $modname )->{distribution}; if (${$dep}{phase} eq q{runtime}) { - push @deps_runtime, $distname; + $runtime{$distname} = 1; } else { # configure, build - push @deps_build, $distname; + $build{$distname} = 1; } } - unshift @deps_build, q{Module-Build} if $mb; - $deps_build{$name} = \@deps_build; - $deps_runtime{$name} = \@deps_runtime; - foreach my $distname (@deps_build) { + $build{q{Module-Build}} = 1 if $mb; + $deps_build{$name} = [keys %build]; + $deps_runtime{$name} = [keys %runtime]; + foreach my $distname (@{$deps_build{$name}}) { fetch( $distname, 0, 1 ); } - foreach my $distname (@deps_runtime) { + foreach my $distname (@{$deps_runtime{$name}}) { fetch( $distname, $need_target, $need_host ); $need_dlopen{$name} ||= $need_dlopen{$distname}; }