File:  [LON-CAPA] / capa / capa51 / CapaTools / installcapa.pl
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Sep 28 21:25:35 1999 UTC (24 years, 7 months ago) by albertel
Branches: capa
CVS tags: start
Created directory structure

#!/usr/local/bin/perl
 require('getopts.pl');

#
#  CAPA installation script version 1.0
#  
#  Installation is a multi-phased operation and 
#   can start in any point  
#
#  -m     [menu mode (interactive mode)]
#  -c     [install a class]
#
#
 sub  S_Enterpath {
    local($set)=@_;
    local($notdone,$path);
    
    $notdone = 1;
    while ($notdone) {
      print "Please enter the CLASS absolute path:\n";
      $path = <>; chomp($path);
      if( $path =~ /\/$/ ) {
        $Rfullpath = "$path" . "records";
        $Lfullpath = "$path" . "records/log$set.db";
        $Wfullpath = "$path" . "records/weblog$set.db";
      } else {
        $Rfullpath = "$path" . "/records";
        $Lfullpath = "$path" . "/records/log$set.db";
        $Wfullpath = "$path" . "/records/weblog$set.db";
      }
      if( -d $path ) {
        if( -d $Rfullpath ) {
          if( -f $Lfullpath ) {
            $notdone = 0;
          } else {
            print "File [$Lfullpath] does not exist!\n";
          }
          if( -f $Wfullpath ) {
            $notdone = 0;
          } else {
            print "File [$Wfullpath] does not exist!\n";
          }
        } else {
          print "Directory [$Rfullpath] does not exist!\n";
        }
      } else {
        print "Directory [$path] does not exist!\n";
      }
    
    }
    return ($path);
  }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>