IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2005, 8:10:10 AM (21 years ago)
Author:
eugene
Message:

mkdist improvements, adjustments to distribution tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/etc/mkdist

    r4761 r4807  
    11#!/usr/bin/env perl
     2
     3$diff = 0;
     4$list = 0;
     5@tARGV = ();
     6for (; @ARGV > 0; ) {
     7    if ($ARGV[0] eq "-diff") {
     8        $diff = 1;
     9        shift; next;
     10    }
     11    if ($ARGV[0] eq "-list") {
     12        $list = 1;
     13        shift; next;
     14    }
     15    if ($ARGV[0] eq "-h")     { &usage (); }
     16    if ($ARGV[0] eq "-help")  { &usage (); }
     17    if ($ARGV[0] eq "--help") { &usage (); }
     18    @tARGV = (@tARGV, $ARGV[0]);
     19    shift;
     20}
     21@ARGV = @tARGV;
    222
    323$distdir = "distributions";
    424
    5 if (@ARGV != 2) { die "USAGE: mkdist (group) (version)\n"; }
     25if (!$list && @ARGV != 2) { &usage (); }
     26if ( $list && @ARGV != 0) { &usage (); }
    627
    728@files = <$distdir/*.dst>;
     
    1334    $Ns = @sublist;
    1435    $Nt = @list;
    15     print STDERR "read $Ns from $file, $Nt so far\n";
    1636}
    1737
     
    2343@tag = ();
    2444
     45if ($list) {
     46    printf STDERR "Available Distributions\n";
     47    printf STDERR "%-16s  %7s\n", "Module", "Version";
     48    printf STDERR "-------------------------\n";
     49}
     50
    2551foreach $line (@list) {
    2652
     
    3157        ($tmp, $word1, $word2) = split (" ", $line);
    3258        if (($word1 eq $group) && ($word2 eq $version)) { $ingroup = 1; }
     59        if ($list) { printf STDERR "%-16s  %7s\n", $word1, $word2; }
    3360    }
    34     if (!$ingroup) { next; }
     61    if (!$ingroup || $list) { next; }
    3562
    3663    # found END
     
    5380}
    5481
     82if ($list) { exit 0; }
    5583if (@name == 0) { die "ERROR: $group $version not found\n"; }
     84
     85if ($diff) { &difflist (); }
    5686
    5787for ($i = 0; $i < @name; $i++) {
     
    78108}
    79109
     110sub usage {
     111    print STDERR "USAGE: mkdist -list\n   : list valid distributions \n";
     112    print STDERR "USAGE: mkdist (group) (version)\n   : make a distribution tarball\n";
     113    print STDERR "USAGE: mkdist -diff (group) (version)\n";
     114    print STDERR "   : show the difference between the distribution and current tree\n";
     115    exit 2;
     116}
     117
     118sub difflist {
     119
     120    for ($i = 0; $i < @name; $i++) {
     121        if ($tag[$i] eq "") {
     122            &vsystem ("cvs -q rdiff -s -r HEAD $name[$i]");
     123        } else {
     124            &vsystem ("cvs -q rdiff -s -r $tag[$i] $name[$i]");
     125        }       
     126    }
     127    exit 0;
     128}
Note: See TracChangeset for help on using the changeset viewer.