2006-07-27 18:20:00 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2009-01-03 22:55:04 +00:00
|
|
|
# (c)2009, Laurence Withers. Released under the GNU GPL. See file
|
2006-07-27 18:20:00 +01:00
|
|
|
# COPYING for details.
|
|
|
|
#
|
|
|
|
|
|
|
|
[ -z "${VERBOSE}" ] && VERBOSE="0"
|
|
|
|
|
|
|
|
usage() {
|
|
|
|
echo "Installs project maintainer symlinks into a checked-out"
|
|
|
|
echo "lw-build-system project."
|
|
|
|
echo " Usage: $0 [path/to/proj/root]"
|
|
|
|
echo " uses current directory if none specified."
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$#" in
|
|
|
|
0)
|
|
|
|
if [ ! -e make.sh -o ! -d scripts ]
|
|
|
|
then
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
PROJECT_ROOT=$(pwd)
|
|
|
|
cd $(dirname $0) || exit 1
|
|
|
|
SCRIPT_ROOT=$(pwd)
|
|
|
|
;;
|
|
|
|
|
|
|
|
1)
|
|
|
|
last=$(pwd)
|
|
|
|
cd $(dirname $0) || exit 1
|
|
|
|
SCRIPT_ROOT=$(pwd)
|
|
|
|
cd ${last} || exit 1
|
|
|
|
cd $1 || exit 1
|
|
|
|
if [ ! -e make.sh -o ! -d scripts ]
|
|
|
|
then
|
|
|
|
echo "Can't find $(pwd)/make.sh or $(pwd)/scripts"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
PROJECT_ROOT=$(pwd)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-04-06 15:13:06 +01:00
|
|
|
source "${SCRIPT_ROOT}/skel/scripts/functions.sh" || exit 1
|
2006-07-27 18:20:00 +01:00
|
|
|
|
|
|
|
cd ${PROJECT_ROOT}
|
|
|
|
if [ -L scripts/module-create.sh ]
|
|
|
|
then
|
|
|
|
print_failure "It looks as though symlinks are already installed."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Installing symlinks"
|
|
|
|
echo " ${SCRIPT_ROOT}/scripts/ -> ${PROJECT_ROOT}/scripts/"
|
|
|
|
do_cmd ln -s ${SCRIPT_ROOT}/scripts/* scripts/ || exit 1
|
|
|
|
print_success "Done"
|
|
|
|
|
|
|
|
# kate: replace-trailing-space-save true; space-indent true; tab-width 4;
|
|
|
|
# vim: expandtab:ts=4:sw=4
|