Refactor out file merge function

This commit is contained in:
Travis Cross 2013-11-19 21:06:41 +00:00
parent 714eb245fd
commit 75481f6398
1 changed files with 13 additions and 8 deletions

21
debian/bootstrap.sh vendored
View File

@ -1142,6 +1142,18 @@ set_modules_non_dfsg () {
done
}
conf_merge () {
local of="$1" if="$2"
if [ -s $if ]; then
grep -v '^##\|^$' $if | while xread x; do
touch $of
if ! grep -e "$x" $of >/dev/null; then
printf '%s\n' "$x" >> $of
fi
done
fi
}
codename="sid"
modulelist_opt=""
while getopts "c:m:" o; do
@ -1194,14 +1206,7 @@ map_modules "mod_filter" \
echo "Generating debian/ (-all package)..." >&2
grep -e '^Package:' control | grep -v '^freeswitch-all$' | while xread l; do
m="${l#*: }"
f=$m.install
if [ -s $f ]; then
grep -v '^##\|^$' $f | while xread x; do
if ! grep -e "$x" freeswitch-all.install >/dev/null; then
printf '%s\n' "$x" >> freeswitch-all.install
fi
done
fi
conf_merge freeswitch-all.install $m.install
done
for x in postinst postrm preinst prerm; do
cp -a freeswitch.$x freeswitch-all.$x