--- etc-update.orig Tue Mar 19 13:55:56 2002 +++ etc-update Tue Mar 19 14:38:07 2002 @@ -7,65 +7,26 @@ scriptname=`basename $0` -# edit the lines below to your liking +get_config() { + item=$1 -# arguments used whenever rm is called -rm_opts="-i" + # First strip off comment lines, then grab the configuration + # item. If there's more than one of the same configuration item, + # then allow the last setting to take precedence. + cut -d'#' -f1-1 /etc/etc-update.conf | \ + sed -ne "s/^\ *$item\ *=\ *\"\(.*\)\"/\1/p" | tail -1 +} + +# load etc-config's configuration +rm_opts=`get_config rm_opts` +mv_opts=`get_config mv_opts` +cp_opts=`get_config cp_opts` +pager=`get_config pager` +diff_command=`get_config diff_command` +merge_command=`get_config merge_command` -# arguments used whenever mv is called -mv_opts="-i" - -# arguments used whenever cp is called -cp_opts="-i" - -# pager for use with diff commands (see NOTE_2) -#pager="less -E" -pager="" - -# vim-users: you CAN use vimdiff for diff_command. (see NOTE_1) -diff_command="diff -uN %file1 %file2" -#diff_command="vim -d %file1 %file2" - -# vim-users: don't use vimdiff for merging (see NOTE_1) -merge_command="sdiff -s -o %merged %orig %new" - -# EXPLANATION -# -# pager: -# -# Examples of pager usage: -# pager="" # don't use a pager -# pager="less -E" # less -# pager="more" # more -# -# -# diff_command: -# -# Arguments: -# %file1 [REQUIRED] -# %file2 [REQUIRED] -# -# Examples of diff_command: -# diff_command="diff -uN %file1 %file2" # diff -# diff_command="vim -d %file1 %file2" # vimdiff -# -# -# merge_command: -# -# Arguments: -# %orig [REQUIRED] -# %new [REQUIRED] -# %merged [REQUIRED] -# -# Examples of merge_command: -# merge_command="sdiff -s -o %merged %old %new" # sdiff -# - -# NOTE_1: Editors such as vim/vimdiff are not usable for the merge_command -# because it is not known what filenames the produced files have (the user can -# choose while using those programs) - -# NOTE_2: Make sure pager is set to "" when using an editor as diff_command! +#echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts" +#echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command" # # Find all "new" configuration files, sort, so that ._cfg_0000 is presented