From patchwork Tue Oct 24 08:58:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 829817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yLnJq2rL5z9s7M for ; Tue, 24 Oct 2017 19:59:35 +1100 (AEDT) Received: from localhost ([::1]:42679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6v3Y-0003tv-HH for incoming@patchwork.ozlabs.org; Tue, 24 Oct 2017 04:59:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6v39-0003sY-Bs for qemu-devel@nongnu.org; Tue, 24 Oct 2017 04:59:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6v35-0003Z5-GE for qemu-devel@nongnu.org; Tue, 24 Oct 2017 04:59:03 -0400 Received: from ozlabs.ru ([107.173.13.209]:59970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6v35-0003Ya-AN for qemu-devel@nongnu.org; Tue, 24 Oct 2017 04:58:59 -0400 Received: from vpl1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 38DE03A600A6; Tue, 24 Oct 2017 04:57:49 -0400 (EDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Tue, 24 Oct 2017 19:58:53 +1100 Message-Id: <20171024085853.32615-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [RFC PATCH qemu] git-submodule.sh: Do not try writing to source directory if not necessary X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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