]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-perl-macros.patch
- fix !dist_kernel with non-built tree
[packages/rpm.git] / rpm-perl-macros.patch
1 diff -urN rpm-4.3.org/configure.ac rpm-4.3/configure.ac
2 --- rpm-4.3.org/configure.ac    2004-01-07 01:51:35.251160244 +0100
3 +++ rpm-4.3/configure.ac        2004-01-07 01:55:53.198560246 +0100
4 @@ -1313,6 +1313,7 @@
5      Doxyfile Makefile macros rpmpopt rpm.spec
6      rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
7      scripts/Makefile scripts/macros.perl scripts/macros.php
8 +    scripts/perl.req scripts/perl.prov
9      scripts/macros.python tools/Makefile misc/Makefile doc/Makefile
10      doc/manual/Makefile doc/fr/Makefile doc/ja/Makefile doc/ko/Makefile
11      doc/pl/Makefile doc/ru/Makefile doc/sk/Makefile python/Makefile
12 --- rpm-4.4.9/scripts/perl.req.orig     2006-07-08 16:13:50.000000000 +0200
13 +++ rpm-4.4.9/scripts/perl.req  2008-03-24 01:13:31.985544655 +0100
14 @@ -1,4 +1,4 @@
15 -#!/usr/bin/perl
16 +#!@__PERL@
17  
18  # RPM (and its source code) is covered under two separate licenses. 
19  
20 @@ -41,7 +41,11 @@
21  
22  if ("@ARGV") {
23    foreach (@ARGV) {
24 -    process_file($_);
25 +    if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) {
26 +      if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) {
27 +        process_file($_);
28 +      }
29 +    }
30    }
31  } else {
32    
33 @@ -49,7 +53,11 @@
34    # contents of the file.
35    
36    foreach (<>) {
37 -    process_file($_);
38 +     if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) {
39 +       if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) {
40 +         process_file($_);
41 +       }
42 +     }
43    }
44  }
45  
46 @@ -203,19 +211,41 @@
47  
48        $module =~ s/\(\s*\)$//;
49  
50 -      if ( $module =~ m/^v?([0-9._]+)$/ ) {
51 +      if ( $module =~ m/^(v?)([0-9._]+)$/ ) {
52        # if module is a number then both require and use interpret that
53        # to mean that a particular version of perl is specified
54  
55 -      my $ver=$1;
56 -      if ($ver =~ /5.00/) {
57 -        print "perl >= 0:$ver\n";
58 -        next;
59 -      }
60 -      else {
61 -        print "perl >= 1:$ver\n";
62 -        next;
63 -      }
64 +       my $ver=$2;
65 +       if (($1 eq 'v') or ($ver =~ /[0-9]+\.[0-9]+\.[0-9]+/)) {
66 +         # $V-style
67 +         if ($ver =~ m/5\.([0-5])(\.([0-9]+))?$/) {
68 +           if (defined $3) {
69 +             print "perl-base >= 0:5.00$1_$3\n";
70 +           } else {
71 +             print "perl-base >= 0:5.00$1\n";
72 +           }
73 +         } else {
74 +           print "perl-base >= 1:$ver\n";
75 +         }
76 +       } else {
77 +         # $]-style
78 +         if ($ver =~ m/5\.(00[0-5])_?([0-9]+)?$/) {
79 +           if (defined $2) {
80 +             print "perl-base >= 0:5.$1_$2\n";
81 +           } else {
82 +             print "perl-base >= 0:5.$1\n";
83 +           }
84 +         } else {
85 +           # expand to M.NNN_nnn form
86 +           $ver =~ s/^([0-9])$/$1./;
87 +           $ver =~ s/^([0-9]\.[0-9]{0,5}|[0-9]\.[0-9]{3}_[0-9]{0,2})$/${1}000000/;
88 +           $ver =~ s/^([0-9]\.[0-9]{3})_?([0-9]{3})0*$/$1_$2/;
89 +           # match trimming leading 0s
90 +           $ver =~ m/^([0-9])\.0*([1-9][0-9]*|0)_0*([1-9][0-9]*|0)$/;
91 +           print "perl-base >= 1:$1.$2.$3\n";
92 +         }
93 +       }
94 +       next;
95  
96        };
97  
98 @@ -232,7 +262,31 @@
99        # will be included with the name sys/systeminfo.ph so only use the
100        # basename of *.ph files
101  
102 -      ($module  =~ m/\.ph$/) && next;
103 +      # ($module  =~ m/\.ph$/) && ($module =~ s!.*/!!g );
104
105 +      # there is no need to generate dependencies for ph, pl or test files
106 +      # so let's just skip them.
107 +
108 +      ($module =~ m/\.(ph|pl|t)$/) && next;
109 +
110 +      # skip all modules for platforms other than linux.
111 +
112 +      ($module =~ m/Mac|OS2|MSDOS|Win32|VMS|vmsish/) && next;
113 +
114 +      # if the module name starts in a dot it is not a module name.
115 +
116 +      ($module =~ m/^\./) && next;
117 +
118 +      # if the module ends with .pm strip it to leave only basename.
119 +
120 +      $module =~ s/\.pm$//;
121 +
122 +      $module =~ s/\//::/;
123 +
124 +      # trim off trailing parenthesis if any.  Sometimes people pass
125 +      # the module an empty list.
126 +
127 +      $module =~ s/\(\s*\)$//;
128  
129        $require{$module}=$version;
130        $line{$module}=$_;
This page took 0.045736 seconds and 3 git commands to generate.