~timrchavez/live-build/lb-sg-2.x-add-suppport-for-pxz

« back to all changes in this revision

Viewing changes to helpers/lh

  • Committer: Daniel Baumann
  • Date: 2011-03-09 18:17:15 UTC
  • Revision ID: daniel@debian.org-20110309181715-2s6s9tqa8xup5aep
Rearranging helpers scripts in source tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
# lh(1) - generic live-helper wrapper
4
 
# Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
5
 
#
6
 
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7
 
# This is free software, and you are welcome to redistribute it
8
 
# under certain conditions; see COPYING for details.
9
 
 
10
 
set -e
11
 
 
12
 
# Including common functions
13
 
. "${LH_BASE:-/usr/share/live-helper}"/live-helper.sh
14
 
 
15
 
# Setting static variables
16
 
DESCRIPTION="$(Echo 'utility to build Debian Live systems')"
17
 
HELP="FIXME"
18
 
USAGE="FIXME"
19
 
 
20
 
case "${1}" in
21
 
        -h|--help)
22
 
                if [ -x "$(which man 2>/dev/null)" ]
23
 
                then
24
 
                        man lh
25
 
                        exit 0
26
 
                else
27
 
                        ${0} --usage
28
 
                        exit 0
29
 
                fi
30
 
                ;;
31
 
 
32
 
        ""|-u|--usage)
33
 
                Usage
34
 
                ;;
35
 
 
36
 
        -v|--version)
37
 
                Version
38
 
                ;;
39
 
 
40
 
        *)
41
 
                COMMAND="${1}"
42
 
                shift
43
 
 
44
 
                if [ -x "${LH_BASE}/helpers/${COMMAND}" ]
45
 
                then
46
 
                        LH=1 exec "${LH_BASE}/helpers/${COMMAND}" "${@}"
47
 
                elif [ -x /usr/share/live-helper/helpers/${COMMAND} ]
48
 
                then
49
 
                        LH=1 exec /usr/share/live-helper/helpers/"${COMMAND}" "${@}"
50
 
                elif [ -x "$(which ${COMMAND} 2>/dev/null)" ]
51
 
                then
52
 
                        LH=1 exec "${COMMAND}" "${@}"
53
 
                else
54
 
                        Echo_error "no such helper"
55
 
                        exit 1
56
 
                fi
57
 
                ;;
58
 
esac