#!/bin/sh

# NOTE: this script is special: it cannot rely on anything else
# and has to setup the environment for the others

# CWD==TOP of Tree

# install the script files

set -e
MLBUILD=cache/build/mlbuild-0.2

case "$1$2" in
bootstrap )
        mkdir -p cache/scripts etc
        cp $MLBUILD/scripts/* cache/scripts
        chmod 555 cache/scripts/*
        for i in $MLBUILD/etc/*
        do
                n=`basename $i`
                cp $i etc/$n.default
                if [ ! -f etc/$n ] ; then cp $i etc/$n ; fi
        done
        ;;

*installconfig)
        ml_findfiles
        ml_installconfig
        exit 0
        ;;

*)      exit 0
        ;;

esac



