]>
Commit | Line | Data |
---|---|---|
ebe974a8 AF |
1 | --- rpm-5.3.1/configure.ac.wiget 2010-05-22 17:15:11.000000000 +0200 |
2 | +++ rpm-5.3.1/configure.ac 2010-05-30 16:37:59.526924459 +0200 | |
3 | @@ -2198,6 +2198,7 @@ AC_CONFIG_FILES([ po/Makefile.in | |
4 | build/Makefile build/auto/Makefile build/auto/desc build/auto/types | |
5 | tools/Makefile | |
6 | scripts/Makefile | |
dafd24dd | 7 | + scripts/perl.req scripts/perl.prov |
ebe974a8 AF |
8 | rpmdb/DB_CONFIG |
9 | macros/macros macros/macros.rpmbuild | |
10 | macros/java macros/libtool macros/mono macros/perl | |
11 | --- rpm-5.3.1/scripts/perl.req.wiget 2008-10-26 10:50:53.000000000 +0100 | |
12 | +++ rpm-5.3.1/scripts/perl.req 2010-05-30 16:35:36.999438206 +0200 | |
2fa5aec3 AF |
13 | @@ -1,4 +1,4 @@ |
14 | -#!/usr/bin/perl | |
5b0f0ac9 | 15 | +#!@__PERL@ |
4703c2f4 | 16 | |
fe3cefac | 17 | # RPM (and its source code) is covered under two separate licenses. |
4703c2f4 AF |
18 | |
19 | @@ -41,7 +41,11 @@ | |
2fa5aec3 AF |
20 | |
21 | if ("@ARGV") { | |
22 | foreach (@ARGV) { | |
23 | - process_file($_); | |
20a6d548 | 24 | + if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) { |
2eb651d8 | 25 | + if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) { |
2fa5aec3 AF |
26 | + process_file($_); |
27 | + } | |
28 | + } | |
29 | } | |
30 | } else { | |
31 | ||
ebe974a8 | 32 | @@ -49,7 +53,11 @@ if ("@ARGV") { |
2fa5aec3 AF |
33 | # contents of the file. |
34 | ||
35 | foreach (<>) { | |
36 | - process_file($_); | |
4703c2f4 AF |
37 | + if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) { |
38 | + if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) { | |
39 | + process_file($_); | |
40 | + } | |
41 | + } | |
2fa5aec3 AF |
42 | } |
43 | } | |
edf87823 | 44 | |
ebe974a8 | 45 | @@ -215,19 +223,41 @@ sub process_file { |
edf87823 | 46 | |
fe3cefac JB |
47 | $module =~ s/\(\s*\)$//; |
48 | ||
49 | - if ( $module =~ m/^v?([0-9._]+)$/ ) { | |
50 | + if ( $module =~ m/^(v?)([0-9._]+)$/ ) { | |
51 | # if module is a number then both require and use interpret that | |
52 | # to mean that a particular version of perl is specified | |
53 | ||
54 | - my $ver=$1; | |
55 | - if ($ver =~ /5.00/) { | |
56 | - print "perl >= 0:$ver\n"; | |
57 | - next; | |
58 | - } | |
59 | - else { | |
60 | - print "perl >= 1:$ver\n"; | |
61 | - next; | |
62 | - } | |
63 | + my $ver=$2; | |
64 | + if (($1 eq 'v') or ($ver =~ /[0-9]+\.[0-9]+\.[0-9]+/)) { | |
65 | + # $V-style | |
66 | + if ($ver =~ m/5\.([0-5])(\.([0-9]+))?$/) { | |
67 | + if (defined $3) { | |
68 | + print "perl-base >= 0:5.00$1_$3\n"; | |
69 | + } else { | |
70 | + print "perl-base >= 0:5.00$1\n"; | |
71 | + } | |
72 | + } else { | |
73 | + print "perl-base >= 1:$ver\n"; | |
74 | + } | |
75 | + } else { | |
76 | + # $]-style | |
77 | + if ($ver =~ m/5\.(00[0-5])_?([0-9]+)?$/) { | |
78 | + if (defined $2) { | |
79 | + print "perl-base >= 0:5.$1_$2\n"; | |
80 | + } else { | |
81 | + print "perl-base >= 0:5.$1\n"; | |
82 | + } | |
83 | + } else { | |
84 | + # expand to M.NNN_nnn form | |
85 | + $ver =~ s/^([0-9])$/$1./; | |
86 | + $ver =~ s/^([0-9]\.[0-9]{0,5}|[0-9]\.[0-9]{3}_[0-9]{0,2})$/${1}000000/; | |
87 | + $ver =~ s/^([0-9]\.[0-9]{3})_?([0-9]{3})0*$/$1_$2/; | |
88 | + # match trimming leading 0s | |
89 | + $ver =~ m/^([0-9])\.0*([1-9][0-9]*|0)_0*([1-9][0-9]*|0)$/; | |
90 | + print "perl-base >= 1:$1.$2.$3\n"; | |
91 | + } | |
92 | + } | |
93 | + next; | |
94 | ||
95 | }; | |
2fa5aec3 | 96 | |
ebe974a8 | 97 | @@ -244,7 +274,31 @@ sub process_file { |
3ce8984f | 98 | # will be included with the name sys/systeminfo.ph so only use the |
99 | # basename of *.ph files | |
100 | ||
5b0f0ac9 | 101 | - ($module =~ m/\.ph$/) && next; |
3ce8984f | 102 | + # ($module =~ m/\.ph$/) && ($module =~ s!.*/!!g ); |
5b0f0ac9 | 103 | + |
852c3a98 | 104 | + # there is no need to generate dependencies for ph, pl or test files |
4a19987c | 105 | + # so let's just skip them. |
4703c2f4 | 106 | + |
852c3a98 | 107 | + ($module =~ m/\.(ph|pl|t)$/) && next; |
cfd811fa | 108 | + |
4a19987c | 109 | + # skip all modules for platforms other than linux. |
92b19143 | 110 | + |
111 | + ($module =~ m/Mac|OS2|MSDOS|Win32|VMS|vmsish/) && next; | |
112 | + | |
4a19987c | 113 | + # if the module name starts in a dot it is not a module name. |
4d8fb4e3 | 114 | + |
115 | + ($module =~ m/^\./) && next; | |
116 | + | |
4a19987c | 117 | + # if the module ends with .pm strip it to leave only basename. |
5e855029 | 118 | + |
4a19987c | 119 | + $module =~ s/\.pm$//; |
5e855029 | 120 | + |
cb87a980 | 121 | + $module =~ s/\//::/; |
122 | + | |
4a19987c | 123 | + # trim off trailing parenthesis if any. Sometimes people pass |
124 | + # the module an empty list. | |
125 | + | |
126 | + $module =~ s/\(\s*\)$//; | |
cfd811fa | 127 | |
3ce8984f | 128 | $require{$module}=$version; |
5b0f0ac9 | 129 | $line{$module}=$_; |