summaryrefslogtreecommitdiff
path: root/scripts/git-submodule.sh
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-10-26 13:45:38 +0100
committerDaniel P. Berrange <berrange@redhat.com>2017-11-06 11:04:30 +0000
commit96089f6d0e88446a16725f2152d252be34f1ad50 (patch)
tree160825f0c3f6db4d4a88c97248d18c78984bd40b /scripts/git-submodule.sh
parentcc84d63a42e31c2afa884fc78610a65ab8ecc06a (diff)
downloadqemu-96089f6d0e88446a16725f2152d252be34f1ad50.tar.gz
build: don't create temporary files in source dir
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...' ahead of time. When checking for status we should not then write into the source dir. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'scripts/git-submodule.sh')
-rwxr-xr-xscripts/git-submodule.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index 039f782d81..21909ea413 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -39,10 +39,9 @@ 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
+ CURSTATUS=`$GIT submodule status $modules`
+ OLDSTATUS=`cat $substat`
+ test "$CURSTATUS" = "$OLDSTATUS"
exit $?
;;
update)