This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: /usr/share/* and FHS


Christopher Faylor wrote:

That would create two dir files.

Let me rephrase what I said:

I don't know if info will do the right thing with two dir files
or not.

Well, the following works for me -- all stuff goes into /usr/info/dir, including info files in /usr/info and /usr/share/info. It's relatively "futureproof" regardless of how the default searchdir for info.exe is changed. But, you naturally need to have both /usr/info and /usr/share/info in your INFOPATH.


--
Chuck

#!/bin/sh
# this is where the "real" dir file will go
INFO_DIRFILE_DEFAULT_DIR=/usr/info
INFO_DIRFILE_DEFAULT=${INFO_DIRFILE_DEFAULT_DIR}/dir
# these directories get symlinks
OTHER_INFO_DIRS="/usr/share/info"

# we do the "real" directory first, so that later loops don't
# step on our toes.
for dirn in ${INFO_DIRFILE_DEFAULT_DIR} ${OTHER_INFO_DIRS} ; do
    if [ ! -d ${dirn} ] ; then
	mkdir $dirn
    fi
    cd ${dirn}
    rm -f dir
    for f in *; do
	case "$f" in
	    *\**)
		;;
	    dir|dir.info*)
		;;
	    *-[0123456789]*)
		;;
	    *)
		install-info --quiet $f ${INFO_DIRFILE_DEFAULT} ||
		install-info --quiet --entry="* $$f ($f): $$f" \
			$$f ${INFO_DIRFILE_DEFAULT}
		;;
	esac
    done
done >/dev/null 2>&1

for dirn in ${OTHER_INFO_DIRS} ; do
    cd ${dirn}
    if [ -e dir ] ; then
	rm -f dir
    fi
    ln -fs ${INFO_DIRFILE_DEFAULT} dir
done >/dev/null 2>&1



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]