From 732bb6aeff9342cb976d2fc078494d99661b6dc2 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Wed, 23 Oct 2002 13:41:25 +0000 Subject: [PATCH] =?utf8?q?For=20Andr=EF=BF=BD's=20pleasure...?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5480 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/ChangeLog | 7 ++++ development/tools/mkdoclinks.sh | 70 +++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 development/tools/mkdoclinks.sh diff --git a/development/ChangeLog b/development/ChangeLog index 97e2f2fc89..66c03f0200 100644 --- a/development/ChangeLog +++ b/development/ChangeLog @@ -1,3 +1,10 @@ +2002-10-23 Angus Leeming + + * tools/mkdoclinks.sh: new file. Run in /lib/doc to + generate symbolic links from that dir to whereever the LyX + documentation is to be found. This enables a non-installed LyX + to find these docs. + 2002-08-23 Rob Lahaye * FORMAT: explain changes with new graphics dialog diff --git a/development/tools/mkdoclinks.sh b/development/tools/mkdoclinks.sh new file mode 100644 index 0000000000..49b3e1f669 --- /dev/null +++ b/development/tools/mkdoclinks.sh @@ -0,0 +1,70 @@ +#! /bin/sh + +# This script makes a bunch of symbolic links from the current directory +# to the one containing the LyX documentation. + +USAGE () { + echo Usage: $0 dir_where_the_docs_are_found + exit 1 +} + +if [ $# -ne 1 ]; then + USAGE +fi + +DIR=$1 + +if [ ! -d ${DIR} ]; then + USAGE +fi + +FILES=`ls ${DIR}/*.*` + +N_LYXFILES=`echo "${FILES}" | grep ".lyx" | wc -l` + +if [ ${N_LYXFILES} -eq 0 ]; then + echo ${DIR} contains NO lyx files! + exit 1 +fi + +EXAMPLE_FILE=`echo "${FILES}" | grep ".lyx" | sed -e '2,$d'` +PARSABLEDIR=`echo ${DIR} | sed 's/\//\\\\\//g'` +EXAMPLE_FILE=`echo ${EXAMPLE_FILE} | sed "s/${PARSABLEDIR}\///"` + +echo ${DIR} contains ${N_LYXFILES} .lyx files, an example being ${EXAMPLE_FILE} +echo +echo "Would you like to generate links to the files in this dir? (Y/N) >N<" +read ANSWER + +if [ "${ANSWER}" != "y" -a "${ANSWER}" != "Y" ]; then + exit 0 +fi + +echo +echo "Would you like these file names in the .cvsignore file? (Y/N) >N<" +read ANSWER + +CVSIGNORE=0 +if [ "${ANSWER}" = "y" -o "${ANSWER}" = "Y" ]; then + CVSIGNORE=1 +fi + +# Keep the original .cvsignore file safe +if [ ${CVSIGNORE} -eq 1 ]; then + if [ -r .cvsignore ]; then + if [ -r .cvsignore-safe ]; then + cp .cvsignore-safe .cvsignore + else + cp .cvsignore .cvsignore-safe + fi + fi + echo .cvsignore-safe > .cvsignore + echo '*.lyx' >> .cvsignore + echo '*.eps' >> .cvsignore +fi + +for FILE in ${FILES} +do + DESTFILE=`echo ${FILE} | sed "s/${PARSABLEDIR}\///"` + ln -fs ${FILE} ${DESTFILE} +done -- 2.39.5