21.04.2020 19:03, Kevin Wolf wrote:
Am 21.04.2020 um 09:35 hat Vladimir Sementsov-Ogievskiy geschrieben:
QEMU_VXHS_PROG is used only in common.rc. So, move it to common.rc,
simplifying a bit further conversion of check into python
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
This feels inconsistent when every other QEMU_*_PROG stays in check. Is
QEMU_VXHS_PROG really so different?
Hmm, I was just too lazy to understand set_prog_path logic :) If you think it
worth it, I'll try.
+set_prog_path()
+{
+ p=$(command -v $1 2> /dev/null)
+ if [ -n "$p" -a -x "$p" ]; then
+ type -p "$p"
+ else
+ return 1
+ fi
+}
Aha. It just tries to get path to the command and check that it is executable.
So, in python, it probably should look like simply
p = shutil.which(command)
return p if os.access(p, os.X_OK) else None
OK, I'll add it in next version.
--
Best regards,
Vladimir