deb,quirks: scope deb entries per series with an entry list
One deb block per package cannot express two series needing different rules. Make pull and deb lists of entries, each with its own series scope: every matching entry applies, in file order, so a stonking entry can carry its own dependency rules next to the resolute one. Thread the series through find_package_directory for the package_directory lookup, which keeps its deb-then-pull fallback.
This commit is contained in:
+2
-1
@@ -231,9 +231,10 @@ 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, &ctx)?;
|
||||
crate::deb::find_package_directory(Path::new(build_root), package, version, series, &ctx)?;
|
||||
let package_dir_str = package_dir
|
||||
.to_str()
|
||||
.ok_or("Invalid package directory path")?;
|
||||
|
||||
+10
-4
@@ -337,10 +337,11 @@ pub(crate) fn find_package_directory(
|
||||
parent_dir: &Path,
|
||||
package: &str,
|
||||
version: &str,
|
||||
series: &str,
|
||||
ctx: &context::Context,
|
||||
) -> Result<PathBuf, Box<dyn Error>> {
|
||||
// Check quirks first for custom package directories
|
||||
let custom_dirs = crate::quirks::get_package_directories(package);
|
||||
let custom_dirs = crate::quirks::get_package_directories(package, series);
|
||||
for custom_dir in custom_dirs {
|
||||
let package_dir = parent_dir.join(&custom_dir);
|
||||
if ctx.exists(&package_dir)? && ctx.exists(&package_dir.join("debian"))? {
|
||||
@@ -533,9 +534,14 @@ mod tests {
|
||||
let ctx = Arc::new(Context::new(crate::context::ContextConfig::Local).unwrap());
|
||||
|
||||
// Change directory to the package directory
|
||||
let cwd =
|
||||
crate::deb::find_package_directory(cwd, package, &package_info.stanza.version, &ctx)
|
||||
.expect("Cannot find package directory");
|
||||
let cwd = crate::deb::find_package_directory(
|
||||
cwd,
|
||||
package,
|
||||
&package_info.stanza.version,
|
||||
series,
|
||||
&ctx,
|
||||
)
|
||||
.expect("Cannot find package directory");
|
||||
log::debug!("Package directory: {}", cwd.display());
|
||||
|
||||
log::info!("Starting binary package build...");
|
||||
|
||||
Reference in New Issue
Block a user