Skip to content

Commit

Permalink
Work around GDAL dev version numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Sep 22, 2023
1 parent 43d23d2 commit b843055
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

- Fixed build script error with development GDAL versions


- <https://github.com/georust/gdal/pull/439>

## 0.16

- **Breaking**: `Dataset::close` now consumes `self`
Expand Down
5 changes: 4 additions & 1 deletion gdal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ fn main() {
include_paths.push(dir.to_str().unwrap().to_string());
}
if version.is_none() {
if let Ok(pkg_version) = Version::parse(gdal.version.trim()) {
// development GDAL versions look like 3.7.2dev, which is not valid semver
let version_string = gdal.version.trim().replace("dev", "-dev");

if let Ok(pkg_version) = Version::parse(&version_string) {
version.replace(pkg_version);
}
}
Expand Down

0 comments on commit b843055

Please sign in to comment.