Skip to content

Commit

Permalink
Merge #211
Browse files Browse the repository at this point in the history
211: Update semver r=lnicola a=jdroenner

- [ x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md).
- [ x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---



Co-authored-by: Johannes Drönner <[email protected]>
Co-authored-by: Johannes Drönner <[email protected]>
  • Loading branch information
3 people authored Aug 6, 2021
2 parents 9182b76 + 965a8a7 commit 799ba08
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Upgrade `semver` to 1.0 and trim gdal version output in `build.rs`.
- <https://github.com/georust/gdal/pull/211/>

- **Breaking**: Make `set_attribute_filter` and `clear_attribute_filter` take `&mut self`
- <https://github.com/georust/gdal/pull/209/>

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bitflags = "1.2"

[build-dependencies]
gdal-sys = { path = "gdal-sys", version= "^0.4"}
semver = "0.11"
semver = "1.0"

[dev-dependencies]
tempfile = "3.2"
Expand Down
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ fn main() {
let gdal_version_string = gdal_version_info("--version"); // This expects GDAL to repond with "GDAL Semver , RELEASE DATE"
println!("GDAL version string: \"{}\"", gdal_version_string);

let semver_substring = &gdal_version_string[4..gdal_version_string.find(',').unwrap_or(12)];
let semver_substring =
&gdal_version_string[4..gdal_version_string.find(',').unwrap_or(12)].trim();
println!("GDAL semver string: \"{}\"", semver_substring);

let detected_version = Version::parse(semver_substring).expect("Could not parse gdal version!");
Expand Down
2 changes: 1 addition & 1 deletion gdal-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ libc = "0.2"
[build-dependencies]
bindgen = { version = "0.59", optional = true }
pkg-config = "0.3"
semver = "0.11"
semver = "1.0"
4 changes: 2 additions & 2 deletions gdal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn main() {
let home_dir = env_dir("GDAL_HOME");
let mut version = env::var_os("GDAL_VERSION")
.map(|vs| vs.to_string_lossy().to_string())
.and_then(|vs| Version::parse(&vs).ok());
.and_then(|vs| Version::parse(vs.trim()).ok());

let mut found = false;
if cfg!(windows) {
Expand Down Expand Up @@ -195,7 +195,7 @@ fn main() {
include_paths.push(dir.to_str().unwrap().to_string());
}
if version.is_none() {
if let Ok(pkg_version) = Version::parse(&gdal.version) {
if let Ok(pkg_version) = Version::parse(gdal.version.trim()) {
version.replace(pkg_version);
}
}
Expand Down

0 comments on commit 799ba08

Please sign in to comment.