OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Michael van Elst
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-re                       Date:   18-Nov-2002 16:23:58
  Branch: HEAD                             Handle: 2002111815235800

  Modified files:
    openpkg-re              openpkg-build

  Log:
    ignore packages that conflict with installed base

  Summary:
    Revision    Changes     Path
    1.27        +46 -14     openpkg-re/openpkg-build
  ____________________________________________________________________________

  Index: openpkg-re/openpkg-build
  ============================================================
  $ cvs diff -u -r1.26 -r1.27 openpkg-build
  --- openpkg-re/openpkg-build  18 Nov 2002 11:08:43 -0000      1.26
  +++ openpkg-re/openpkg-build  18 Nov 2002 15:23:58 -0000      1.27
  @@ -382,7 +382,7 @@
           my($name,$version);
           my($href,$release);
           my(@prereq,@bprereq);
  -        my(@provides,$rec);
  +        my(@provides,@conflicts,$rec);
           my($tag,$cond,$body);
           my($useit);
   
  @@ -392,13 +392,14 @@
               s/&lt;/</g;
   
               if (/<rdf:Description.*?href="([^"]*)"/) {
  -                $section = undef;
  -                $href    = $1;
  -                $name    = undef;
  -                $release = undef;
  -                @prereq  = ();
  -                @bprereq = ();
  -                @provides = ();
  +                $section   = undef;
  +                $href      = $1;
  +                $name      = undef;
  +                $release   = undef;
  +                @prereq    = ();
  +                @bprereq   = ();
  +                @provides  = ();
  +                @conflicts = ();
               }
               next unless defined $href;
   
  @@ -419,6 +420,10 @@
                   $section = 'provides' if $useit;
               } elsif ($tag eq '/Provides') {
                   $section = undef;
  +            } elsif ($tag eq 'Conflicts') {
  +                $section = 'conflicts' if $useit;
  +            } elsif ($tag eq '/Conflicts') {
  +                $section = undef;
               } elsif ($tag eq 'Name') {
                   $name = $body;
               } elsif ($tag eq 'Version') {
  @@ -432,6 +437,8 @@
                       push(@bprereq, $body);
                   } elsif ($section eq 'provides') {
                       push(@provides, $body);
  +                } elsif ($section eq 'conflicts') {
  +                    push(@conflicts, $body);
                   }
               } elsif ($tag eq '/rdf:Description') {
   
  @@ -446,12 +453,13 @@
                       });
   
                       $rec = {
  -                        name     => $name,
  -                        version  => $version,
  -                        release  => $release,
  -                        depends  => [ @bprereq ],
  -                        keeps    => [ @prereq ],
  -                        href     => $href
  +                        name      => $name,
  +                        version   => $version,
  +                        release   => $release,
  +                        depends   => [ @bprereq ],
  +                        keeps     => [ @prereq ],
  +                        conflicts => [ @conflicts ],
  +                        href      => $href
                       };
   
                       foreach (@provides) {
  @@ -574,6 +582,20 @@
   }
   
   #
  +# see wether target has conflicts in map
  +#
  +sub target_conflicts ($$) {
  +    my($target, $map) = @_;
  +    my(@c,@vs);
  +
  +    @c = grep { $map->{$_} } @{$target->{conflicts}};
  +    return unless @c;
  +
  +    @vs = sort { -vcmp($a,$b) } keys %{$map->{$c[0]}};
  +    return $map->{$c[0]}->{$vs[0]}->[0];
  +}
  +
  +#
   # retrieve build dependencies for target in map
   #
   sub target_depends ($$) {
  @@ -713,6 +735,16 @@
   
       if (target_exists($target, $env->{built})) {
           print "# $target->{name} is already in list\n";
  +        return;
  +    }
  +
  +    if ($t = target_conflicts($target, $env->{installed})) {
  +        print "# $target->{name} conflicts with ",vsn($t),"\n";
  +        return;
  +    }
  +
  +    if ($t = target_conflicts($target, $env->{built})) {
  +        print "# $target->{name} conflicts with ",vsn($t),"\n";
           return;
       }
   
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to