setup.py: Basic support for windows.

During setup, some commands (git describe mainly) are launched,
and fail under Windows since /bin/sh is not available.

By switching to cmd to execute commands when python says that
the os is 'nt', setup.py works under both Linux and Windows.

I have used that patch for some time now, and haven't found other
issues yet.

Change-Id: Ib4c0ec53765ae80fc6b63c34a926644427a9ebce
Reviewed-on: https://review.openstack.org/33368
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Arnaud Fabre 2013-06-18 01:24:08 +02:00 committed by Jenkins
parent 79d7d5e64b
commit 8e6b9e900d
1 changed files with 6 additions and 1 deletions

View File

@ -117,7 +117,12 @@ def write_requirements():
def _run_shell_command(cmd):
output = subprocess.Popen(["/bin/sh", "-c", cmd],
if os.name == 'nt':
params = ["cmd", "/C"]
else:
params = ["/bin/sh", "-c"]
params.append(cmd)
output = subprocess.Popen(params,
stdout=subprocess.PIPE)
out = output.communicate()
if len(out) == 0: