All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] configure: Don't create symlinks to nonexistent targets
@ 2011-05-25 17:30 Peter Maydell
  2011-05-25 17:49 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2011-05-25 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Hajnoczi, 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>
---
v2: Remove the debug printing. Oops.

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

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

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

* Re: [Qemu-devel] [PATCH v2] configure: Don't create symlinks to nonexistent targets
  2011-05-25 17:30 [Qemu-devel] [PATCH v2] configure: Don't create symlinks to nonexistent targets Peter Maydell
@ 2011-05-25 17:49 ` Stefan Weil
  2011-05-25 20:05   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2011-05-25 17:49 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-trivial, Stefan Hajnoczi, qemu-devel, patches

Am 25.05.2011 19:30, schrieb Peter Maydell:
> 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(-)
>
> 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


Hi,

very good, those bad links which we get today are really annoying,
so for most developers this is an improvement.

Let me add some additional thoughts nevertheless.

* What happens if a git submodule is checked out after configure
   was done? Then the link is missing (until configure is called again).
   Maybe the links should be created from Makefile* instead from
   configure.

* On some restricted hosts which don't create symbolic links (w32),
   the copies which are created instead of links are not updated
   when the original file changes. This is not directly related to
   your change, but could be fixed, too, when the link creation is
   moved to Makefile*.

Cheers,
Stefan W.

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

* Re: [Qemu-devel] [PATCH v2] configure: Don't create symlinks to nonexistent targets
  2011-05-25 17:49 ` Stefan Weil
@ 2011-05-25 20:05   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2011-05-25 20:05 UTC (permalink / raw)
  To: Stefan Weil
  Cc: qemu-trivial, Peter Maydell, patches, qemu-devel, Stefan Hajnoczi

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

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

end of thread, other threads:[~2011-05-25 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-25 17:30 [Qemu-devel] [PATCH v2] configure: Don't create symlinks to nonexistent targets Peter Maydell
2011-05-25 17:49 ` Stefan Weil
2011-05-25 20:05   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.