2006-07-27 18:20:00 +01:00
|
|
|
|
#!/bin/bash
|
2010-11-25 15:32:52 +00:00
|
|
|
|
#
|
|
|
|
|
# Copyright: ©2006–2010, Laurence Withers.
|
|
|
|
|
# Author: Laurence Withers <l@lwithers.me.uk>
|
|
|
|
|
# License: GPLv3
|
2006-07-27 18:20:00 +01:00
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
[ -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"
|
|
|
|
|
|
|
|
|
|
# vim: expandtab:ts=4:sw=4
|