source: live-build/trunk/fuentes/functions/conffile.sh @ 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.2 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
11Get_conffiles ()
12{
13        if [ -n "${LB_CONFIG}" ]
14        then
15                FILES="${LB_CONFIG}"
16        else
17                for FILE in ${@}
18                do
19                        FILES="${FILES} ${FILE} ${FILE}.${LB_ARCHITECTURES} ${FILE}.${DISTRIBUTION}"
20                        FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||')"
21                        FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||').${ARCHITECTURE}"
22                        FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||').${DISTRIBUTION}"
23                done
24        fi
25
26        echo ${FILES}
27}
28
29Read_conffiles ()
30{
31        for CONFFILE in Get_conffiles "${@}"
32        do
33                if [ -f "${CONFFILE}" ]
34                then
35                        if [ -r "${CONFFILE}" ]
36                        then
37                                Echo_debug "Reading configuration file %s" "${CONFFILE}"
38                                . "${CONFFILE}"
39                        else
40                                Echo_warning "Failed to read configuration file %s" "${CONFFILE}"
41                        fi
42                fi
43        done
44}
45
46Print_conffiles ()
47{
48        for CONFFILE in Get_conffiles "${@}"
49        do
50                if [ -f "${CONFFILE}" ]
51                then
52                        Echo_file "${CONFFILE}"
53                fi
54        done
55}
Note: See TracBrowser for help on using the repository browser.