From 02c0df21747e5795197510f15da73bd0c287e978 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 16 Dec 1999 14:26:16 +0000 Subject: manual/9083 --- Src/mkmodindex.sh | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'Src/mkmodindex.sh') diff --git a/Src/mkmodindex.sh b/Src/mkmodindex.sh index b4616f638..75a7e43bc 100644 --- a/Src/mkmodindex.sh +++ b/Src/mkmodindex.sh @@ -13,28 +13,25 @@ while test $# -ne 0; do dir=$1 shift ( set $dir/*.mdd; test -f $1 ) || continue - dosubs=false - for mod in `echo '' $dir/*.mdd '' | sed 's, [^ ]*/, ,g;s,\.mdd , ,g'`; do - case `echo "$mod@ $module_list " | sed 's,^.*[^_0-9A-Za-z].*@,@@,'` in - @@*) - echo >&2 "WARNING: illegally named module \`$mod' in $dir" - echo >&2 " (ignoring it)" - ;; - *@*" $mod "*) - eval "loc=\$loc_$mod" - echo >&2 "WARNING: module \`$mod' (in $loc) duplicated in $dir" - echo >&2 " (ignoring duplicate)" - dosubs=true - ;; - *) - module_list="$module_list$mod " - echo "loc_$mod=$dir" - eval "loc_$mod=\$dir" - dosubs=true - ;; - esac + for modfile in $dir/*.mdd; do + name=`( . $modfile; echo $name )` + case "$name" in *[!/_0-9A-Za-z]* | /* | */ | *//*) + echo >&2 "WARNING: illegally named module \`$name' in $modfile" + echo >&2 " (ignoring it)" + continue + ;; esac + q_name=`echo $name | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'` + case " $module_list " in *" $name "*) + eval "omodfile=\$modfile_$q_name" + echo >&2 "WARNING: module \`$name' (in $omodfile) duplicated in $modfile" + echo >&2 " (ignoring duplicate)" + continue + ;; esac + module_list="$module_list$name " + echo "modfile_$q_name=$modfile" + eval "modfile_$q_name=\$modfile" done - $dosubs && set `echo $dir/*/. '' | sed 's,/\. , ,g'` "$@" + set `echo $dir/*/. '' | sed 's,/\. , ,g'` "$@" done echo -- cgit 1.4.1