live-build/helpers/lh
Tzafrir Cohen 7f1599d218 For lh_local, checking first for helpers in LH_BASE.
lh_local sets PATH and LH_BASE. However the live-helper wrapper script
looks for helper script in the system path (/usr/share/live-helper/helpers)
before looking for them in the PATH.

This patch thus instructs lh to first adds test under LH_BASE, if set.
2010-02-01 12:36:00 +01:00

52 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# lh(1) - generic live-helper wrapper
# Copyright (C) 2006-2009 Daniel Baumann <daniel@debian.org>
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.
set -e
# Including common functions
. "${LH_BASE:-/usr/share/live-helper}"/live-helper.sh
# Setting static variables
DESCRIPTION="$(Echo 'utility to build Debian Live systems')"
HELP="FIXME"
USAGE="FIXME"
case "${1}" in
-h|--help)
Man
;;
""|-u|--usage)
Usage
;;
-v|--version)
Version
;;
*)
COMMAND="${1}"
shift
if [ -x "${LH_BASE}/helpers/lh_${COMMAND}" ]
then
LH=1 exec "${LH_BASE}/helpers/lh_${COMMAND}" "${@}"
elif [ -x /usr/share/live-helper/helpers/lh_${COMMAND} ]
then
LH=1 exec /usr/share/live-helper/helpers/lh_"${COMMAND}" "${@}"
elif [ -x "$(which lh_${COMMAND} 2>/dev/null)" ]
then
LH=1 exec lh_"${COMMAND}" "${@}"
else
Echo_error "no such helper"
exit 1
fi
;;
esac