From afc842c9025e33f2e25716d80ecac07117766457 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 21 Apr 2021 08:20:43 +0300 Subject: refactor: make logging and messages more consistent Also, report the Debian package version correctly, not just the upstream part. --- src/debian.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/debian.rs') 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 { 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 { let version = format!("{}-1", version); self.dch(&["-v", &version, ""])?; self.dch(&["-r", ""])?; - Ok(()) + Ok(version) } fn dch(&self, args: &[&str]) -> Result<(), BumperError> { -- cgit v1.2.1