From patchwork Fri Jun 3 16:10:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1734 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:55:08 -0000 Delivered-To: patches@linaro.org Received: by 10.52.181.10 with SMTP id ds10cs24413vdc; Fri, 3 Jun 2011 09:10:45 -0700 (PDT) Received: by 10.227.200.198 with SMTP id ex6mr2162764wbb.2.1307117444140; Fri, 03 Jun 2011 09:10:44 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id e29si3547468wek.124.2011.06.03.09.10.43 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Jun 2011 09:10:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QSWxM-0004rK-Ne; Fri, 03 Jun 2011 17:10:40 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini , Stefan Weil Subject: [PATCH v3] configure: Don't create symlinks to nonexistent targets Date: Fri, 3 Jun 2011 17:10:40 +0100 Message-Id: <1307117440-18655-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 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 --- v1->v2: remove debug printing v2->v3: don't use test constructs marked by POSIX as obsolete, as pointed out by Paolo Bonzini configure | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/configure b/configure index a318d37..7f8ad24 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" ] && ! [ -e "$f" ]; then + symlink "$source_path/$f" "$f" + fi done # temporary config to build submodules