4.x branch - Fix alpm-sys build.rs version check
The version checks in the `build.rs` file for the alpm crate and the alpm-sys crate are different, the alpm crate only checks for the major version, alpm-sys checks that the version matches `16.0.0` exactly.
At time of writing the libalpm.so version is `16.0.1`, leading to the alpm16 cfg flag being set for alpm, but not alpm-sys causing the build to fail.
This pull-request fixes this issue by reusing the comparison logic from alpm in alpm-sys. I chose to loosen the check in alpm-sys because the cfg flag also only specifies the major version.
An alternative would be to check for each supported version, in case a future minor version upgrade breaks something, however then there should be an explicit error when an unknown version is encountered (instead of the current situation where the alpm16 flag is enabled for one create, but disabled for the other).
合并状态:未合并 关闭于 2025-12-17 2 条评论