[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fix mkinst3.test
From: |
Ralf Wildenhues |
Subject: |
Re: fix mkinst3.test |
Date: |
Tue, 9 May 2006 08:29:05 +0200 |
User-agent: |
Mutt/1.5.11 |
* Ralf Wildenhues wrote on Wed, Apr 26, 2006 at 06:51:27PM CEST:
> OK to apply? The build path contained the string `build-power',
> and thus the test failed spuriously. I figured fiddling with
> " $* " and *\ -p\ * was ugly as well (and error-prone if you
> allow spaces in directory names!), so I chose to rather do it
> The Right Way[tm].
There's an even worse glitch in mkinst3 (but luckily only in that test).
If PATH contains '.' before the directory where the real mkdir is, this
test loops forever (we can reasonably assume that `pwd`/bin is not in
the PATH). Updated patch to fix both issues below.
OK?
Cheers,
Ralf
* tests/mkinst3.test: Fix `mkdir' wrapper to not be confused
if ``pwd`' contains the string `-p'. Create the wrapper in a
subdirectory so that `.' in $PATH does not lead to an endless
loop.
Index: tests/mkinst3.test
===================================================================
RCS file: /cvs/automake/automake/tests/mkinst3.test,v
retrieving revision 1.1
diff -u -r1.1 mkinst3.test
--- tests/mkinst3.test 29 Jun 2005 21:08:19 -0000 1.1
+++ tests/mkinst3.test 9 May 2006 06:26:49 -0000
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
@@ -39,20 +39,24 @@
# Trick mkinstalldirs into thinking mkdir does not support -p.
-cat >mkdir <<'EOF'
+mkdir bin
+cat >bin/mkdir <<'EOF'
#!/bin/sh
-case "$*" in
- *-p*) exit 1;;
-esac
+for arg
+do
+ case $arg in
+ -p) exit 1;;
+ esac
+done
PATH=$AM_PATH
export PATH
exec mkdir "$@"
EOF
-chmod +x mkdir
+chmod +x bin/mkdir
AM_PATH=$PATH
export AM_PATH
-PATH=`pwd`:$PATH
+PATH=`pwd`/bin:$PATH
export PATH
# Test mkinstalldirs without mkdir -p.
- Re: fix mkinst3.test,
Ralf Wildenhues <=