[{"id":1770005,"web_url":"http://patchwork.ozlabs.org/comment/1770005/","msgid":"<87h8w0jr28.fsf@linaro.org>","list_archive_url":null,"date":"2017-09-18T09:26:23","subject":"Re: [Qemu-devel] [PATCH v8 03/13] scripts: Add archive-source.sh","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/people/39532/","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"content":"Fam Zheng <famz@redhat.com> writes:\n\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n\nReviewed-by: Alex Bennée <alex.bennee@linaro.org>\n\n> ---\n>  scripts/archive-source.sh | 33 +++++++++++++++++++++++++++++++++\n>  1 file changed, 33 insertions(+)\n>  create mode 100755 scripts/archive-source.sh\n>\n> diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh\n> new file mode 100755\n> index 0000000000..8b373e3090\n> --- /dev/null\n> +++ b/scripts/archive-source.sh\n> @@ -0,0 +1,33 @@\n> +#!/bin/sh\n> +#\n> +# Author: Fam Zheng <famz@redhat.com>\n> +#\n> +# Archive source tree, including submodules. This is created for test code to\n> +# export the source files, in order to be built in a different enviornment,\n> +# such as in a docker instance or VM.\n> +#\n> +# This code is licensed under the GPL version 2 or later.  See\n> +# the COPYING file in the top-level directory.\n> +\n> +set -e\n> +\n> +if test $# -lt 1; then\n> +    echo \"Usage: $0 <output tarball>\"\n> +    exit 1\n> +fi\n> +\n> +submodules=$(git submodule foreach --recursive --quiet 'echo $name')\n> +\n> +if test -n \"$submodules\"; then\n> +    {\n> +        git ls-files\n> +        for sm in $submodules; do\n> +            (cd $sm; git ls-files) | sed \"s:^:$sm/:\"\n> +        done\n> +    } | grep -x -v $(for sm in $submodules; do echo \"-e $sm\"; done) > \"$1\".list\n> +else\n> +    git ls-files > \"$1\".list\n> +fi\n> +\n> +tar -cf \"$1\" -T \"$1\".list\n> +rm \"$1\".list\n\n\n--\nAlex Bennée","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"MTrx/XtA\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xwgcw0fmzz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 19:26:56 +1000 (AEST)","from localhost ([::1]:35402 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dtsKM-00066i-5i\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 05:26:54 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54554)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dtsJy-00066T-DV\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 05:26:31 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dtsJu-0006SR-FJ\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 05:26:30 -0400","from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:47648)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <alex.bennee@linaro.org>)\n\tid 1dtsJu-0006S6-7y\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 05:26:26 -0400","by mail-wm0-x230.google.com with SMTP id 13so829192wmq.2\n\tfor <qemu-devel@nongnu.org>; Mon, 18 Sep 2017 02:26:26 -0700 (PDT)","from zen.linaro.local ([81.128.185.34])\n\tby smtp.gmail.com with ESMTPSA id\n\ts3sm7153462wrc.24.2017.09.18.02.26.24\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 18 Sep 2017 02:26:24 -0700 (PDT)","from zen (localhost [127.0.0.1])\n\tby zen.linaro.local (Postfix) with ESMTPS id D87A13E00DB;\n\tMon, 18 Sep 2017 10:26:23 +0100 (BST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=references:user-agent:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-transfer-encoding;\n\tbh=wotHcC0TECc6l/BZJS1HtiaX1M4UdqCQkEE93MnsMH0=;\n\tb=MTrx/XtAIe3pmFXu9kMWU8iK5ljXipISzG4oBs8mdQEyotPDar0vaZLxAt1OOmp/i1\n\tej5U5pXxD5G7xsbGtDKAc1o/luq5zNBWJqJc8vvj9ppGMqUVMJAvcysK3bwI1eHMdfSe\n\t+2ed66gAHerZT1R7TLe0ov2bCJLiTqRQ3utRc=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:references:user-agent:from:to:cc:subject\n\t:in-reply-to:date:message-id:mime-version:content-transfer-encoding; \n\tbh=wotHcC0TECc6l/BZJS1HtiaX1M4UdqCQkEE93MnsMH0=;\n\tb=HW87pP/UZz3XoU4PP+bdYbjblnvkexo4i5TbVr7IQSkb0sP3yVBYiiinbuWRfmeLcj\n\tioepelCv2aOACr2RC9A9yeyZP9nXIDVj2bnhnfCKSI5FhVvjheGyo/hsXE6IafX77qlV\n\tQYDiPyzrC6T93ZyLrW6l3D7qJEYp/8IMRNlZlX9pSBMdCcv4Cfhsvn9FZDqosjzrzvCz\n\tAUA3Xf8yrMj1nWfFQeo2JvtZwdjKI+y6vJQphDSJArx9PGIPVuHTbZOWB4Ao2q9mwwK+\n\t8ltvDtlObx5tNJO3vNDX5rNRaZ8FlS+zE18H1uAu+mmgEs0ON/5qBxsl0ouMsXtR60LT\n\t/esA==","X-Gm-Message-State":"AHPjjUiwg+Yfgx2vNvlB77K3+z7cjEiuaAjA1Cb7hPOt/+zlGso1u6cD\n\tWGVXujFvL0C7qvIGa70g2uCLhg==","X-Google-Smtp-Source":"AOwi7QDnOCGK+A7N/e0r9budRYCjw0dpfr2UC+JNL5qcRA2qrE76b2Iamh3LzG1KnmCiMx7HwPqahw==","X-Received":"by 10.28.95.9 with SMTP id t9mr7487335wmb.109.1505726785121;\n\tMon, 18 Sep 2017 02:26:25 -0700 (PDT)","References":"<20170918024402.3265-1-famz@redhat.com>\n\t<20170918024402.3265-4-famz@redhat.com>","User-agent":"mu4e 0.9.19; emacs 25.3.50.1","From":"Alex =?utf-8?q?Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"Fam Zheng <famz@redhat.com>","In-reply-to":"<20170918024402.3265-4-famz@redhat.com>","Date":"Mon, 18 Sep 2017 10:26:23 +0100","Message-ID":"<87h8w0jr28.fsf@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::230","Subject":"Re: [Qemu-devel] [PATCH v8 03/13] scripts: Add archive-source.sh","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Philippe\n\t=?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1770242,"web_url":"http://patchwork.ozlabs.org/comment/1770242/","msgid":"<949c1fef-4e95-ab61-02a6-b37ea7894006@redhat.com>","list_archive_url":null,"date":"2017-09-18T15:14:45","subject":"Re: [Qemu-devel] [PATCH v8 03/13] scripts: Add archive-source.sh","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/17/2017 09:43 PM, Fam Zheng wrote:\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>  scripts/archive-source.sh | 33 +++++++++++++++++++++++++++++++++\n>  1 file changed, 33 insertions(+)\n>  create mode 100755 scripts/archive-source.sh\n> \n> diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh\n> new file mode 100755\n> index 0000000000..8b373e3090\n> --- /dev/null\n> +++ b/scripts/archive-source.sh\n> @@ -0,0 +1,33 @@\n> +#!/bin/sh\n> +#\n> +# Author: Fam Zheng <famz@redhat.com>\n> +#\n> +# Archive source tree, including submodules. This is created for test code to\n> +# export the source files, in order to be built in a different enviornment,\n> +# such as in a docker instance or VM.\n> +#\n> +# This code is licensed under the GPL version 2 or later.  See\n> +# the COPYING file in the top-level directory.\n> +\n> +set -e\n\nDo we want to rely on 'set -e'?  The alternative would be:\n\n> +\n> +if test $# -lt 1; then\n> +    echo \"Usage: $0 <output tarball>\"\n> +    exit 1\n> +fi\n> +\n> +submodules=$(git submodule foreach --recursive --quiet 'echo $name')\n> +\n\n...Check here that the $() ran (rather than git being missing)\n\n> +if test -n \"$submodules\"; then\n> +    {\n> +        git ls-files\n\n...and that this ran\n\n> +        for sm in $submodules; do\n> +            (cd $sm; git ls-files) | sed \"s:^:$sm/:\"\n> +        done\n> +    } | grep -x -v $(for sm in $submodules; do echo \"-e $sm\"; done) > \"$1\".list\n\n...and the grep\n\n> +else\n> +    git ls-files > \"$1\".list\n\n...and the git ls-files\n\n> +fi\n> +\n> +tar -cf \"$1\" -T \"$1\".list\n\n...and the tar\n\n> +rm \"$1\".list\n> \n\nI'm not opposed to the patch going in as-is; but I do like to flag\nreliance on 'set -e' as it tends to NOT do what you think it does, and\nends up getting in the way more than it helps.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xwqLr23q7z9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 01:15:16 +1000 (AEST)","from localhost ([::1]:37189 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dtxlS-0000uS-D8\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 11:15:14 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43882)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dtxlA-0000uI-3D\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 11:14:57 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dtxl7-0000ov-DH\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 11:14:56 -0400","from mx1.redhat.com ([209.132.183.28]:44564)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>) id 1dtxl7-0000oG-4Y\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 11:14:53 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 43F9EA0C56;\n\tMon, 18 Sep 2017 15:14:52 +0000 (UTC)","from [10.10.124.97] (ovpn-124-97.rdu2.redhat.com [10.10.124.97])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 1AD6660618;\n\tMon, 18 Sep 2017 15:14:45 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 43F9EA0C56","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org","References":"<20170918024402.3265-1-famz@redhat.com>\n\t<20170918024402.3265-4-famz@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<949c1fef-4e95-ab61-02a6-b37ea7894006@redhat.com>","Date":"Mon, 18 Sep 2017 10:14:45 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170918024402.3265-4-famz@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"mV00hIMmH1nTfAxTUtGBLDT379E4MB3qg\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tMon, 18 Sep 2017 15:14:52 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v8 03/13] scripts: Add archive-source.sh","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, =?utf-8?q?Philippe_Mathieu-D?=\n\t=?utf-8?b?YXVkw6k=?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com,\n\t=?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]