diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-12-14 18:04:06 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-12-14 18:04:06 +0000 |
commit | d5fbda44c32c6d9905406b074ebeccb26e263055 (patch) | |
tree | 9fde7cd6d8a52dfbffd38c28788be142697b6f80 /Src/mkmodindex.sh | |
parent | 82b1d142358a804375d2bf821ae4d1e840797dbd (diff) | |
download | zsh-d5fbda44c32c6d9905406b074ebeccb26e263055.tar.gz zsh-d5fbda44c32c6d9905406b074ebeccb26e263055.tar.xz zsh-d5fbda44c32c6d9905406b074ebeccb26e263055.zip |
zsh-workers/9046
Diffstat (limited to 'Src/mkmodindex.sh')
-rw-r--r-- | Src/mkmodindex.sh | 39 |
1 files changed, 18 insertions, 21 deletions
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 |