diff options
author | Francois Pons <fpons@mandriva.com> | 2002-06-28 07:10:29 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-06-28 07:10:29 +0000 |
commit | fa3bafd6b885d9de4603c820e789c0683cc02594 (patch) | |
tree | 8c07d1ec1fd7631ce30582b23132fa6078354076 /distriblint | |
parent | fdb559c5ca9bbe79c9c40b26cbd0f44ca8b63ce2 (diff) | |
download | rpmtools-4.3.5.tar rpmtools-4.3.5.tar.gz rpmtools-4.3.5.tar.bz2 rpmtools-4.3.5.tar.xz rpmtools-4.3.5.zip |
4.3-5mdk4.3.5
Diffstat (limited to 'distriblint')
-rwxr-xr-x | distriblint | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/distriblint b/distriblint index b2bc0cf..fa00cbc 100755 --- a/distriblint +++ b/distriblint @@ -32,6 +32,7 @@ use strict qw(subs vars refs); my @passtest = ( \&pass_get_hdlists, \&pass_check_filenames, + \&pass_check_requires, ); #- pass function for getting all package and simple checking. @@ -97,10 +98,11 @@ sub pass_check_filenames { foreach (0 .. $#files) { my $file = $files[$_]; my $key = join ' ', $md5sums[$_], $modes[$_], $sizes[$_], $owners[$_], $groups[$_]; - if (exists $o->{files}{$file} && $o->{files}{$file}[1] ne $key) { + my ($existing_id, $existing_key) = $o->{files}{$file} =~ /([^:]*):(.*)/; + if (exists $o->{files}{$file} && $existing_key ne $key) { #- check if package is marked as conflicting with this one. #- if this is the case, everything is right, else complains... - my $p = $o->{files}{$file}[0]; + my $p = $o->{depslist}[$existing_id]; my $ok = 0; my $provide_p = $p->name." == ".$p->epoch.":".$p->version."-".$p->release; @@ -113,9 +115,9 @@ sub pass_check_filenames { URPM::ranges_overlap($provide_pkg, $_) and $ok = 1, last; } - $ok or push @{$files{$o->{files}{$file}[0]->fullname}}, $file; #- conflicting package name is used. + $ok or push @{$files{$p->fullname}}, $file; #- conflicting package name is used. } else { - $o->{files}{$file} = [ $pkg, $key ] unless exists $o->{files}{$file}; + $o->{files}{$file} = $pkg->id . ':' . $key unless exists $o->{files}{$file}; } } @@ -141,6 +143,36 @@ sub pass_check_filenames { } } +#- pass function for requires checking, at least one provide should be allowed. +sub pass_check_requires { + my ($o) = @_; + + $o->{c}->("check requires of all packages, avoid unresolved."); + + foreach my $pkg (@{$o->{depslist}}) { + foreach ($pkg->requires) { + if (my ($property, $name) = /^(([^\s\[]*).*)/) { + my $ok = 0; + foreach my $id (keys %{$o->{provides}{$name} || {}}) { + my $p = $o->{depslist}[$id]; + foreach ($p->provides) { + URPM::ranges_overlap($_, $property) and ++$ok; + } + } + #- for files, check directly into files created by above test. + exists $o->{files}{$name} and ++$ok; + if ($ok) { + $o->{cok}->(); + } else { + $o->{cerr}->($pkg->fullname." has unresolved require [$property]."); + } + } else { + $o->{cerr}->($pkg->fullname." has non parseable require [$_]."); + } + } + } +} + #- main program. sub main { require URPM; |