[{"id":1771922,"web_url":"http://patchwork.ozlabs.org/comment/1771922/","msgid":"<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>","list_archive_url":null,"date":"2017-09-20T13:20:02","subject":"Re: [Qemu-devel] [PATCH v10 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/19/2017 10:25 PM, Fam Zheng wrote:\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>  scripts/archive-source.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 51 insertions(+)\n>  create mode 100755 scripts/archive-source.sh\n> \n\n> +\n> +if test -n \"$submodules\"; then\n> +    {\n> +        git ls-files || error \"git ls-files failed\"\n> +        for sm in $submodules; do\n> +            (cd $sm; git ls-files) | sed \"s:^:$sm/:\"\n> +            if test ${PIPESTATUS[0]} -ne 0 -o $? -ne 0; then\n\nThis relies on 'test ... -o ...' which is non-portable.  It \"works\"\nbecause there is no possible ambiguity in the contents of $PIPESTATUS\nthat could cause a different parse of the test arguments, but I tend to\ndiscourage any use of -a/-o inside test on principle.  Sadly, writing:\n\nif test ${PIPESTATUS[0]} -ne 0 || test $? -ne 0\n\nhas a flaw that $? is no longer what you want, at which point you would\nhave to introduce a temporary variable.  But we're using bash, so you\ncan instead write this as:\n\nif test \"${PIPESTATUS[@]}\" != \"0 0\"; then\n\n> +                error \"git ls-files in submodule $sm failed\"\n> +            fi\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\nAt this point, $1.list has been created, even if commands failed...\n\n> +\n> +if test $? -ne 0; then\n> +    error \"failed to generate list file\"\n> +fi\n\n...but this exits without cleanup.  If we really want it cleaned no\nmatter what, it's probably better to do:\n\ntrap \"status=$?; rm -f \"$1\".list; exit \\$status\" 0 1 2 3 15\n\nearlier than anything that can create the file.\n\n> +\n> +tar -cf \"$1\" -T \"$1\".list\n> +status=$?\n> +rm \"$1\".list\n> +if test $statue -ne 0; then\n\nUmm, $statue is not the same as $status.\n\n> +    error \"failed to create tar file\"\n> +fi\n> +exit 0\n>","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-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.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 3xy2L76ZS9z9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 00:33:51 +1000 (AEST)","from localhost ([::1]:48483 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 1dug4T-00041t-Sa\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 10:33:49 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42740)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dufC7-0003Mw-MH\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:37:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1duevI-0005Ef-Rs\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:21:22 -0400","from mx1.redhat.com ([209.132.183.28]:49194)\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 1duevH-00058V-33\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:20:15 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\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 76C117D0F2;\n\tWed, 20 Sep 2017 13:20:11 +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 BF15760BE6;\n\tWed, 20 Sep 2017 13:20:03 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 76C117D0F2","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org","References":"<20170920032555.18911-1-famz@redhat.com>\n\t<20170920032555.18911-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":"<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>","Date":"Wed, 20 Sep 2017 08:20:02 -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":"<20170920032555.18911-4-famz@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"VuEX8d3qJhkND9EAFbfX5q344u3FL0Slv\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tWed, 20 Sep 2017 13:20:11 +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 v10 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>"}},{"id":1772331,"web_url":"http://patchwork.ozlabs.org/comment/1772331/","msgid":"<20170921003306.GB13703@lemon.lan>","list_archive_url":null,"date":"2017-09-21T00:33:06","subject":"Re: [Qemu-devel] [PATCH v10 03/13] scripts: Add archive-source.sh","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Wed, 09/20 08:20, Eric Blake wrote:\n> On 09/19/2017 10:25 PM, Fam Zheng wrote:\n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >  scripts/archive-source.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 51 insertions(+)\n> >  create mode 100755 scripts/archive-source.sh\n> > \n> \n> > +\n> > +if test -n \"$submodules\"; then\n> > +    {\n> > +        git ls-files || error \"git ls-files failed\"\n> > +        for sm in $submodules; do\n> > +            (cd $sm; git ls-files) | sed \"s:^:$sm/:\"\n> > +            if test ${PIPESTATUS[0]} -ne 0 -o $? -ne 0; then\n> \n> This relies on 'test ... -o ...' which is non-portable.  It \"works\"\n> because there is no possible ambiguity in the contents of $PIPESTATUS\n> that could cause a different parse of the test arguments, but I tend to\n> discourage any use of -a/-o inside test on principle.  Sadly, writing:\n> \n> if test ${PIPESTATUS[0]} -ne 0 || test $? -ne 0\n> \n> has a flaw that $? is no longer what you want, at which point you would\n> have to introduce a temporary variable.  But we're using bash, so you\n> can instead write this as:\n> \n> if test \"${PIPESTATUS[@]}\" != \"0 0\"; then\n\nOkay.\n\n> \n> > +                error \"git ls-files in submodule $sm failed\"\n> > +            fi\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> At this point, $1.list has been created, even if commands failed...\n> \n> > +\n> > +if test $? -ne 0; then\n> > +    error \"failed to generate list file\"\n> > +fi\n> \n> ...but this exits without cleanup.  If we really want it cleaned no\n> matter what, it's probably better to do:\n> \n> trap \"status=$?; rm -f \"$1\".list; exit \\$status\" 0 1 2 3 15\n\nSounds good, will do.\n\n> \n> earlier than anything that can create the file.\n> \n> > +\n> > +tar -cf \"$1\" -T \"$1\".list\n> > +status=$?\n> > +rm \"$1\".list\n> > +if test $statue -ne 0; then\n> \n> Umm, $statue is not the same as $status.\n\nOops, will fix.\n\nFam","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-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@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 3xyHfN6Wkzz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 10:33:46 +1000 (AEST)","from localhost ([::1]:51222 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 1dupR2-0007NE-73\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 20:33:44 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51981)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dupQY-0007Lw-Pl\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:33:15 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dupQV-0008WU-MM\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:33:14 -0400","from mx1.redhat.com ([209.132.183.28]:35176)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dupQV-0008Vq-GV\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:33:11 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\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 59A63CD003;\n\tThu, 21 Sep 2017 00:33:10 +0000 (UTC)","from localhost (ovpn-12-27.pek2.redhat.com [10.72.12.27])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id D765C5C544;\n\tThu, 21 Sep 2017 00:33:07 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 59A63CD003","Date":"Thu, 21 Sep 2017 08:33:06 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Eric Blake <eblake@redhat.com>","Message-ID":"<20170921003306.GB13703@lemon.lan>","References":"<20170920032555.18911-1-famz@redhat.com>\n\t<20170920032555.18911-4-famz@redhat.com>\n\t<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tThu, 21 Sep 2017 00:33:10 +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","Subject":"Re: [Qemu-devel] [PATCH v10 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=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com, Alex\n\t=?iso-8859-1?q?Benn=E9e?= <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>"}},{"id":1772334,"web_url":"http://patchwork.ozlabs.org/comment/1772334/","msgid":"<20170921004534.GC13703@lemon.lan>","list_archive_url":null,"date":"2017-09-21T00:45:34","subject":"Re: [Qemu-devel] [PATCH v10 03/13] scripts: Add archive-source.sh","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Wed, 09/20 08:20, Eric Blake wrote:\n> On 09/19/2017 10:25 PM, Fam Zheng wrote:\n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >  scripts/archive-source.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 51 insertions(+)\n> >  create mode 100755 scripts/archive-source.sh\n> > \n> \n> > +\n> > +if test -n \"$submodules\"; then\n> > +    {\n> > +        git ls-files || error \"git ls-files failed\"\n> > +        for sm in $submodules; do\n> > +            (cd $sm; git ls-files) | sed \"s:^:$sm/:\"\n> > +            if test ${PIPESTATUS[0]} -ne 0 -o $? -ne 0; then\n> \n> This relies on 'test ... -o ...' which is non-portable.  It \"works\"\n> because there is no possible ambiguity in the contents of $PIPESTATUS\n> that could cause a different parse of the test arguments, but I tend to\n> discourage any use of -a/-o inside test on principle.  Sadly, writing:\n> \n> if test ${PIPESTATUS[0]} -ne 0 || test $? -ne 0\n> \n> has a flaw that $? is no longer what you want, at which point you would\n> have to introduce a temporary variable.  But we're using bash, so you\n> can instead write this as:\n> \n> if test \"${PIPESTATUS[@]}\" != \"0 0\"; then\n\nHmm, with exactly this line here I get something like:\n\n./scripts/archive-source.sh: line 36: test: too many arguments\n\nBut with\n\n    if test \"${PIPESTATUS[0]} ${PIPESTATUS[1]}\" != \"0 0\"; then\n\nit seems to work fine. What is the magic here?\n\nFam","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-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@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 3xyHwf0prfz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 10:46:08 +1000 (AEST)","from localhost ([::1]:51250 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 1dupcy-0001My-Sh\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 20:46:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56882)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dupce-0001Mq-2y\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:45:45 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dupca-00032y-UN\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:45:44 -0400","from mx1.redhat.com ([209.132.183.28]:45302)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dupca-00032P-CE\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:45:40 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\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 6A35D356D4;\n\tThu, 21 Sep 2017 00:45:39 +0000 (UTC)","from localhost (ovpn-12-27.pek2.redhat.com [10.72.12.27])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 50D9C600CA;\n\tThu, 21 Sep 2017 00:45:36 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 6A35D356D4","Date":"Thu, 21 Sep 2017 08:45:34 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Eric Blake <eblake@redhat.com>","Message-ID":"<20170921004534.GC13703@lemon.lan>","References":"<20170920032555.18911-1-famz@redhat.com>\n\t<20170920032555.18911-4-famz@redhat.com>\n\t<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tThu, 21 Sep 2017 00:45:39 +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","Subject":"Re: [Qemu-devel] [PATCH v10 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=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com, Alex\n\t=?iso-8859-1?q?Benn=E9e?= <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>"}},{"id":1772807,"web_url":"http://patchwork.ozlabs.org/comment/1772807/","msgid":"<cdab43d5-642a-b7fc-fdcc-ef00ba2582ff@redhat.com>","list_archive_url":null,"date":"2017-09-21T13:36:07","subject":"Re: [Qemu-devel] [PATCH v10 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/20/2017 07:45 PM, Fam Zheng wrote:\n>>\n>> has a flaw that $? is no longer what you want, at which point you would\n>> have to introduce a temporary variable.  But we're using bash, so you\n>> can instead write this as:\n>>\n>> if test \"${PIPESTATUS[@]}\" != \"0 0\"; then\n> \n> Hmm, with exactly this line here I get something like:\n> \n> ./scripts/archive-source.sh: line 36: test: too many arguments\n\nD'oh - [@] causes word splitting (same as \"$@\"); we want [*] instead:\n\nif test \"${PIPESTATUS[*]}\" != \"0 0\";\n\n> \n> But with\n> \n>     if test \"${PIPESTATUS[0]} ${PIPESTATUS[1]}\" != \"0 0\"; then\n\nor that's a manual way of spelling the auto-array-concatenation that you\nget with [*].\n\n> \n> it seems to work fine. What is the magic here?\n> \n> Fam\n>","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-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.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 3xyd232Wkbz9t43\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 23:36:59 +1000 (AEST)","from localhost ([::1]:53753 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 1dv1ez-00061Y-Ek\n\tfor incoming@patchwork.ozlabs.org; Thu, 21 Sep 2017 09:36:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:32795)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dv1eP-0005zx-DN\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 09:36:24 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dv1eM-0005ZQ-Ag\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 09:36:21 -0400","from mx1.redhat.com ([209.132.183.28]:60958)\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 1dv1eM-0005Yy-0v\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 09:36:18 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\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 DEDB17E42E;\n\tThu, 21 Sep 2017 13:36:16 +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 80C735EE12;\n\tThu, 21 Sep 2017 13:36:08 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DEDB17E42E","To":"Fam Zheng <famz@redhat.com>","References":"<20170920032555.18911-1-famz@redhat.com>\n\t<20170920032555.18911-4-famz@redhat.com>\n\t<91d27127-b1ba-0922-7d08-44782d277501@redhat.com>\n\t<20170921004534.GC13703@lemon.lan>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<cdab43d5-642a-b7fc-fdcc-ef00ba2582ff@redhat.com>","Date":"Thu, 21 Sep 2017 08:36:07 -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":"<20170921004534.GC13703@lemon.lan>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"gxNqojfu7CKDhifuwpwFpwIKaEcMQ9fRA\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tThu, 21 Sep 2017 13:36:17 +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 v10 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,\n\t=?utf-8?q?Philippe_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,\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>"}}]