IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16124


Ignore:
Timestamp:
Jan 17, 2008, 3:15:58 PM (18 years ago)
Author:
eugene
Message:

adding -bootstrap option to psbuild

Location:
trunk/psconfig
Files:
2 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig

    • Property svn:ignore
      •  

        old new  
        11tarballs
         2psconfig.csh
         3psconfig.bash
  • trunk/psconfig/.cvsignore

    r12158 r16124  
    11tarballs
     2psconfig.csh
     3psconfig.bash
  • trunk/psconfig/psbuild

    r16092 r16124  
    5454    if ($ARGV[0] eq "-list") {
    5555        &list_distributions ();
     56    }
     57    if ($ARGV[0] eq "-bootstrap") {
     58        &bootstrap ();
    5659    }
    5760    if ($ARGV[0] eq "-env") {
     
    254257    }
    255258    exit 2;
     259}
     260
     261sub bootstrap {
     262
     263    if (@ARGV != 2) { die "USAGE: psbuild -bootstrap (install_dir)\n"; }
     264    $psconfdir = $ARGV[1];
     265
     266    # copy psconfig.csh and psconfig.bash to psconfdir
     267    vsystem ("cat psconfig.csh.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.csh");
     268    vsystem ("cat psconfig.bash.in | sed 's|\@PSCONFDIR@|$psconfdir|' > psconfig.bash");
     269
     270    vsystem ("mkdir -p $psconfdir");
     271
     272    vsystem ("cp psconfig.csh $psconfdir/psconfig.csh");
     273    vsystem ("cp psconfig.bash $psconfdir/psconfig.bash");
     274    print STDOUT "\n";
     275   
     276    print STDOUT "** if you use csh, tcsh or equivalent as your shell, add the following to your .cshrc\n";
     277    print STDOUT "    if (-e $psconfdir/psconfig.csh) then\n";
     278    print STDOUT "      alias  psconfig        \"source $psconfdir/psconfig.csh\"\n";
     279    print STDOUT "    else\n";
     280    print STDOUT "      alias  psconfig        \"echo psconfig not available\"\n";
     281    print STDOUT "    endif\n";
     282    print STDOUT "    psconfig default\n";
     283    print STDOUT "\n";
     284
     285    print STDOUT "** if you use sh, bash or equivalent as your shell, add the following to your .bashrc\n";
     286    print STDOUT "    if [ -f $psconfdir/psconfig.csh ]; then\n";
     287    print STDOUT "      alias psconfig='source $psconfdir/psconfig.bash'\n";
     288    print STDOUT "    else\n";
     289    print STDOUT "      alias psconfig='echo psconfig not available'\n";
     290    print STDOUT "    fi\n";
     291    print STDOUT "    psconfig default\n";
     292    print STDOUT "\n";
     293
     294    exit 0;
    256295}
    257296
Note: See TracChangeset for help on using the changeset viewer.