You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.1 KiB
73 lines
2.1 KiB
18 years ago
|
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
|
||
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
|
||
|
#
|
||
18 years ago
|
# Filename: package/.../uclibc/conffiles-functions.in
|
||
|
# Copyright (C) 2006 - 2007 The OpenSDE Project
|
||
18 years ago
|
# Copyright (C) 2004 - 2006 The T2 SDE Project
|
||
|
#
|
||
|
# More information can be found in the files COPYING and README.
|
||
|
#
|
||
|
# This program is free software; you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation; version 2 of the License. A copy of the
|
||
|
# GNU General Public License can be found in the file COPYING.
|
||
|
# --- SDE-COPYRIGHT-NOTE-END ---
|
||
|
|
||
|
# $conffiles is a list of patters of the form
|
||
|
# ^[XO-] <pattern> [<value>]
|
||
|
# X means enable, O disable, and - removes it
|
||
|
# pattern can use '*' as a wildcard for [^ #]
|
||
|
# optionaly can set a value different that y
|
||
18 years ago
|
conffiles_apply() {
|
||
18 years ago
|
local file= rule=
|
||
|
local action= prerule= value= x=
|
||
|
|
||
|
if [ ! -f $builddir/config.sed ]; then
|
||
|
for file in $conffiles $extraconffiles; do if [ -f "$file" ]; then
|
||
|
sed -e '/^[ \t]*$/d;' -e '/^[ \t]*#.*/d;' "$file" |
|
||
|
while read action prerule value x; do
|
||
|
rule="$(echo $prerule | sed 's/\*/[^ #]*/')"
|
||
|
rule="^\(# \)\?\($rule\)[= ].*\$"
|
||
|
|
||
|
if [ -z "$value" ]; then
|
||
|
value='y'
|
||
|
fi
|
||
|
case "$action" in
|
||
|
X) echo "apply_conffiles: rule $prerule=$value."
|
||
|
echo "s,$rule,\2=$value,g" >> $builddir/config.sed
|
||
|
;;
|
||
|
O) echo "apply_conffiles: rule unset $prerule."
|
||
|
echo "s,$rule,# \2 is not set,g" >> $builddir/config.sed
|
||
|
;;
|
||
|
-) echo "apply_conffiles: rule remove $prerule."
|
||
|
echo "s,$rule,,g" >> $builddir/config.sed
|
||
|
;;
|
||
|
*)
|
||
|
abort "apply_conffiles: bad rule $action $prerule $value"
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
fi ; done
|
||
|
fi
|
||
18 years ago
|
sed -f $builddir/config.sed .config
|
||
18 years ago
|
}
|
||
|
|
||
|
# get default config, and filter considering <n>
|
||
|
# levels, because new options can appear and other disappear
|
||
18 years ago
|
conffiles_loop() {
|
||
|
local loops="${1:-1}"
|
||
|
shift
|
||
18 years ago
|
|
||
18 years ago
|
cp -v .config .config.1
|
||
18 years ago
|
|
||
18 years ago
|
j=2 ; for (( i=1 ; i<loops ; i++, j++ )) {
|
||
|
conffiles_apply > .config.$j
|
||
18 years ago
|
cp -v .config.$j .config
|
||
|
|
||
18 years ago
|
eval $MAKE "$@" oldconfig
|
||
18 years ago
|
|
||
|
(( j++ )) ; cp -v .config .config.$j
|
||
|
}
|
||
|
}
|
||
|
|