qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] configure: Don't create symlinks to nonexistent targets
@ 2011-06-03 16:10 Peter Maydell
  2011-06-22 11:45 ` Peter Maydell
  2011-06-22 12:28 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2011-06-03 16:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, patches

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>
---
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
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v3] configure: Don't create symlinks to nonexistent targets
  2011-06-03 16:10 [Qemu-devel] [PATCH v3] configure: Don't create symlinks to nonexistent targets Peter Maydell
@ 2011-06-22 11:45 ` Peter Maydell
  2011-06-22 12:28 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2011-06-22 11:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, patches

ping?

I didn't cc trivial first time round on the theory that any patch
that makes it to v3 isn't trivial, but since nobody's commented
on this version I guess it's OK...

-- PMM

On 3 June 2011 17:10, Peter Maydell <peter.maydell@linaro.org> wrote:
> 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>
> ---
> 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
> --
> 1.7.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v3] configure: Don't create symlinks to nonexistent targets
  2011-06-03 16:10 [Qemu-devel] [PATCH v3] configure: Don't create symlinks to nonexistent targets Peter Maydell
  2011-06-22 11:45 ` Peter Maydell
@ 2011-06-22 12:28 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2011-06-22 12:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel, patches

On Fri, Jun 03, 2011 at 05:10:40PM +0100, Peter Maydell wrote:
> 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>
> ---
> 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(-)

Tested here and you've addressed review comments.

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-22 12:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-03 16:10 [Qemu-devel] [PATCH v3] configure: Don't create symlinks to nonexistent targets Peter Maydell
2011-06-22 11:45 ` Peter Maydell
2011-06-22 12:28 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).