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 | |
parent | fdb559c5ca9bbe79c9c40b26cbd0f44ca8b63ce2 (diff) | |
download | rpmtools-fa3bafd6b885d9de4603c820e789c0683cc02594.tar rpmtools-fa3bafd6b885d9de4603c820e789c0683cc02594.tar.gz rpmtools-fa3bafd6b885d9de4603c820e789c0683cc02594.tar.bz2 rpmtools-fa3bafd6b885d9de4603c820e789c0683cc02594.tar.xz rpmtools-fa3bafd6b885d9de4603c820e789c0683cc02594.zip |
4.3-5mdk4.3.5
-rwxr-xr-x | distriblint | 40 | ||||
-rw-r--r-- | rpmtools.spec | 5 |
2 files changed, 40 insertions, 5 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; diff --git a/rpmtools.spec b/rpmtools.spec index fde59a2..515fac3 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,5 +1,5 @@ %define name rpmtools -%define release 4mdk +%define release 5mdk # do not modify here, see Makefile in the CVS %define version 4.3 @@ -55,6 +55,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/perl5/man/*/* %changelog +* Fri Jun 28 2002 François Pons <fpons@mandrakesoft.com> 4.3-5mdk +- added new test to check requires of all package to distriblint. + * Thu Jun 27 2002 François Pons <fpons@mandrakesoft.com> 4.3-4mdk - added distriblint (was mdkdischk) now using perl-URPM and only ported two tests instead of the initial five (some are |