25 lines
590 B
Text
25 lines
590 B
Text
|
|
. ./redoconf.rc
|
||
|
|
|
||
|
|
# this is called by each call to replaceln() and appendln().
|
||
|
|
RC_KEYS="RC_KEYS"
|
||
|
|
rc_hook() {
|
||
|
|
contains_line "$RC_KEYS" "$1" || RC_KEYS="$RC_KEYS$NL$1"
|
||
|
|
}
|
||
|
|
rc_include _all.rc
|
||
|
|
|
||
|
|
# Escape double-quote and backslash so they can
|
||
|
|
# be included as a C-style double-quoted string.
|
||
|
|
cquote() {
|
||
|
|
local v="$(xecho "$1" | sed -e 's,[\"\\],\\&,g' -e 's,$, \\,')"
|
||
|
|
printf '"%s"' "${v% \\}"
|
||
|
|
}
|
||
|
|
|
||
|
|
(
|
||
|
|
echo "# Automatically generated by autovars.od"
|
||
|
|
for k in $(echo "$RC_KEYS" | sort); do
|
||
|
|
[ "$k" != "RC_INCLUDES" ] || continue
|
||
|
|
eval v=\$$k
|
||
|
|
echo "$k=$(shquote "$v")"
|
||
|
|
done
|
||
|
|
) >$3
|
||
|
|
redo-stamp <$3
|