1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 07:55:06 +03:00

setup: invoke git commands properly

Storing the git commands as single string, to split it by space later
on, works only in case there are no spaces in the arguments, which is
exactly what is in those commands.

Instead, specify them directly as lists, with the options & arguments
split in the right way. This fixes the generation of the AUTHORS and
ChangeLog files.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
Pino Toscano 2023-09-23 09:49:30 +02:00 committed by Daniel P. Berrangé
parent 697b7727d0
commit 2c8339b44c

View File

@ -204,7 +204,7 @@ class my_sdist(sdist):
def gen_authors(self):
authors = []
cmd = "git log --pretty=format:'%aN <%aE>'".split(" ")
cmd = ["git", "log", "--pretty=format:%aN <%aE>"]
with subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
@ -221,7 +221,7 @@ class my_sdist(sdist):
"\n".join(authors))
def gen_changelog(self):
cmd = "git log '--pretty=format:%H:%ct %an <%ae>%n%n%s%n%b%n'".split(" ")
cmd = ["git", "log", "--pretty=format:%H:%ct %an <%ae>%n%n%s%n%b%n"]
with open("ChangeLog", "w") as f_out, \
subprocess.Popen(cmd,
stdout=subprocess.PIPE,