]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tools/config-gen-functions.sh
kill: add missing ifdefs
[thirdparty/util-linux.git] / tools / config-gen-functions.sh
CommitLineData
9221fb85 1#
2bb3aa36 2# Copyright (C) 2011 Karel Zak <kzak@redhat.com>
9221fb85
KZ
3#
4
5
6# Returns configure options from selected config file
7#
8# ul_get_configuration <config-file>
9#
10# for example
11#
12# ul_get_configuration $top_srcdir/tools/config-gen.d/all
13#
83134551 14ul_get_configuration() {
9221fb85
KZ
15 local conf="$1"
16 local dir=$(dirname $1)
17 local opts=$(cat $conf)
18 local old_opts=
19
20 while [ "$opts" != "$old_opts" ]; do
21 local new_opts=
22
23 old_opts="$opts"
24 for citem in $opts; do
25 case $citem in
26 include:*) new_opts="$new_opts $(cat $dir/${citem##*:})" ;;
27 *) new_opts="$new_opts $citem" ;;
28 esac
29 done
30 opts="$new_opts"
31 done
32 echo $opts | tr " " "\n" | sort -u
33}