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); + } +} From patchwork Wed Dec 28 20:41:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6351 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Nj3NH6fFdz3xk3 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) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Nj3NF2NKKz10R; Wed, 28 Dec 2022 20:41:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Nj3ND590lz2yxs; 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Nj3NC0k5nz2xGT for ; Wed, 28 Dec 2022 20:41:47 +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 4Nj3NB5NrgzQh; Wed, 28 Dec 2022 20:41:46 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1672260107; 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: in-reply-to:in-reply-to:references:references; bh=Fj0j/vfv+2GvJM92R1bLkFrYGERuiCJQOw5GPTyuFRI=; b=uiAgtUcYS7YWR5xHg1zkyhZ0dXIB2jXZ6F4ORMd8u/m4Q6Kz/WZcfSkGXAcMJrlpTJrqYp +2EfWChQmHe72iBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1672260107; 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: in-reply-to:in-reply-to:references:references; bh=Fj0j/vfv+2GvJM92R1bLkFrYGERuiCJQOw5GPTyuFRI=; b=DcLhxaMiA4rPmOzkblkeeOIFu1Ku9Bp72ECTXydCQEH3MhTQjnxXrPNoDcWl/HowscDJaM IKHaWcjNY6MzBXI/2PT3hZTuhWSxUyPHRuSbmNpEIG2iMqC6xU1oZGFdh58oDHmqjvF8qd wODjNe6Wwybwg92ZYv4SphzBuEdXNxO5FR+ZsGoCO2sakfo7CbvhP8QFezPB8Zp35BFWfi l+Z3/ZA05LuLJADZFqje8++Fwa4FxjKjoy7+hHJd+K/3P6M98vfFwMT5k0adTXzxmwBH59 IUPWVaZPLDO+w2w7yX5NmHZLgxYJqPP15/06BXscXLP4QGXQJRVow68rO0HsQA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/2] perl.req: Automatically filter-out version related requirements. Date: Wed, 28 Dec 2022 21:41:36 +0100 Message-Id: <20221228204136.391950-2-stefan.schantl@ipfire.org> In-Reply-To: <20221228204136.391950-1-stefan.schantl@ipfire.org> References: <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" Filter-out everything like perl(5), perl(v5), perl(5.000), perl(5.000_000) etc. Signed-off-by: Stefan Schantl --- src/scripts/perl.req | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scripts/perl.req b/src/scripts/perl.req index 5a5a54e1..2bdf04dd 100644 --- a/src/scripts/perl.req +++ b/src/scripts/perl.req @@ -47,6 +47,7 @@ foreach my $perlver (sort keys %perlreq) { } foreach my $module (sort keys %global_require) { + next if ($module =~ /^v?\d*\.?\d*\_?\d*$/); next if (&is_filtered($module)); if (length($global_require{$module}) == 0) {