Changeset 2530


Ignore:
Timestamp:
2001-06-13T10:36:45+12:00 (23 years ago)
Author:
sjboddie
Message:

altered the output of mkcol.pl a little so that it now hopefully looks
less like an error message when it succeeds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/mkcol.pl

    r2431 r2530  
    102102        $destfile =~ s/^modelcol/$collection/;
    103103        $destfile =~ s/^MODELCOL/$capcollection/;
     104        print STDOUT "  doing replacements for $destfile\n" unless $quiet;
    104105        $destfile = &util::filename_cat ($coldir, $destfile);
    105 
    106         print STDOUT "doing replacements for $thisfile\n" unless $quiet;
     106       
    107107        open (INFILE, $thisfile) ||
    108         die "Can't read file $thisfile";
     108        die "ERROR: Can't read file $thisfile";
    109109        open (OUTFILE, ">$destfile") ||
    110         die "Can't create file $destfile";
     110        die "ERROR: Can't create file $destfile";
    111111
    112112        while (defined ($line = <INFILE>)) {
     
    173173    ($collection) = @ARGV;
    174174    if (!defined($collection)) {
    175     print STDOUT "no collection name was specified\n";
     175    print STDOUT "ERROR: no collection name was specified\n";
    176176    &print_usage();
    177177    die "\n";
     
    179179
    180180    if (length($collection) > 8) {
    181     print STDOUT "The collection name must be less than 8 characters\n";
    182     print STDOUT "so compatibility with earlier filesystems can be\n";
    183     print STDOUT "maintained.\n";
     181    print STDOUT "ERROR: The collection name must be less than 8 characters\n";
     182    print STDOUT "       so compatibility with earlier filesystems can be\n";
     183    print STDOUT "       maintained.\n";
    184184    die "\n";
    185185    }
    186186
    187187    if ($collection eq "modelcol") {
    188     print STDOUT "No collection can be named modelcol as this is the\n";
    189     print STDOUT "name of the model collection.\n";
     188    print STDOUT "ERROR: No collection can be named modelcol as this is the\n";
     189    print STDOUT "       name of the model collection.\n";
    190190    die "\n";
    191191    }
    192192
    193193    if ($collection eq "CVS") {
    194     print STDOUT "No collection can be named CVS as this may interfere\n";
    195     print STDOUT "with directories created by the CVS versioning system\n";
     194    print STDOUT "ERROR: No collection can be named CVS as this may interfere\n";
     195    print STDOUT "       with directories created by the CVS versioning system\n";
    196196    die "\n";
    197197    }
    198198
    199199    if (!defined($creator) || $creator eq "") {
    200     print STDOUT "The creator was not defined. This variable is\n";
    201     print STDOUT "needed to recognise duplicate collection names.\n";
     200    print STDOUT "ERROR: The creator was not defined. This variable is\n";
     201    print STDOUT "       needed to recognise duplicate collection names.\n";
    202202    die "\n";
    203203    }
     
    236236
    237237    # make sure the model collection exists
    238     die "Cannot find the model collection $mdir" unless (-d $mdir);
     238    die "ERROR: Cannot find the model collection $mdir" unless (-d $mdir);
    239239
    240240    # make sure this collection does not already exist
    241241    if (-e $cdir) {
    242     print STDOUT "This collection already exists\n";
     242    print STDOUT "ERROR: This collection already exists\n";
    243243    die "\n";
    244244    }
    245245
    246246    # start creating the collection
    247     print STDOUT "Creating the collection $collection\n" unless $quiet;
     247    print STDOUT "\nCreating the collection $collection...\n" unless $quiet;
    248248    &traverse_dir ($mdir, $cdir);
    249     print STDOUT "The new collection is in $cdir.\n" unless $quiet;
     249    print STDOUT "\nThe new collection was created successfully at\n" unless $quiet;
     250    print STDOUT "$cdir\n" unless $quiet;
    250251}
    251252
Note: See TracChangeset for help on using the changeset viewer.