qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6] scripts: Convert qemu-version.sh to qemu-version.py


From: Paolo Bonzini
Subject: Re: [PATCH v6] scripts: Convert qemu-version.sh to qemu-version.py
Date: Wed, 7 Oct 2020 18:43:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 07/10/20 18:23, 罗勇刚(Yonggang Luo) wrote:
>> +    if not pkgversion and os.path.exists('.git'):
>> +        # The quote of v* should preserve, otherwise git command
> would fail
>> +        pc = subprocess.run(['git', 'describe', '--match', "'v*'",
> '--dirty', '--always'],
>> +                            stdout=subprocess.PIPE,
> stderr=subprocess.DEVNULL, encoding='utf8')

It's a total mess.

On Linux, if you use 'v*' git is invoked with an argument that looks
like 'v*', that is as if you used \'v\*\' on bash.

On Windows, wildcard expansion is done by the program so you need to
pass a quoted value to stop the wildcard expansion.

I have no idea how to fix it.  Probably it can be made to work using a
string argument and "shell=True", but at this point it makes more sense
to keep the shell script version.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]