qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] build: don't create temporary files in source dir
@ 2017-10-26 13:06 Daniel P. Berrange
  2017-10-27  4:06 ` Alexey Kardashevskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2017-10-26 13:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, Peter Maydell, Daniel P. Berrange

There are cases where users do VPATH builds with the source directory being on
a read-only volume. In such a case they have to manually run the command
'git-submodule.sh ...modules...'  manually ahead of time. When checking for
status we should not then write into the source dir.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 scripts/git-submodule.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index c66567d409..586ff32293 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -31,10 +31,10 @@ fi
 case "$command" in
 status)
     test -f "$substat" || exit 1
-    trap "rm -f ${substat}.tmp" EXIT
-    $GIT submodule status $modules > "${substat}.tmp"
-    test $? -ne 0 && error "failed to query git submodule status"
-    diff "${substat}" "${substat}.tmp" >/dev/null
+    substat_tmp=$(mktemp)
+    trap "rm -f ${substat_tmp}" EXIT
+    $GIT submodule status $modules > "${substat_tmp}"
+    diff "${substat}" "${substat_tmp}" >/dev/null
     exit $?
     ;;
 update)
-- 
2.13.6

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

* Re: [Qemu-devel] [PATCH] build: don't create temporary files in source dir
  2017-10-26 13:06 [Qemu-devel] [PATCH] build: don't create temporary files in source dir Daniel P. Berrange
@ 2017-10-27  4:06 ` Alexey Kardashevskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Kardashevskiy @ 2017-10-27  4:06 UTC (permalink / raw)
  To: Daniel P. Berrange, qemu-devel; +Cc: Peter Maydell

On 27/10/17 00:06, Daniel P. Berrange wrote:
> There are cases where users do VPATH builds with the source directory being on
> a read-only volume. In such a case they have to manually run the command
> 'git-submodule.sh ...modules...'  manually ahead of time. When checking for
> status we should not then write into the source dir.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  scripts/git-submodule.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
> index c66567d409..586ff32293 100755
> --- a/scripts/git-submodule.sh
> +++ b/scripts/git-submodule.sh
> @@ -31,10 +31,10 @@ fi
>  case "$command" in
>  status)
>      test -f "$substat" || exit 1
> -    trap "rm -f ${substat}.tmp" EXIT
> -    $GIT submodule status $modules > "${substat}.tmp"
> -    test $? -ne 0 && error "failed to query git submodule status"

This does not apply on any public tree, the error message and $GIT are missing.


> -    diff "${substat}" "${substat}.tmp" >/dev/null
> +    substat_tmp=$(mktemp)
> +    trap "rm -f ${substat_tmp}" EXIT
> +    $GIT submodule status $modules > "${substat_tmp}"
> +    diff "${substat}" "${substat_tmp}" >/dev/null
>      exit $?
>      ;;
>  update)
> 


-- 
Alexey

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

end of thread, other threads:[~2017-10-27  4:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26 13:06 [Qemu-devel] [PATCH] build: don't create temporary files in source dir Daniel P. Berrange
2017-10-27  4:06 ` Alexey Kardashevskiy

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).