scripts/nsis.py: Fix destination directory name when invoked on Windows
commit93dbca2ce9f112ee8bfd641fa2ea6ff0771c6c39
authorBin Meng <bin.meng@windriver.com>
Thu, 8 Sep 2022 13:28:12 +0000 (8 21:28 +0800)
committerStefan Weil <sw@weilnetz.de>
Mon, 31 Oct 2022 09:06:11 +0000 (31 10:06 +0100)
treeb928015f0d532566842b6f1155dafb2cbda452cc
parent7f8c044018555dcc36eb5af1d5d6cebc85ebd330
scripts/nsis.py: Fix destination directory name when invoked on Windows

"make installer" on Windows fails with the following message:

  Traceback (most recent call last):
    File "G:\msys64\home\foo\git\qemu\scripts\nsis.py", line 89, in <module>
      main()
    File "G:\msys64\home\foo\git\qemu\scripts\nsis.py", line 34, in main
      with open(
  OSError: [Errno 22] Invalid argument:
  'R:/Temp/tmpw83xhjquG:/msys64/qemu/system-emulations.nsh'
  ninja: build stopped: subcommand failed.

Use os.path.splitdrive() to form a canonical path without the drive
letter on Windows. This works with cross-build on Linux too.

Fixes: 8adfeba953e0 ("meson: add NSIS building")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220908132817.1831008-3-bmeng.cn@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
scripts/nsis.py