mirror of
https://abf.rosa.ru/djam/rpm.git
synced 2025-02-23 18:33:04 +00:00
510 lines
16 KiB
Diff
510 lines
16 KiB
Diff
--- rpm-5.4.9/macros/mandriva.in.perl_deps~ 2012-06-28 04:32:28.138659046 +0200
|
|
+++ rpm-5.4.9/macros/mandriva.in 2012-06-28 04:33:00.710251845 +0200
|
|
@@ -272,9 +272,6 @@ Group: %{group}\
|
|
|
|
# Use internal dependency generator rather than external helpers?
|
|
%_use_internal_dependency_generator 1
|
|
-# TODO: merge relevant changes into rpm version rather than using our own
|
|
-%__perl_provides @USRLIBRPM@/@RPMCANONVENDOR@/perl.prov
|
|
-%__perl_requires @USRLIBRPM@/@RPMCANONVENDOR@/perl.req
|
|
|
|
%__find_provides @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_provides_exceptions:%{_provides_exceptions}}%{!?_provides_exceptions: }' '%{?_exclude_files_from_autoprov:%{_exclude_files_from_autoprov}}%{!?_exclude_files_from_autoprov: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-provides
|
|
%__find_requires @USRLIBRPM@/@RPMCANONVENDOR@/filter.sh '%{?_requires_exceptions:%{_requires_exceptions}}%{!?_requires_exceptions: }' '%{?_exclude_files_from_autoreq:%{_exclude_files_from_autoreq}}%{!?_exclude_files_from_autoreq: }' '%{buildroot}' @USRLIBRPM@/@RPMCANONVENDOR@/find-requires %{?buildroot:%{buildroot}} %{?_target_cpu:%{_target_cpu}}
|
|
--- rpm-5.4.9/scripts/perl.prov.perl_deps~ 2012-06-28 04:32:36.406555684 +0200
|
|
+++ rpm-5.4.9/scripts/perl.prov 2012-06-28 04:32:46.907424405 +0200
|
|
@@ -45,8 +45,11 @@
|
|
|
|
# by Ken Estes Mail.com kestes@staff.mail.com
|
|
|
|
+use File::Basename ();
|
|
+
|
|
if ("@ARGV") {
|
|
foreach (@ARGV) {
|
|
+ next if !/\.pm$/;
|
|
process_file($_);
|
|
}
|
|
} else {
|
|
@@ -55,12 +58,22 @@ if ("@ARGV") {
|
|
# contents of the file.
|
|
|
|
foreach (<>) {
|
|
+ chomp $_;
|
|
+ next if !/\.pm$/;
|
|
process_file($_);
|
|
}
|
|
}
|
|
|
|
|
|
foreach $module (sort keys %require) {
|
|
+ if ($module =~ m/^abi$/) {
|
|
+ print "perl($module) = $require{$module}\n";
|
|
+ next;
|
|
+ }
|
|
+ # XXX: skip any modules not starting with upper case letters
|
|
+ if ($module =~ m/^[^A-Z]/) {
|
|
+ next;
|
|
+ }
|
|
if (length($require{$module}) == 0) {
|
|
print "perl($module)\n";
|
|
} else {
|
|
@@ -69,7 +82,9 @@ foreach $module (sort keys %require) {
|
|
# operators. Also I will need to change the processing of the
|
|
# $RPM_* variable when I upgrade.
|
|
|
|
- print "perl($module) = $require{$module}\n";
|
|
+ my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' };
|
|
+ chomp($v);
|
|
+ print "perl($module) = $v\n";
|
|
}
|
|
}
|
|
|
|
@@ -80,21 +95,31 @@ exit 0;
|
|
sub process_file {
|
|
|
|
my ($file) = @_;
|
|
- chomp $file;
|
|
|
|
- open(FILE, "<$file") || return;
|
|
+ if ($file =~ m/$Config{archname}\/Config.pm$/) {
|
|
+ my $vercmd = "perl -I". File::Basename::dirname($file) . " -MConfig -e 'print \"\$Config{version}\"'";
|
|
+ my $v = `$vercmd`;
|
|
+ if ($v) {
|
|
+ $require{"abi"} = $v;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (!open(FILE, $file)) {
|
|
+ warn("$0: Warning: Could not open file '$file' for reading: $!\n");
|
|
+ return;
|
|
+ }
|
|
|
|
my ($package, $version, $incomment, $inover) = ();
|
|
|
|
while (<FILE>) {
|
|
-
|
|
+
|
|
# skip the documentation
|
|
|
|
# we should not need to have item in this if statement (it
|
|
# properly belongs in the over/back section) but people do not
|
|
# read the perldoc.
|
|
|
|
- if (m/^=(head[1-4]|pod|item)/) {
|
|
+ if (m/^=(head[1-4]|pod|for|item)/) {
|
|
$incomment = 1;
|
|
}
|
|
|
|
@@ -102,7 +127,7 @@ sub process_file {
|
|
$incomment = 0;
|
|
$inover = 0;
|
|
}
|
|
-
|
|
+
|
|
if (m/^=(over)/) {
|
|
$inover = 1;
|
|
}
|
|
@@ -111,10 +136,10 @@ sub process_file {
|
|
$inover = 0;
|
|
}
|
|
|
|
- if ($incomment || $inover) {
|
|
+ if ($incomment || $inover || m/^\s*#/) {
|
|
next;
|
|
}
|
|
-
|
|
+
|
|
# skip the data section
|
|
if (m/^__(DATA|END)__$/) {
|
|
last;
|
|
@@ -125,17 +150,20 @@ sub process_file {
|
|
# false positives as if they were provided packages (really ugly).
|
|
|
|
if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) {
|
|
- $package=$1;
|
|
- undef $version;
|
|
- if ($package eq 'main') {
|
|
- undef $package;
|
|
- } else {
|
|
- # If $package already exists in the $require hash, it means
|
|
- # the package definition is broken up over multiple blocks.
|
|
- # In that case, don't stomp a previous $VERSION we might have
|
|
- # found. (See BZ#214496.)
|
|
- $require{$package}=undef unless (exists $require{$package});
|
|
- }
|
|
+ # some internal packages, like DB, might be temporarily redefined inside a module.
|
|
+ if (!($package && $1 eq 'DB')) {
|
|
+ $package=$1;
|
|
+ undef $version;
|
|
+ if ($package eq 'main') {
|
|
+ undef $package;
|
|
+ } else {
|
|
+ # If $package already exists in the $require hash, it means
|
|
+ # the package definition is broken up over multiple blocks.
|
|
+ # In that case, don't stomp a previous $VERSION we might have
|
|
+ # found. (See BZ#214496.)
|
|
+ $require{$package}=undef unless (exists $require{$package});
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
# after we found the package name take the first assignment to
|
|
@@ -144,49 +172,39 @@ sub process_file {
|
|
|
|
# here are examples of VERSION lines from the perl distribution
|
|
|
|
- #FindBin.pm:$VERSION = $VERSION = sprintf("%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/);
|
|
- #ExtUtils/Install.pm:$VERSION = substr q$Revision: 1.12 $, 10;
|
|
- #CGI/Apache.pm:$VERSION = (qw$Revision: 1.12 $)[1];
|
|
+ #FindBin.pm:$VERSION = $VERSION = sprintf("%d.%02d", q$Revision: 273856 $ =~ /(\d+)\.(\d+)/);
|
|
+ #ExtUtils/Install.pm:$VERSION = substr q$Revision: 273856 $, 10;
|
|
+ #CGI/Apache.pm:$VERSION = (qw$Revision: 273856 $)[1];
|
|
#DynaLoader.pm:$VERSION = $VERSION = "1.03"; # avoid typo warning
|
|
- #General.pm:$Config::General::VERSION = 2.33;
|
|
- #
|
|
- # or with the new "our" pragma you could (read will) see:
|
|
- #
|
|
- # our $VERSION = '1.00'
|
|
- if (($package) && (m/^\s*(our\s+)?\$(\Q$package\E::)?VERSION\s*=\s+/)) {
|
|
+ #$Locale::Maketext::Simple::VERSION = '0.21';
|
|
+
|
|
+ if (
|
|
+ $package &&
|
|
+ (m/^(.*;)?\s*((my|our)\s+)?\$(${package}::)?VERSION\s*=\s+/)
|
|
+ ) {
|
|
|
|
# first see if the version string contains the string
|
|
- # '$Revision' this often causes bizzare strings and is the most
|
|
+ # '$Revision' this often causes bizarre strings and is the most
|
|
# common method of non static numbering.
|
|
|
|
- if (m/(\$Revision: (\d+[.0-9]+))/) {
|
|
- $version= $2;
|
|
+ if (m/\$Revision: (\d+[.0-9]+)/) {
|
|
+ $version = $1;
|
|
} elsif (m/[\'\"]?(\d+[.0-9]+)[\'\"]?/) {
|
|
-
|
|
- # look for a static number hard coded in the script
|
|
-
|
|
- $version= $1;
|
|
+
|
|
+ # look for a static number hard coded in the script
|
|
+
|
|
+ $version= $1;
|
|
}
|
|
- $require{$package}=$version;
|
|
+ $require{$package} = $version;
|
|
}
|
|
-
|
|
- # Allow someone to have a variable that defines virtual packages
|
|
- # The variable is called $RPM_Provides. It must be scoped with
|
|
- # "our", but not "local" or "my" (just would not make sense).
|
|
- #
|
|
- # For instance:
|
|
- #
|
|
- # $RPM_Provides = "blah bleah"
|
|
- #
|
|
- # Will generate provides for "blah" and "bleah".
|
|
- #
|
|
+
|
|
# Each keyword can appear multiple times. Don't
|
|
# bother with datastructures to store these strings,
|
|
# if we need to print it print it now.
|
|
-
|
|
- if ( m/^\s*(our\s+)?\$RPM_Provides\s*=\s*["'](.*)['"]/i) {
|
|
- foreach $_ (split(/\s+/, $2)) {
|
|
- print "$_\n";
|
|
+
|
|
+ if (m/^\s*\$RPM_Provides\s*=\s*["'](.*)['"]/i) {
|
|
+ foreach $_ (split(/\s+/, $1)) {
|
|
+ print "$_\n";
|
|
}
|
|
}
|
|
|
|
@@ -195,5 +213,5 @@ sub process_file {
|
|
close(FILE) ||
|
|
die("$0: Could not close file: '$file' : $!\n");
|
|
|
|
- return ;
|
|
+ return;
|
|
}
|
|
--- rpm-5.4.9/scripts/perl.req.perl_deps~ 2012-06-28 04:32:39.137521541 +0200
|
|
+++ rpm-5.4.9/scripts/perl.req 2012-06-28 04:32:49.179396000 +0200
|
|
@@ -1,6 +1,6 @@
|
|
#!/usr/bin/perl
|
|
|
|
-# RPM (and its source code) is covered under two separate licenses.
|
|
+# RPM (and its source code) is covered under two separate licenses.
|
|
|
|
# The entire code base may be distributed under the terms of the GNU
|
|
# General Public License (GPL), which appears immediately below.
|
|
@@ -18,7 +18,7 @@
|
|
# Erik Troan <ewt@redhat.com>.
|
|
|
|
# a simple makedepend like script for perl.
|
|
-
|
|
+
|
|
# To save development time I do not parse the perl grammmar but
|
|
# instead just lex it looking for what I want. I take special care to
|
|
# ignore comments and pod's.
|
|
@@ -39,22 +39,36 @@
|
|
|
|
# by Ken Estes Mail.com kestes@staff.mail.com
|
|
|
|
+use Config;
|
|
+
|
|
if ("@ARGV") {
|
|
foreach (@ARGV) {
|
|
process_file($_);
|
|
}
|
|
} else {
|
|
-
|
|
+
|
|
# notice we are passed a list of filenames NOT as common in unix the
|
|
# contents of the file.
|
|
-
|
|
+
|
|
foreach (<>) {
|
|
+ chomp $_;
|
|
process_file($_);
|
|
}
|
|
}
|
|
|
|
|
|
foreach $module (sort keys %require) {
|
|
+ if ($module =~ m/^abi$/) {
|
|
+ print "perl($module) = $require{$module}\n";
|
|
+ next;
|
|
+ } elsif ($module =~ m/^api$/) {
|
|
+ print "perl(abi) >= $require{$module}\n";
|
|
+ next;
|
|
+ }
|
|
+ # XXX: skip any modules not starting with upper case letters
|
|
+ if ($module =~ m/^[^A-Z]/) {
|
|
+ next;
|
|
+ }
|
|
if (length($require{$module}) == 0) {
|
|
print "perl($module)\n";
|
|
} else {
|
|
@@ -63,7 +77,9 @@ foreach $module (sort keys %require) {
|
|
# operators. Also I will need to change the processing of the
|
|
# $RPM_* variable when I upgrade.
|
|
|
|
- print "perl($module) >= $require{$module}\n";
|
|
+ my $v = qx{ rpm --eval '%perl_convert_version $require{$module}' }; #' workaround vim highlighting issue.. ;)
|
|
+ chomp($v);
|
|
+ print "perl($module) >= $v\n";
|
|
}
|
|
}
|
|
|
|
@@ -72,16 +88,24 @@ exit 0;
|
|
|
|
|
|
sub process_file {
|
|
-
|
|
+
|
|
my ($file) = @_;
|
|
- chomp $file;
|
|
-
|
|
- open(FILE, "<$file") || return;
|
|
-
|
|
- while (<FILE>) {
|
|
|
|
+ # XXX: dependendency on perl(abi) = <version> for perl extensions
|
|
+ if ($file =~ m/$Config{archname}/) {
|
|
+ $require{"abi"} = $Config{version};
|
|
+ } elsif ($file =~ m/($Config{installsitelib}|$Config{installvendorlib}|$Config{installprivlib})/ and $file =~ m/$Config{version}/) {
|
|
+ $require{"api"} = $Config{version};
|
|
+ }
|
|
+
|
|
+ if (!open(FILE, $file)) {
|
|
+ warn("$0: Warning: Could not open file '$file' for reading: $!\n");
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ while (<FILE>) {
|
|
# skip the documentation
|
|
- if ( /^ = (?: head\d | pod | item | over | back | (?: begin|end|for ) \s+\S+ ) \b/x ) {
|
|
+ if ( /^ = (?: head\d | pod | for | item | over | back | (?: begin|end|for ) \s+\S+ ) \b/x ) {
|
|
$_ = <FILE> until /^=cut/ or eof;
|
|
next;
|
|
}
|
|
@@ -100,12 +124,12 @@ sub process_file {
|
|
# skip q{} quoted sections - just hope we don't have curly brackets
|
|
# within the quote, nor an escaped hash mark that isn't a comment
|
|
# marker, such as occurs right here. Draw the line somewhere.
|
|
- if ( m/^.*\Wq[qxwr]?\s*([\{\(\[#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
|
|
+ if ( m/^.*\Wq[qxwr]?\s*([{([#|\/])[^})\]#|\/]*$/ && ! m/^\s*(require|use)\s/ ) {
|
|
$tag = $1;
|
|
$tag =~ tr/{([/})]/;
|
|
$_ = <FILE> until m/\Q$tag\E/ or eof;
|
|
}
|
|
-
|
|
+
|
|
# skip the data section
|
|
if (m/^__(DATA|END)__$/) {
|
|
last;
|
|
@@ -115,28 +139,28 @@ sub process_file {
|
|
# bother with datastructures to store these strings,
|
|
# if we need to print it print it now.
|
|
#
|
|
- # Again allow for "our".
|
|
+ # Again allow for "our".
|
|
if ( m/^\s*(our\s+)?\$RPM_Requires\s*=\s*["'](.*)['"]/i) {
|
|
foreach $_ (split(/\s+/, $2)) {
|
|
- print "$_\n";
|
|
+ print "$_\n";
|
|
}
|
|
}
|
|
|
|
# handle "use base qw/ foo::bar baz::blah /;" and variations
|
|
if (
|
|
m/^ \s* use \s+ base
|
|
- (?: \s+ q[wq]? \s* ( [!@#\$%^&*'"\/+=`~,.?-] ) \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* \1
|
|
+ (?: \s+ q[wq]? \s* ( [!@#\$%^&*'"\/+=`~,.?-] ) \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* \1
|
|
|
|
|
- \s* ( ["'] ) ( [\w:]+? ) \3
|
|
+ \s* ( ["'] ) ( [\w:]+? ) \3
|
|
|
|
|
# qw[], qw(), qw<>, qw{} are handled here; lax, but who gives
|
|
- \s+ q[wq]? \s* [\[({<] \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* [\])}>]
|
|
+ \s+ q[wq]? \s* [\[({<] \s* ( [\w:]+? (?: \s+[\w:]+? )*? ) \s* [\])}>]
|
|
)
|
|
\s* ;
|
|
/x
|
|
)
|
|
{
|
|
- my @deps = ( $1 ? split /\s+/, $2 : $3 ? $4 : split /\s+/, $5 );
|
|
+ my @deps = ( $1 ? split /\s+/, $2 : $3 ? $4 : split /\s+/, $5 );
|
|
for my $mod ( grep !exists $require{$_}, @deps ) {
|
|
$require{$mod} = '';
|
|
$line{$mod} = $_;
|
|
@@ -153,17 +177,18 @@ sub process_file {
|
|
# eval { require Carp } if defined $^S; # If error/warning during compilation,
|
|
|
|
|
|
- (m/^(\s*) # we hope the inclusion starts the line
|
|
- (require|use)\s+(?!\{) # do not want 'do {' loops
|
|
- # quotes around name are always legal
|
|
- [\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ]
|
|
- # the syntax for 'use' allows version requirements
|
|
- \s*([.0-9]*)
|
|
- /x)
|
|
+ (m/^(\s*) # we hope the inclusion starts the line
|
|
+ (require|use)\s+(?!\{) # do not want 'do {' loops
|
|
+ # quotes around name are always legal
|
|
+ ['"]?([^; '"\t#]+)['"]?[\t; ]
|
|
+ # the syntax for 'use' allows version requirements
|
|
+ \s*([.0-9]*)
|
|
+ /x)
|
|
) {
|
|
my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4);
|
|
+ my $usebase;
|
|
|
|
- # we only consider require statements that are flush against
|
|
+ # we only consider require statements that are flushed against
|
|
# the left edge. any other require statements give too many
|
|
# false positives, as they are usually inside of an if statement
|
|
# as a fallback module or a rarely used option
|
|
@@ -173,7 +198,7 @@ sub process_file {
|
|
# if there is some interpolation of variables just skip this
|
|
# dependency, we do not want
|
|
# do "$ENV{LOGDIR}/$rcfile";
|
|
-
|
|
+
|
|
($module =~ m/\$/) && next;
|
|
|
|
# skip if the phrase was "use of" -- shows up in gimp-perl, et al.
|
|
@@ -198,6 +223,18 @@ sub process_file {
|
|
next;
|
|
}
|
|
|
|
+ # as seen in some perl scripts
|
|
+ # use base qw(App::CLI Class::Accessor::Chained::Fast App::CLI::Command);
|
|
+ if ($module eq 'base') {
|
|
+ $require{$module} = $version;
|
|
+ $line{$module} = $current_line;
|
|
+ ($module = $_) =~ s/use\s*base\s*//;
|
|
+ $module =~ s/qw\((.*)\)\s*;/$1/;
|
|
+ $module =~ s/qw(.)(.*)\1\s*;/$2/;
|
|
+ $module =~ s/\s*;$//;
|
|
+ $module =~ s/#.*//;
|
|
+ $usebase = 1;
|
|
+ }
|
|
# sometimes people do use POSIX qw(foo), or use POSIX(qw(foo)) etc.
|
|
# we can strip qw.*$, as well as (.*$:
|
|
$module =~ s/qw.*$//;
|
|
@@ -205,7 +242,7 @@ sub process_file {
|
|
|
|
$module =~ s/\.pm$//;
|
|
|
|
- # some perl programmers write 'require URI/URL;' when
|
|
+ # some perl programmers write 'require URI/URL;' when
|
|
# they mean 'require URI::URL;'
|
|
|
|
$module =~ s/\//::/;
|
|
@@ -215,45 +252,41 @@ sub process_file {
|
|
|
|
$module =~ s/\(\s*\)$//;
|
|
|
|
- if ( $module =~ m/^v?([0-9._]+)$/ ) {
|
|
# if module is a number then both require and use interpret that
|
|
- # to mean that a particular version of perl is specified
|
|
-
|
|
- my $ver=$1;
|
|
- if ($ver =~ /5.00/) {
|
|
- print "perl >= 0:$ver\n";
|
|
- next;
|
|
- }
|
|
- else {
|
|
- print "perl >= 1:$ver\n";
|
|
- next;
|
|
- }
|
|
-
|
|
- };
|
|
+ # to mean that a particular version of perl is specified. Don't
|
|
+ # add a dependency, though, since the rpm will already require
|
|
+ # perl-base at the build version (via find-requires)
|
|
+ next if $module =~ /^v?\d/;
|
|
|
|
# ph files do not use the package name inside the file.
|
|
# perlmodlib documentation says:
|
|
-
|
|
# the .ph files made by h2ph will probably end up as
|
|
# extension modules made by h2xs.
|
|
-
|
|
- # so do not expend much effort on these.
|
|
-
|
|
+ # so do not spend much effort on these.
|
|
|
|
# there is no easy way to find out if a file named systeminfo.ph
|
|
# will be included with the name sys/systeminfo.ph so only use the
|
|
# basename of *.ph files
|
|
|
|
- ($module =~ m/\.ph$/) && next;
|
|
+ ($module =~ m/\.ph$/) && next;
|
|
|
|
- $require{$module}=$version;
|
|
- $line{$module}=$_;
|
|
+ # if the module was loaded trough base, we need to split the list
|
|
+ if ($usebase) {
|
|
+ my $current_line = $_;
|
|
+ foreach (split(/\s+/, $module)) {
|
|
+ next unless $_;
|
|
+ $require{$_} = $version;
|
|
+ $line{$_} = $current_line;
|
|
+ }
|
|
+ } else {
|
|
+ $require{$module}=$version;
|
|
+ $line{$module}=$current_line;
|
|
+ }
|
|
}
|
|
-
|
|
}
|
|
|
|
close(FILE) ||
|
|
die("$0: Could not close file: '$file' : $!\n");
|
|
-
|
|
- return ;
|
|
+
|
|
+ return ;
|
|
}
|