qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH qemu] git-submodule.sh: Do not try writing to source directory if not necessary
@ 2017-10-24  8:58 Alexey Kardashevskiy
  2017-10-24 16:27 ` Daniel P. Berrange
  0 siblings, 1 reply; 12+ messages in thread
From: Alexey Kardashevskiy @ 2017-10-24  8:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, Daniel P. Berrange

The new git-submodule.sh script writes .git-submodule-status to
the source directory every time no matter what. This makes it conditional.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

I compile out of tree on a remote guest system where I mount the
source directory as "readonly" and build directory as "rw" and
scripts/git-submodule.sh tries writing to the source directory even when
I manually update modules on a host machine which is quite annoying.

Is this something acceptable? Or I am missing something here?

---
 scripts/git-submodule.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index d8fbc7e47e..b642994a67 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -33,6 +33,8 @@ status)
     ;;
 update)
     git submodule update --init $modules 1>/dev/null 2>&1
-    git submodule status $modules > "${substat}"
+    substat_tmp=$(mktemp)
+    git submodule status $modules > "$substat_tmp"
+    diff "${substat_tmp}" "${substat}" || mv "${substat_tmp}" "${substat}"
     ;;
 esac
-- 
2.11.0

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

end of thread, other threads:[~2017-10-26  8:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24  8:58 [Qemu-devel] [RFC PATCH qemu] git-submodule.sh: Do not try writing to source directory if not necessary Alexey Kardashevskiy
2017-10-24 16:27 ` Daniel P. Berrange
2017-10-24 16:33   ` Peter Maydell
2017-10-25  1:24     ` Alexey Kardashevskiy
2017-10-25  1:45   ` Alexey Kardashevskiy
2017-10-25  6:57     ` Daniel P. Berrange
2017-10-25  8:10       ` Alexey Kardashevskiy
2017-10-25 21:11         ` Daniel P. Berrange
2017-10-26  0:54           ` Alexey Kardashevskiy
2017-10-26  7:02             ` Daniel P. Berrange
2017-10-26  7:45               ` Alexey Kardashevskiy
2017-10-26  8:18                 ` Peter Maydell

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