home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / lisp / akcl_lin.z / akcl_lin / xbin / relink-script
Encoding:
Text File  |  1993-03-08  |  1.8 KB  |  78 lines

  1. #!/bin/sh
  2.  
  3. # the KCL_DISTRIB directory and the NEWKCL directory, and 
  4.  
  5. # script for creating a copy of the distribution kcl.
  6. # Directories in which no changes are to be made, are linked
  7. # directly. Otherwise a new directory is created linking
  8. # the individual files.  If there are args they are
  9.  
  10. KCL_DISTRIB=$1
  11. NEWKCL=$2
  12. export SYMB
  13. SYMB=$3
  14.  
  15.  
  16. #  if [ $# -ne 2 ] ; then echo usage distrib new ; exit 1 ; fi
  17. if [ ! -f $1/c/print.d  ] || [ -f $1/Smakefile ] ; then echo $1 is not the kcl distrib directory ;    exit 1 ; fi
  18.  
  19. if  [ ! -f Smakefile ] ; then echo $2 is not the new directory ; exit 1 ; fi
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. echo "Making links $NEWKCL --> $KCL_DISTRIB"
  27. echo Using for the new kcl directory :NEWKCL = ${NEWKCL}
  28. echo Assuming the KCL_DISTRIB is KCL_DISTRIB = ${KCL_DISTRIB}
  29.  
  30. cd $KCL_DISTRIB
  31.  
  32. for v in * ; do
  33.   if [ -f $v ] ; then  if [ -f ${NEWKCL}/$v ] ; then rm -f ${NEWKCL}/$v ;fi;
  34.     ln ${SYMB} ${KCL_DISTRIB}/$v ${NEWKCL}/$v ; fi;
  35.   if [ -d $v ] ;
  36.     then if [ ! -d ${NEWKCL}/$v ] ; then mkdir ${NEWKCL}/$v;
  37.             fi;
  38.           for w in $v/*     ; do
  39.            if [ -f $w ] ; then if [ -f ${NEWKCL}/$w ] ; then echo Not removing ${NEWKCL}/$w ;
  40.                                else ln ${SYMB} ${KCL_DISTRIB}/$w ${NEWKCL}/$w ;
  41.                    fi    
  42.        fi; done;
  43.  fi;
  44. done
  45.  
  46. # fix up two pathnames that some systems truncate [hp under hp-ux]
  47. if [ -f cmpnew/cmpspecial.dat ] ; then mv cmpnew/cmpspecial.dat cmpnew/cmpspecial.data ;fi
  48. if [ -f lsp/evalmacros.dat ] ; then mv lsp/evalmacros.dat lsp/evalmacros.data ;fi
  49.  
  50. cd ${NEWKCL}/lsp
  51. for v in `cat ../unixport/lspboots` ;
  52.    do rm -f $v.c $v.h $v.data ;
  53.    ln ${SYMB} ../lsp/dummy.c $v.c    
  54.    > $v.data
  55. done
  56. cd ${NEWKCL}/cmpnew
  57. for v in `cat ../unixport/cmpboots` ;
  58.    do rm -f $v.c $v.h $v.data ;
  59.    ln ${SYMB} ../lsp/dummy.c $v.c    
  60.    > $v.data
  61. done
  62.  
  63.  
  64.     
  65.  
  66.  
  67.  
  68.  
  69.             
  70.        
  71.   
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.