From 7b1387608ae59908481fc3bf06decb1f2cdd0c54 Mon Sep 17 00:00:00 2001 From: mis Date: Fri, 22 Dec 2000 14:46:59 +0000 Subject: [PATCH] - remove provided modules from requirements list - remove "the" from -"- (common mistake) Changed files: rpm-perl-req-perlfile.patch -> 1.2 --- rpm-perl-req-perlfile.patch | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/rpm-perl-req-perlfile.patch b/rpm-perl-req-perlfile.patch index 45043f7..93a3950 100644 --- a/rpm-perl-req-perlfile.patch +++ b/rpm-perl-req-perlfile.patch @@ -1,6 +1,18 @@ ---- rpm-4.0/scripts/perl.req Wed Jul 5 14:26:37 2000 -+++ rpm-4.0.new/scripts/perl.req Wed Nov 15 21:31:03 2000 -@@ -82,6 +82,53 @@ +--- rpm-4.0/scripts/perl.req Mon Dec 16 11:36:15 2000 ++++ rpm-4.0.mis/scripts/perl.req Mon Dec 16 11:46:28 2000 +@@ -61,6 +61,11 @@ + } + } + ++foreach (sort keys %provide) { ++ delete $require{$_}; ++} ++delete $require{the}; # don't count "use the sth" as perl module ++ + + foreach $module (sort keys %require) { + if (length($require{$module}) == 0) { +@@ -82,6 +86,53 @@ exit 0; @@ -54,7 +66,7 @@ sub process_file { -@@ -90,6 +137,8 @@ +@@ -90,6 +141,8 @@ open(FILE, "<$file")|| die("$0: Could not open file: '$file' : $!\n"); @@ -63,7 +75,18 @@ while () { -@@ -209,6 +258,10 @@ +@@ -112,6 +165,10 @@ + last; + } + ++ if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) { ++ $provide{$1} = 1; ++ } ++ + # Each keyword can appear multiple times. Don't + # bother with datastructures to store these strings, + # if we need to print it print it now. +@@ -209,6 +266,10 @@ # if the module name starts in a dot it is not a module name. ($module =~ m/^\./) && next; -- 2.44.0