+2005-01-09 Bruno Haible <bruno@clisp.org>
+
+ * csharpcomp.sh.in (func_tmpdir): New function.
+ (mcs invocation): Use it. Fix exit code.
+
2005-01-07 Bruno Haible <bruno@clisp.org>
* csharpcomp.c: Include safe-read.h.
+2005-01-09 Bruno Haible <bruno@clisp.org>
+
+ * autopoint.in (func_tmpdir): New function.
+ (func_find_curr_installdir): Use it.
+ (mismatchfile): Create inside a temporary directory. Remove afterwards.
+ * gettextize.in (func_tmpdir): New function.
+ (func_find_curr_installdir): Use it.
+ Reported by Joey Hess <joeyh@debian.org>.
+
2005-01-05 Bruno Haible <bruno@clisp.org>
* autopoint.in: Update year in --version output.
prefix="@prefix@"
gettext_dir="@datadir@/gettext"
+# func_tmpdir
+# creates a temporary directory.
+# Sets variable
+# - tmp pathname of freshly created temporary directory
+func_tmpdir ()
+{
+ # Use the environment variable TMPDIR, falling back to /tmp. This allows
+ # users to specify a different temporary directory, for example, if their
+ # /tmp is filled up or too small.
+ : ${TMPDIR=/tmp}
+ {
+ # Use the mktemp program if available. If not available, hide the error
+ # message.
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+ } ||
+ {
+ # Use a simple mkdir command. It is guaranteed to fail if the directory
+ # already exists. $RANDOM is bash specific and expands to empty in shells
+ # other than bash, ksh and zsh. Its use does not increase security;
+ # rather, it minimizes the probability of failure in a very cluttered /tmp
+ # directory.
+ tmp=$TMPDIR/gt$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+ } ||
+ {
+ echo "$0: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+ }
+}
+
# Support for relocatability.
func_find_curr_installdir ()
{
*/* | *\\*) ;;
*) # Need to look in the PATH.
if test "${PATH_SEPARATOR+set}" != set; then
- { echo "#! /bin/sh"; echo "exit 0"; } > /tmp/conf$$.sh
- chmod +x /tmp/conf$$.sh
- if (PATH="/nonexistent;/tmp"; conf$$.sh) >/dev/null 2>&1; then
+ func_tmpdir
+ { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
+ chmod +x "$tmp"/conf.sh
+ if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
- rm -f /tmp/conf$$.sh
+ rm -f "$tmp"
fi
save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
for dir in $PATH; do
# original - too great risk of version mismatch.
if test -z "$force"; then
mismatch=
- mismatchfile="${TMPDIR-/tmp}"/autopoint$$.diff
- rm -f "$mismatchfile"
+ func_tmpdir
+ mismatchfile="$tmp"/autopoint.diff
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
func_destfile "$file"
if test -n "$destfile"; then
rm -rf "$cvs_dir" "$work_dir"
func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'."
fi
+ rm -rf "$tmp"
fi
# func_mkdir_for to
prefix="@prefix@"
gettext_dir="@datadir@/gettext"
+# func_tmpdir
+# creates a temporary directory.
+# Sets variable
+# - tmp pathname of freshly created temporary directory
+func_tmpdir ()
+{
+ # Use the environment variable TMPDIR, falling back to /tmp. This allows
+ # users to specify a different temporary directory, for example, if their
+ # /tmp is filled up or too small.
+ : ${TMPDIR=/tmp}
+ {
+ # Use the mktemp program if available. If not available, hide the error
+ # message.
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+ } ||
+ {
+ # Use a simple mkdir command. It is guaranteed to fail if the directory
+ # already exists. $RANDOM is bash specific and expands to empty in shells
+ # other than bash, ksh and zsh. Its use does not increase security;
+ # rather, it minimizes the probability of failure in a very cluttered /tmp
+ # directory.
+ tmp=$TMPDIR/gt$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+ } ||
+ {
+ echo "$0: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+ }
+}
+
# Support for relocatability.
func_find_curr_installdir ()
{
*/* | *\\*) ;;
*) # Need to look in the PATH.
if test "${PATH_SEPARATOR+set}" != set; then
- { echo "#! /bin/sh"; echo "exit 0"; } > /tmp/conf$$.sh
- chmod +x /tmp/conf$$.sh
- if (PATH="/nonexistent;/tmp"; conf$$.sh) >/dev/null 2>&1; then
+ func_tmpdir
+ { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
+ chmod +x "$tmp"/conf.sh
+ if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
- rm -f /tmp/conf$$.sh
+ rm -f "$tmp"
fi
save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
for dir in $PATH; do