pull,deb: add top-level --pocket option
- pull: select the pocket to download the source package from
- deb: build against dependencies from a specific pocket:
- local mode: enable '{series}-{pocket}' suite on archive sources
- cross mode: include the pocket suite in required repositories
This commit is contained in:
+13
-1
@@ -19,6 +19,7 @@ pub enum BuildMode {
|
||||
pub async fn build_binary_package(
|
||||
arch: Option<&str>,
|
||||
series: Option<&str>,
|
||||
pocket: Option<&str>,
|
||||
cwd: Option<&Path>,
|
||||
cross: bool,
|
||||
mode: Option<BuildMode>,
|
||||
@@ -99,6 +100,7 @@ pub async fn build_binary_package(
|
||||
&version,
|
||||
arch,
|
||||
series,
|
||||
pocket,
|
||||
&build_root,
|
||||
cross,
|
||||
ppa,
|
||||
@@ -107,7 +109,7 @@ pub async fn build_binary_package(
|
||||
)
|
||||
.await?
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Retrieve produced .deb files
|
||||
let remote_files = build_ctx.list_files(Path::new(&build_root))?;
|
||||
@@ -256,6 +258,15 @@ fn find_dsc_file(
|
||||
Ok(dsc_path)
|
||||
}
|
||||
|
||||
/// Check whether an apt source URI points to a distribution archive
|
||||
/// (as opposed to a PPA or another third-party repository)
|
||||
pub(crate) fn is_archive_source(uri: &str) -> bool {
|
||||
uri.contains("archive.ubuntu.com")
|
||||
|| uri.contains("security.ubuntu.com")
|
||||
|| uri.contains("ports.ubuntu.com")
|
||||
|| uri.contains("deb.debian.org")
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -303,6 +314,7 @@ mod tests {
|
||||
crate::deb::build_binary_package(
|
||||
arch,
|
||||
Some(series),
|
||||
None,
|
||||
Some(&cwd),
|
||||
cross,
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user