summaryrefslogtreecommitdiff
path: root/src/debian.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-21 08:20:43 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-21 09:24:01 +0300
commitafc842c9025e33f2e25716d80ecac07117766457 (patch)
treec0c563d80cb5d190e5afbd09704055db7ad4a1c1 /src/debian.rs
parent50258196ee8832ca8d9f02e73babb431248ed025 (diff)
downloadbumper-rs-afc842c9025e33f2e25716d80ecac07117766457.tar.gz
refactor: make logging and messages more consistent
Also, report the Debian package version correctly, not just the upstream part.
Diffstat (limited to 'src/debian.rs')
-rw-r--r--src/debian.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/debian.rs b/src/debian.rs
index d82a14a..3f9e01b 100644
--- a/src/debian.rs
+++ b/src/debian.rs
@@ -1,5 +1,5 @@
use crate::errors::BumperError;
-use log::{debug, info};
+use log::debug;
use std::path::{Path, PathBuf};
use std::process::Command;
@@ -10,24 +10,20 @@ pub struct Debian {
impl Debian {
pub fn new(dirname: &Path) -> Result<Self, BumperError> {
let changelog = dirname.join("debian/changelog");
+ debug!("does {} exist? {}", changelog.display(), changelog.exists());
if changelog.exists() {
- info!("directory {} contains Debian packaging", dirname.display());
return Ok(Self {
dirname: dirname.to_path_buf(),
});
}
- debug!(
- "directory {} doesn't contains Debian packaging",
- dirname.display()
- );
Err(BumperError::UnknownProjectKind(dirname.to_path_buf()))
}
- pub fn set_version(&mut self, version: &str) -> Result<(), BumperError> {
+ pub fn set_version(&mut self, version: &str) -> Result<String, BumperError> {
let version = format!("{}-1", version);
self.dch(&["-v", &version, ""])?;
self.dch(&["-r", ""])?;
- Ok(())
+ Ok(version)
}
fn dch(&self, args: &[&str]) -> Result<(), BumperError> {