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
5 AC_CONFIG_SUBDIRS(popt beecrypt zlib elfutils file db3)
7 AC_CONFIG_FILES([ Doxyfile Makefile rpmrc macros platform rpmpopt rpm.spec
8 + scripts/perl.req scripts/perl.prov
9 rpmio/Makefile rpmdb/Makefile lib/Makefile build/Makefile
10 scripts/Makefile scripts/brp-redhat
11 scripts/macros.perl scripts/macros.php scripts/macros.python
12 diff -urN rpm-4.3.org/scripts/perl.req rpm-4.3/scripts/perl.req
13 --- rpm-4.3.org/scripts/perl.req 2004-01-07 01:51:04.911464416 +0100
14 +++ rpm-4.3/scripts/perl.req 2004-01-07 01:55:17.030076058 +0100
19 # RPM (and it's source code) is covered under two separate licenses.
26 + if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) {
27 + if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) {
35 # contents of the file.
39 + if (m=/usr/(sbin|bin|lib|share|X11R6/(lib|bin))/=) {
40 + if (! m=(/(doc|man|info|usr/src)/|\.(so|ph|h|html|pod)$)=) {
48 foreach $module (sort keys %require) {
49 if (length($require{$module}) == 0) {
50 - print "perl($module)\n";
51 + if ($module =~ /^[0-9._]+$/) {
52 + print "perl >= $module\n";
54 + print "perl($module)\n";
58 # I am not using rpm3.0 so I do not want spaces arround my
60 # will be included with the name sys/systeminfo.ph so only use the
61 # basename of *.ph files
63 - ($module =~ m/\.ph$/) && next;
64 + # ($module =~ m/\.ph$/) && ($module =~ s!.*/!!g );
66 + # there is no need to generate dependencies for ph, pl or test files
67 + # so let's just skip them.
69 + ($module =~ m/\.(ph|pl|t)$/) && next;
71 + # skip all modules for platforms other than linux.
73 + ($module =~ m/Mac|OS2|MSDOS|Win32|VMS|vmsish/) && next;
75 + # if the module name starts in a dot it is not a module name.
77 + ($module =~ m/^\./) && next;
79 + # if the module ends with .pm strip it to leave only basename.
81 + $module =~ s/\.pm$//;
83 + $module =~ s/\//::/;
85 + # trim off trailing parenthesis if any. Sometimes people pass
86 + # the module an empty list.
88 + $module =~ s/\(\s*\)$//;
90 $require{$module}=$version;
92 diff -urN rpm-4.3.org/scripts/perl.req.orig rpm-4.3/scripts/perl.req.orig
93 --- rpm-4.3.org/scripts/perl.req.orig 1970-01-01 01:00:00.000000000 +0100
94 +++ rpm-4.3/scripts/perl.req.orig 2004-01-04 03:13:09.000000000 +0100
98 +# RPM (and it's source code) is covered under two separate licenses.
100 +# The entire code base may be distributed under the terms of the GNU
101 +# General Public License (GPL), which appears immediately below.
102 +# Alternatively, all of the source code in the lib subdirectory of the
103 +# RPM source code distribution as well as any code derived from that
104 +# code may instead be distributed under the GNU Library General Public
105 +# License (LGPL), at the choice of the distributor. The complete text
106 +# of the LGPL appears at the bottom of this file.
108 +# This alternatively is allowed to enable applications to be linked
109 +# against the RPM library (commonly called librpm) without forcing
110 +# such applications to be distributed under the GPL.
112 +# Any questions regarding the licensing of RPM should be addressed to
113 +# Erik Troan <ewt@redhat.com>.
115 +# a simple makedepends like script for perl.
117 +# To save development time I do not parse the perl grammmar but
118 +# instead just lex it looking for what I want. I take special care to
119 +# ignore comments and pod's.
121 +# It would be much better if perl could tell us the dependencies of a
124 +# The filenames to scan are either passed on the command line or if
125 +# that is empty they are passed via stdin.
127 +# If there are strings in the file which match the pattern
128 +# m/^\s*\$RPM_Requires\s*=\s*["'](.*)['"]/i
129 +# then these are treated as additional names which are required by the
130 +# file and are printed as well.
132 +# I plan to rewrite this in C so that perl is not required by RPM at
135 +# by Ken Estes Mail.com kestes@staff.mail.com
143 + # notice we are passed a list of filenames NOT as common in unix the
144 + # contents of the file.
152 +foreach $module (sort keys %require) {
153 + if (length($require{$module}) == 0) {
154 + print "perl($module)\n";
157 + # I am not using rpm3.0 so I do not want spaces arround my
158 + # operators. Also I will need to change the processing of the
159 + # $RPM_* vairable when I upgrage.
161 + print "perl($module) >= $require{$module}\n";
174 + open(FILE, "<$file") || return;
178 + # skip the "= <<" block
180 + if ( ( m/^\s*\$(.*)\s*=\s*<<\s*["'](.*)['"]/i) ||
181 + ( m/^\s*\$(.*)\s*=\s*<<\s*(.*);/i) ) {
184 + ( $_ =~ /^$tag/) && last;
188 + # skip the documentation
190 + # we should not need to have item in this if statement (it
191 + # properly belongs in the over/back section) but people do not
192 + # read the perldoc.
194 + if ( (m/^=(head1|head2|pod|item)/) .. (m/^=(cut)/) ) {
198 + if ( (m/^=(over)/) .. (m/^=(back)/) ) {
202 + # skip the data section
203 + if (m/^__(DATA|END)__$/) {
207 + # Each keyword can appear multiple times. Don't
208 + # bother with datastructures to store these strings,
209 + # if we need to print it print it now.
211 + if ( m/^\s*\$RPM_Requires\s*=\s*["'](.*)['"]/i) {
212 + foreach $_ (split(/\s+/, $1)) {
219 +# ouch could be in a eval, perhaps we do not want these since we catch
220 +# an exception they must not be required
222 +# eval { require Term::ReadLine } or die $@;
223 +# eval "require Term::Rendezvous;" or die $@;
224 +# eval { require Carp } if defined $^S; # If error/warning during compilation,
227 + (m/^(\s*) # we hope the inclusion starts the line
228 + (require|use)\s+(?!\{) # do not want 'do {' loops
229 + # quotes around name are always legal
230 + [\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ]
231 + # the syntax for 'use' allows version requirements
235 + my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4);
237 + # we only consider require statements that are flush against
238 + # the left edge. any other require statements give too many
239 + # false positives, as they are usually inside of an if statement
240 + # as a fallback module or a rarely used option
242 + ($whitespace ne "" && $statement eq "require") && next;
244 + # if there is some interpolation of variables just skip this
245 + # dependency, we do not want
246 + # do "$ENV{LOGDIR}/$rcfile";
248 + ($module =~ m/\$/) && next;
250 + # skip if the phrase was "use of" -- shows up in gimp-perl, et al
251 + next if $module eq 'of';
253 + # if the module ends in a comma we probaly caught some
254 + # documentation of the form 'check stuff,\n do stuff, clean
255 + # stuff.' there are several of these in the perl distribution
257 + ($module =~ m/[,>]$/) && next;
259 + # if the module name starts in a dot it is not a module name.
260 + # Is this necessary? Please give me an example if you turn this
263 + # ($module =~ m/^\./) && next;
265 + # if the module ends with .pm strip it to leave only basename.
266 + # starts with /, which means its an absolute path to a file
267 + if ($module =~ m(^/)) {
272 + # sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc
273 + # we can strip qw.*$, as well as (.*$:
274 + $module =~ s/qw.*$//;
275 + $module =~ s/\(.*$//;
277 + $module =~ s/\.pm$//;
279 + # some perl programmers write 'require URI/URL;' when
280 + # they mean 'require URI::URL;'
282 + $module =~ s/\//::/;
284 + # trim off trailing parenthesis if any. Sometimes people pass
285 + # the module an empty list.
287 + $module =~ s/\(\s*\)$//;
289 + if ( $module =~ m/^[0-9._]+$/ ) {
290 + # if module is a number then both require and use interpret that
291 + # to mean that a particular version of perl is specified
293 + if ($module =~ /5.00/) {
294 + print "perl >= 0:$module\n";
298 + print "perl >= 1:$module\n";
304 + # ph files do not use the package name inside the file.
305 + # perlmodlib documentation says:
307 + # the .ph files made by h2ph will probably end up as
308 + # extension modules made by h2xs.
310 + # so do not expend much effort on these.
313 + # there is no easy way to find out if a file named systeminfo.ph
314 + # will be included with the name sys/systeminfo.ph so only use the
315 + # basename of *.ph files
317 + ($module =~ m/\.ph$/) && next;
319 + $require{$module}=$version;
326 + die("$0: Could not close file: '$file' : $!\n");