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

  Server: cvs.openpkg.org                  Name:   Michael van Elst
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   13-Jan-2003 17:35:08
  Branch: HEAD                             Handle: 2003011316350701

  Modified files:
    openpkg-src/openpkg-tool
                            openpkg-build.pl openpkg.pod

  Log:
    fix option dependencies, add opt_m

  Summary:
    Revision    Changes     Path
    1.31        +36 -10     openpkg-src/openpkg-tool/openpkg-build.pl
    1.9         +5  -0      openpkg-src/openpkg-tool/openpkg.pod
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg-tool/openpkg-build.pl
  ============================================================================
  $ cvs diff -u -r1.30 -r1.31 openpkg-build.pl
  --- openpkg-src/openpkg-tool/openpkg-build.pl 10 Jan 2003 21:47:26 -0000      1.30
  +++ openpkg-src/openpkg-tool/openpkg-build.pl 13 Jan 2003 16:35:07 -0000      1.31
  @@ -29,8 +29,8 @@
   $|=1; # autoflush
   
   use strict;
  -use vars qw/$opt_R $opt_r $opt_f $opt_u $opt_U $opt_a $opt_A $opt_z $opt_Z $opt_P 
$opt_N $opt_E $opt_i $opt_D $opt_p $opt_q $opt_s $opt_S $opt_X/;
  -my $getopts = 'R:r:f:uUaAzZP:N:E:iD:p:qsSX';
  +use vars qw/$opt_R $opt_r $opt_f $opt_u $opt_U $opt_a $opt_A $opt_z $opt_Z $opt_P 
$opt_N $opt_E $opt_i $opt_D $opt_p $opt_q $opt_s $opt_S $opt_X $opt_M/;
  +my $getopts = 'R:r:f:uUaAzZP:N:E:iD:p:qsSXM';
   getopts($getopts);
   
   ##########################################################################
  @@ -223,12 +223,14 @@
   
   sub vs ($) {
       my($t) = @_;
  -    return "$t->{version}-$t->{release}";
  +    return defined $t->{release}
  +        ? "$t->{version}-$t->{release}"
  +        : $t->{version};
   }
   
   sub vsn ($) {
       my($t) = @_;
  -    return "$t->{name}-$t->{version}-$t->{release}";
  +    return "$t->{name}-".vs($t);
   }
   
   ##########################################################################
  @@ -269,6 +271,7 @@
       } elsif ($rel =~ /^(\d+\.\d+)/) {
           $rel = $1;
           print "# $PROG release($rel)\n";
  +        print "# using '$RPM_NPRIV' (build) and '$RPM_PRIV' (install)\n";
           $url = "ftp://ftp.openpkg.org/release/$rel/";;
       } else {
           die "FATAL: don't know how to handle this release\n";
  @@ -1247,8 +1250,8 @@
   #
   #
   #
  -sub make_dep ($$$$$$) {
  -    my($target,$depth,$env,$list,$blist,$clist) = @_;
  +sub make_dep ($$$$$$$) {
  +    my($who,$target,$depth,$env,$list,$blist,$clist) = @_;
       my($d,$k,%d,%k,$t,$old);
       my(@deps,$conflict);
   
  @@ -1359,12 +1362,14 @@
   
           unless ($conflict) {
               foreach $t (@deps) {
  -                make_dep($t,$depth+1,$env,$list,$blist,$clist);
  +                make_dep($target,$t,$depth+1,$env,$list,$blist,$clist);
               }
           }
       }
   
       print "# adding ".vsn($target)." to list\n";
  +    $target->{WHO} = $who;
  +    $target->{WHY} = $target->{STATUS};
       push(@$list, $target);
   
       foreach (@{$target->{nosource}}) {
  @@ -1394,7 +1399,7 @@
               push(@$blist, $t);
   
               print "# rebuilding revdep ".vsn($t)."\n";
  -            make_dep($t,$depth+1,$env,$list,$blist,$clist);
  +            make_dep(undef,$t,$depth+1,$env,$list,$blist,$clist);
           }
       }
   }
  @@ -1484,7 +1489,7 @@
       @keeps   = @goals;
       foreach $t (@goals) {
           print "# recursing over dependencies for ".vsn($t)."\n";
  -        make_dep($t,0,$env,\@targets,\@keeps,\@conflicts);
  +        make_dep(undef,$t,0,$env,\@targets,\@keeps,\@conflicts);
       }
   
       %keep = map { $_ => 1 } @keeps;
  @@ -1739,6 +1744,25 @@
       }
   }
   
  +#
  +# print dependency map
  +#
  +sub print_map ($$$$$) {
  +    my($installed,$repository,$list,$bonly,$clist) = @_;
  +    my(%dep);
  +
  +    foreach (@$bonly) {
  +        $_->{status} = 'TEMP';
  +    }
  +
  +    foreach (reverse @$list) {
  +        printf "%-35s %-8s %s\n",
  +            $_->{WHO} ? vsn($_->{WHO}) : "GOAL",
  +            $_->{WHY} ? $_->{WHY} : '???',
  +            vsn($_);
  +    }
  +}
  +
   #######################################################################
   
   my($config,$url,$repository,$installed,$env,$list,$bonly,$clist);
  @@ -1808,7 +1832,9 @@
   ($list,$bonly,$clist) = build_list($pattern, $env);
   die "FATAL: cannot find package\n" unless defined $list;
   
  -if ($opt_S) {
  +if ($opt_M) {
  +    print_map($installed,$repository,$list,$bonly,$clist);
  +} elsif ($opt_S) {
       print_status($installed,$repository,$list,$bonly,$clist);
   } elsif ($opt_s) {
       print_status($installed,{},$list,$bonly,$clist);
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg-tool/openpkg.pod
  ============================================================================
  $ cvs diff -u -r1.8 -r1.9 openpkg.pod
  --- openpkg-src/openpkg-tool/openpkg.pod      9 Jan 2003 14:23:17 -0000       1.8
  +++ openpkg-src/openpkg-tool/openpkg.pod      13 Jan 2003 16:35:08 -0000      1.9
  @@ -59,6 +59,7 @@
   [B<-q>]
   [B<-s>]
   [B<-S>]
  +[B<-M>]
   [B<-X>]
   [B<-P> I<priv-cmd>]
   [B<-N> I<non-priv-cmd>]
  @@ -249,6 +250,10 @@
   The package exists in the repository but isn't required yet.
   
   =back
  +
  +=item B<-M>
  +
  +Similar to B<-s> but print a short dependency map.
   
   =item B<-X>
   
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to