build, changelog: fix signing when building source package
Some checks failed
CI / build (push) Failing after 7m8s
Some checks failed
CI / build (push) Failing after 7m8s
This commit is contained in:
21
src/build.rs
21
src/build.rs
@@ -23,16 +23,22 @@ pub fn build_source_package(cwd: Option<&Path>) -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
};
|
||||
|
||||
// Build arguments
|
||||
let mut args = vec!["-S", "-I", "-i", "-nc", "-d"];
|
||||
// Build command arguments
|
||||
let mut command = Command::new("dpkg-buildpackage");
|
||||
command
|
||||
.current_dir(cwd)
|
||||
.arg("-S")
|
||||
.arg("-I")
|
||||
.arg("-i")
|
||||
.arg("-nc")
|
||||
.arg("-d");
|
||||
|
||||
// If a signing key is found, use it for signing
|
||||
if let Some(key_id) = &signing_key {
|
||||
args.push("-k");
|
||||
args.push(key_id);
|
||||
command.arg(format!("--sign-keyid={}", key_id));
|
||||
log::info!("Using GPG key {} for signing", key_id);
|
||||
} else {
|
||||
args.push("--no-sign");
|
||||
command.arg("--no-sign");
|
||||
log::info!(
|
||||
"No GPG key found for {} ({}), building without signing",
|
||||
maintainer_name,
|
||||
@@ -40,10 +46,7 @@ pub fn build_source_package(cwd: Option<&Path>) -> Result<(), Box<dyn Error>> {
|
||||
);
|
||||
}
|
||||
|
||||
let status = Command::new("dpkg-buildpackage")
|
||||
.current_dir(cwd)
|
||||
.args(&args)
|
||||
.status()?;
|
||||
let status = command.status()?;
|
||||
|
||||
if !status.success() {
|
||||
return Err(format!("dpkg-buildpackage failed with status: {}", status).into());
|
||||
|
||||
@@ -146,13 +146,13 @@ pub fn parse_changelog_footer(path: &Path) -> Result<(String, String), Box<dyn s
|
||||
// Find the last maintainer line (format: -- Name <email> Date)
|
||||
let re = Regex::new(r"--\s*([^<]+?)\s*<([^>]+)>\s*")?;
|
||||
|
||||
if let Some(last_match) = re.captures_iter(&content).last() {
|
||||
let name = last_match
|
||||
if let Some(first_match) = re.captures_iter(&content).next() {
|
||||
let name = first_match
|
||||
.get(1)
|
||||
.map_or("", |m| m.as_str())
|
||||
.trim()
|
||||
.to_string();
|
||||
let email = last_match
|
||||
let email = first_match
|
||||
.get(2)
|
||||
.map_or("", |m| m.as_str())
|
||||
.trim()
|
||||
|
||||
Reference in New Issue
Block a user