diff mbox

[v2] configure: Don't create symlinks to nonexistent targets

Message ID 1306344617-1645-1-git-send-email-peter.maydell@linaro.org
State Superseded
Headers show

Commit Message

Peter Maydell May 25, 2011, 5:30 p.m. UTC
When we create the symlinks to source tree files, don't create them
if the file is not actually present in the source tree; this will
happen if the file is in a git submodule that wasn't checked out.

This also avoids the odd effect where an in-source-tree configure
will end up creating the missing file as a symlink to itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
v2: Remove the debug printing. Oops.

 configure |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Paolo Bonzini May 25, 2011, 8:05 p.m. UTC | #1
On 05/25/2011 07:49 PM, Stefan Weil wrote:
>
> + if [ -e "$source_path/$f" -a ! -e "$f" ]; then
> + symlink "$source_path/$f" "$f"
> + fi

Please use && instead of -a, and "! [" instead of "[ !".

Paolo
diff mbox

Patch

diff --git a/configure b/configure
index a318d37..a648f3d 100755
--- a/configure
+++ b/configure
@@ -3564,7 +3564,9 @@  for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.rom $source_p
 done
 mkdir -p $DIRS
 for f in $FILES ; do
-    test -e $f || symlink $source_path/$f $f
+    if [ -e "$source_path/$f" -a ! -e "$f" ]; then
+        symlink "$source_path/$f" "$f"
+    fi
 done
 
 # temporary config to build submodules