[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v10 03/13] scripts: Add archive-source.sh
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v10 03/13] scripts: Add archive-source.sh |
Date: |
Thu, 21 Sep 2017 08:45:34 +0800 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Wed, 09/20 08:20, Eric Blake wrote:
> On 09/19/2017 10:25 PM, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
> > scripts/archive-source.sh | 51
> > +++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 51 insertions(+)
> > create mode 100755 scripts/archive-source.sh
> >
>
> > +
> > +if test -n "$submodules"; then
> > + {
> > + git ls-files || error "git ls-files failed"
> > + for sm in $submodules; do
> > + (cd $sm; git ls-files) | sed "s:^:$sm/:"
> > + if test ${PIPESTATUS[0]} -ne 0 -o $? -ne 0; then
>
> This relies on 'test ... -o ...' which is non-portable. It "works"
> because there is no possible ambiguity in the contents of $PIPESTATUS
> that could cause a different parse of the test arguments, but I tend to
> discourage any use of -a/-o inside test on principle. Sadly, writing:
>
> if test ${PIPESTATUS[0]} -ne 0 || test $? -ne 0
>
> has a flaw that $? is no longer what you want, at which point you would
> have to introduce a temporary variable. But we're using bash, so you
> can instead write this as:
>
> if test "address@hidden" != "0 0"; then
Hmm, with exactly this line here I get something like:
./scripts/archive-source.sh: line 36: test: too many arguments
But with
if test "${PIPESTATUS[0]} ${PIPESTATUS[1]}" != "0 0"; then
it seems to work fine. What is the magic here?
Fam
- [Qemu-devel] [PATCH v10 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux), Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 04/13] tests: Add a test key pair, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 05/13] tests: Add vm test lib, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 06/13] tests: Add ubuntu.i386 image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 07/13] tests: Add FreeBSD image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 08/13] tests: Add NetBSD image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 09/13] tests: Add OpenBSD image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 10/13] Makefile: Add rules to run vm tests, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 11/13] MAINTAINERS: Add tests/vm entry, Fam Zheng, 2017/09/19