source: live-build/trunk/fuentes/bin/lb @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program 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
11set -e
12
13# Including common functions
14( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
15
16# Setting static variables
17DESCRIPTION="$(Echo 'utility to build Debian Live systems')"
18HELP="FIXME"
19USAGE="FIXME"
20
21case "${1}" in
22        -h|--help)
23                if [ -x "$(which man 2>/dev/null)" ]
24                then
25                        man lb
26                        exit 0
27                else
28                        ${0} --usage
29                        exit 0
30                fi
31                ;;
32
33        ""|-u|--usage)
34                Usage
35                ;;
36
37        -v|--version)
38                echo "${VERSION}"
39                exit 0
40                ;;
41
42        *)
43                COMMAND="lb_${1}"
44                shift
45
46                ENV=""
47
48                for _FILE in config/environment config/environment.binary
49                do
50                        if [ -e "${_FILE}" ]
51                        then
52                                ENV="${ENV} $(grep -v '^#' ${_FILE})"
53                        fi
54                done
55
56                if [ -x "${LIVE_BUILD}/scripts/build/${COMMAND}" ]
57                then
58                        SCRIPT="${LIVE_BUILD}/scripts/build/${COMMAND}"
59                elif [ -x /usr/lib/live/build/${COMMAND} ]
60                then
61                        SCRIPT=/usr/lib/live/build/"${COMMAND}"
62                elif [ -x "$(which ${COMMAND} 2>/dev/null)" ]
63                then
64                        SCRIPT="${COMMAND}"
65                else
66                        Echo_error "no such script: ${COMMAND}"
67                        exit 1
68                fi
69
70                Echo "[%s] %s" "$(date +'%F %T')" "${COMMAND} ${*}"
71                LB=1 ${ENV} exec "${SCRIPT}" "${@}"
72                ;;
73esac
Note: See TracBrowser for help on using the repository browser.