From cda9ff0e90d215985bab6191c9e09c97409be0fe Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 12 Jan 2005 17:18:16 +0000 Subject: [PATCH] some simple fixes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@9470 a592a061-630c-0410-9148-cb99ea01b6c8 --- config/ChangeLog | 9 ++++ config/lyxinclude.m4 | 2 +- config/mkinstalldirs | 107 +++++++++++++++++++++++++++++++++----- config/relyx_configure.ac | 2 + config/relyx_configure.in | 2 + lib/ChangeLog | 6 +++ lib/configure.m4 | 2 +- 7 files changed, 114 insertions(+), 16 deletions(-) diff --git a/config/ChangeLog b/config/ChangeLog index 42016f1fc3..d0911a561a 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,12 @@ +2005-01-12 Jean-Marc Lasgouttes + + * mkinstalldirs: take a newer version from HEAD. + + * relyx_configure.in: + * relyx_configure.ac: make sure the prefix is correctly quoted. + + * lyxinclude.m4: fix default win32 prefix. + 2005-01-06 Jean-Marc Lasgouttes * configure.ac: diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 4fe50d74b6..81757ada70 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -678,7 +678,7 @@ case $lyx_use_packaging in datadir='${prefix}/Contents/Resources' mandir='${prefix}/Contents/Resources/man' ;; windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout]) - default_prefix="'C:Program Files/LyX'" + default_prefix="'C:/Program Files/LyX'" bindir='${prefix}/bin' datadir='${prefix}/Resources' mandir='${prefix}/Resources/man' ;; diff --git a/config/mkinstalldirs b/config/mkinstalldirs index cd1fe0a794..d2d5f21b61 100755 --- a/config/mkinstalldirs +++ b/config/mkinstalldirs @@ -5,28 +5,107 @@ # Public domain errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift + if test -d "$file"; then + shift + else + break + fi +done - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac +case $# in + 0) exit 0 ;; +esac - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" || errstatus=$? - fi +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac - pathcomp="$pathcomp/" - done +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done done exit $errstatus +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: # mkinstalldirs ends here diff --git a/config/relyx_configure.ac b/config/relyx_configure.ac index dcc4fe9f65..880bb6399e 100644 --- a/config/relyx_configure.ac +++ b/config/relyx_configure.ac @@ -24,6 +24,8 @@ test -x reLyX && rm -f reLyX # fix the value of the prefixes. test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# make sure prefix is correctly quoted +prefix="'$prefix'" # we need to expand ${datadir} to put it into the reLyX wrapper. LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"` diff --git a/config/relyx_configure.in b/config/relyx_configure.in index d3f9cc5acb..858988c61b 100644 --- a/config/relyx_configure.in +++ b/config/relyx_configure.in @@ -24,6 +24,8 @@ test -x reLyX && rm -f reLyX # fix the value of the prefixes. test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# make sure prefix is correctly quoted +prefix="'$prefix'" # we need to expand ${datadir} to put it into the reLyX wrapper. LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"` diff --git a/lib/ChangeLog b/lib/ChangeLog index 98e91b8034..0982680089 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2005-01-12 Jean-Marc Lasgouttes + + * reLyX/configure.ac: make sure the prefix is correctly quoted. + + * configure.m4: small visual fix to the search for groff. + 2005-01-06 Angus Leeming * Makefile.am: remove mention of configure.cmd. diff --git a/lib/configure.m4 b/lib/configure.m4 index 2f74396cb5..c663c81018 100644 --- a/lib/configure.m4 +++ b/lib/configure.m4 @@ -285,7 +285,7 @@ lyxpreview_to_bitmap_command="lyxpreview2ppm.py" # Search a *roff program (used to translate tables in ASCII export) LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl - 'groff -t -Tlatin1 $$FName' nroff,dnl + "groff -t -Tlatin1 \$\$FName" nroff,dnl test "$prog" = "nroff" && prog='tbl $$FName | nroff') # Search the ChkTeX program