Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update semver #211

Merged
merged 4 commits into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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