deb: build the tree the caller pointed at before the name search
build_binary_package stages the parent of the requested cwd, then re-derived the package directory inside the staging area from package/version name patterns plus the calling process's working directory. That only works by accident for interactive users sitting in the package directory: an embedded caller whose tree lives at <job>/tree matches no pattern, and the process cwd means nothing to a library consumer — the bc build above failed here even though the tree was staged correctly. The pointed-at tree is authoritative anyway: its changelog defined the package, version and series for this build. Resolve its staged copy outright when it carries a debian/ tree, keep the pattern search (with the quirks overrides) as a fallback, and hand the resolved directory to local::build instead of searching again.
This commit is contained in:
+3
-4
@@ -34,6 +34,7 @@ pub async fn build(
|
||||
series: &str,
|
||||
pocket: Option<&str>,
|
||||
build_root: &str,
|
||||
package_dir: &Path,
|
||||
cross: bool,
|
||||
ppa: &[String],
|
||||
inject_packages: &[String],
|
||||
@@ -231,10 +232,8 @@ pub async fn build(
|
||||
return Err("Could not install essential packages for the build".into());
|
||||
}
|
||||
|
||||
// Find the actual package directory
|
||||
// Find the actual package directory
|
||||
let package_dir =
|
||||
crate::deb::find_package_directory(Path::new(build_root), package, version, series, &ctx)?;
|
||||
// The package directory was resolved by the caller (the staged copy of
|
||||
// the tree the user pointed at, or the name-pattern search fallback)
|
||||
let package_dir_str = package_dir
|
||||
.to_str()
|
||||
.ok_or("Invalid package directory path")?;
|
||||
|
||||
Reference in New Issue
Block a user