Sebastian Kuzminsky 91ffc79c7b
better version check in linux build script (#9496)
* better version check in linux build script

Running `BuildLinux.sh` on Debian Trixie (and probably on other platforms)
results in this warning:
```
$ sudo ./BuildLinux.sh -u
./linux.d/debian: line 32: [: ==: unary operator expected
./linux.d/debian: line 32: [: ==: unary operator expected
...
```

The script is looking for the `VERSION_ID` variable
in `/etc/os-release`, but that variable is optional (see
https://www.linux.org/docs/man5/os-release.html) and is not present in
my install of Debian Trixie.  The script handles the missing variable
incorrectly, resulting in the above warning.

This commit fixes the version check to be more tolerant and IMO clearer.

Tested on Ubuntu 22.04, 24.04, and Debian Trixie.
2025-06-02 23:11:19 +08:00
..
2024-06-29 12:21:29 +08:00

Files in this directory are named for the exact output of awk -F= '/^ID=/ {print $2}' /etc/os-release for their respective distribution.

When BuildLinux.sh is executed, the respective file for the distribution will be sourced so the distribution specific instructions/logic are used.