Ignore:
Timestamp:
2010-10-11T10:34:38+13:00 (13 years ago)
Author:
sjm84
Message:

Added makedist, installclean and help functionality to cascade-lib.bash. installclean still needs a minor fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/cascade-make/trunk/lib/cascade-lib.bash

    r22249 r23077  
    8888}
    8989
     90toplevel_make_dist()
     91{
     92  local currentdir=$1
     93
     94  local dirname=`basename $currentdir`
     95
     96  local checklist="setup.bash setup.bat perllib $GSDLOS lib"   
     97  local distlist=""
     98
     99  for d in $checklist ; do
     100    if [ -e $d ] ; then
     101      distlist="$distlist $dirname/$d"
     102    fi
     103  done
     104
     105  pushd ..
     106   
     107  tar cvzf $dirname-$GSDLOS.tar.gz $distlist
     108  mv $dirname-$GSDLOS.tar.gz $dirname/.
     109
     110  popd
     111}
     112
     113opt_make_dist()
     114{
     115  local type=$1
     116
     117  if [ $type = "1" ] ; then
     118
     119    if [ -f MAKE-DIST.sh ] ; then
     120      ./MAKE-DIST.sh
     121    else
     122      toplevel_make_dist `pwd`
     123    fi
     124  fi
     125}
     126
    90127opt_run_untar()
    91128{
     
    164201
    165202
     203run_installclean()
     204{
     205  local fulldir="`pwd`/$GSDLOS"
     206  read -p "Delete $fulldir [y/n]?" ans
     207  if [ $ans = "y" ] ; then
     208    /bin/rm -rf "$fulldir"
     209  fi
     210
     211  exit 0
     212}
     213
     214
     215print_usage()
     216{
     217  echo "$0 [untar|configure|comiple|install|clean|distclean|tarclean|makedist]+"
     218  echo "  or"
     219  echo "$0 [installclean|help]"
     220  exit 0
     221}
     222
    166223force_untar=0
    167224auto_untar=0
     
    175232distclean=0
    176233tarclean=0
     234makedist=0
    177235
    178236if [ $# -gt 0 ] ; then
    179237  for cmd in $* ; do
    180238    echo $cmd
    181     if   [ $cmd = "untar" ] ;     then force_untar=1
    182     elif [ $cmd = "configure" ] ; then force_config=1
    183     elif [ $cmd = "compile" ]   ; then compile=1
    184     elif [ $cmd = "install" ]   ; then install=1 
    185     elif [ $cmd = "clean" ]     ; then clean=1 
    186     elif [ $cmd = "distclean" ] ; then distclean=1
    187     elif [ $cmd = "tarclean" ] ;  then tarclean=1
     239    if   [ $cmd = "untar" ]        ; then force_untar=1
     240    elif [ $cmd = "configure" ]    ; then force_config=1
     241    elif [ $cmd = "compile" ]      ; then compile=1
     242    elif [ $cmd = "install" ]      ; then install=1 
     243    elif [ $cmd = "clean" ]        ; then clean=1 
     244    elif [ $cmd = "distclean" ]    ; then distclean=1
     245    elif [ $cmd = "tarclean" ]     ; then tarclean=1
     246    elif [ $cmd = "makedist" ]     ; then makedist=1
     247
     248    elif [ $cmd = "installclean" ] ; then run_installclean
     249    elif [ $cmd = "help" ]         ; then print_usage
    188250    fi
    189251  done
     
    197259  distclean=0
    198260  tarclean=0
     261  makedist=0
    199262fi
    200263
     
    205268
    206269fi
    207 
Note: See TracChangeset for help on using the changeset viewer.