Skip to content

Commit

Permalink
Prepare for change in revision default
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Sep 5, 2023
1 parent fd1807c commit 71a8df7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://github.com/kornelski/cargo-deb#readme"
keywords = ["debian", "ubuntu", "deploy", "cargo-subcommand"]
repository = "https://github.com/kornelski/cargo-deb"
readme = "README.md"
version = "1.44.0"
version = "1.44.1"
edition = "2021"
rust-version = "1.63"

Expand Down
8 changes: 7 additions & 1 deletion src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ impl Config {
deb.extended_description.take(),
deb.extended_description_file.as_ref().map(Path::new).or(package.readme().as_path()),
)?;

if deb_version.is_none() && deb_revision.is_none() && deb.revision.is_none() {
listener.warning("The next version of cargo-deb will add a \"-1\" suffix to versions.\nUse --deb-revision=\"\" or package.metadata.deb.revision=\"\" to keep the current behavior.".to_string());
}

let mut config = Config {
default_timestamp,
package_manifest_dir: package_manifest_dir.to_owned(),
Expand Down Expand Up @@ -1074,7 +1079,7 @@ fn manifest_version_string(package: &cargo_toml::Package<CargoPackageMetadata>,
}
}

if let Some(revision) = revision {
if let Some(revision) = revision.filter(|r| !r.is_empty()) {
format!("{version}-{revision}")
} else {
version.to_owned()
Expand Down Expand Up @@ -1449,5 +1454,6 @@ fn deb_ver() {
assert_eq!("1.2.0~beta.3-4", manifest_version_string(&c, Some("4".into())));
c.version = cargo_toml::Inheritable::Set("1.2.0-new".into());
assert_eq!("1.2.0-new", manifest_version_string(&c, None));
assert_eq!("1.2.0-new", manifest_version_string(&c, Some("".into())));
assert_eq!("1.2.0-new-11", manifest_version_string(&c, Some("11".into())));
}

0 comments on commit 71a8df7

Please sign in to comment.