]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
build: don't create temporary files in source dir
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 26 Oct 2017 12:45:38 +0000 (13:45 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 6 Nov 2017 11:04:30 +0000 (11:04 +0000)
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>
scripts/git-submodule.sh

index 039f782d8140763befc5f98af8034d90906d84ea..21909ea41353c3e6aad159008770635cadfaebf0 100755 (executable)
@@ -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)