====== Ottenere il tipo di distribuzione Linuxcon Meson buid ======
Autore: **//Fabio Di Matteo//** \\ Ultima revisione: **// 21/01/2024 - 14:25 //** // //
Puo' essere utile sapere in che tipo di distribuzione stiamo usando Meson build.
===== Script shell =====
**getLinuxDistro.sh**
#!/usr/bin/env sh
B=$(cat /etc/os-release |grep --max-count=1 ID)
IFS='=';
tokens=( $B )
echo ${tokens[1]}
===== La parte in meson.build =====
**meson.build**
...
osType=build_machine.system()
if osType=='linux'
r=run_command('getLinuxDistro.sh', check: true)
distro=r.stdout().strip()
message('We are on linux: '+distro)
endif
...