From patchwork Wed Dec 28 20:41:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6350 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Nj3NH09k5z3wcv for ; Wed, 28 Dec 2022 20:41:51 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Nj3ND6HWfzkb; Wed, 28 Dec 2022 20:41:48 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Nj3ND4YLLz2xbV; Wed, 28 Dec 2022 20:41:48 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Nj3NB5vG3z2xGT for ; Wed, 28 Dec 2022 20:41:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Nj3N95kWJzV; Wed, 28 Dec 2022 20:41:45 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1672260106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/9kQpkU8bRwTruLFplJsS1YsQKLXxjTeNVrOwemkTDA=; b=lLNBud//zpN5EPjMY5UjFzSOT347xRo/gmxbQ7CgdMNd3jfwx3UgLzvu+Lsh4NIUaaFULX AJW9i4v+3f35WCCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1672260106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/9kQpkU8bRwTruLFplJsS1YsQKLXxjTeNVrOwemkTDA=; b=TbifOCxjOFiBB2Z6d53xo+jccu0Jynm56YBOQDz4EOfseIrS+Vw+K1j++FKNbWi6+NYIsi sUtkcNIDLQ9Y25clFHA6KFJjrsXnYongdFUt7QBVlkttGoGeiJR6K5K2lWizimq0aeMwqE hif2LNAD7Ofc46sKlWmE1W6kI0Uek0K+F8+Ck1rTjMr2Kagg7cqL1YndpXjsiXizMLOJrj YGoeEHNRC3o2AdQ2ld9l/sgVPtARywP0XdZinbE1Dv+nbzkAnseqvka6w5rby41YBPK1N2 oB3F/oQkY4zncLFm1bj2tFDsFBzGKofgiIeKTxOWjOSz9Le4zSsicu7rEsnYzA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 1/2] perl.req: Allow filtering the found requirements. Date: Wed, 28 Dec 2022 21:41:35 +0100 Message-Id: <20221228204136.391950-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" The filter mechanism easy can be used by adding something like the following example in the corresponding nm file. export FILTER_PERL_REQUIRES = \ Some::Module \ Example:: \ abc Signed-off-by: Stefan Schantl --- src/scripts/perl.req | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/scripts/perl.req b/src/scripts/perl.req index 29bde1f2..5a5a54e1 100644 --- a/src/scripts/perl.req +++ b/src/scripts/perl.req @@ -20,6 +20,8 @@ # then these are treated as additional names which are required by the # file and are printed as well. +my @filter = split(/ /, $ENV{'FILTER_PERL_REQUIRES'}); + my $BUILDROOT = shift; # Check if BUILDROOT is set @@ -45,6 +47,8 @@ foreach my $perlver (sort keys %perlreq) { } foreach my $module (sort keys %global_require) { + next if (&is_filtered($module)); + if (length($global_require{$module}) == 0) { print "perl($module)\n"; @@ -388,3 +392,11 @@ sub process_file { return; } + +sub is_filtered($) { + my ($module) = @_; + + foreach my $item (@filter) { + return 1 if (index($module, $item) != -1); + } +}