diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/pipeline/dispatch.rs | 6 | ||||
| -rw-r--r-- | src/pipeline/mod.rs | 14 | ||||
| -rw-r--r-- | src/pipeline/publish.rs | 2 | ||||
| -rw-r--r-- | src/pipeline/steps.rs | 2 | ||||
| -rw-r--r-- | src/sandbox/kata.rs | 6 | ||||
| -rw-r--r-- | src/sandbox/loopback.rs | 2 | ||||
| -rw-r--r-- | src/sandbox/mod.rs | 4 | ||||
| -rw-r--r-- | src/sandbox/wire.rs | 2 | ||||
| -rw-r--r-- | src/shims/mod.rs | 26 |
9 files changed, 32 insertions, 32 deletions
diff --git a/src/pipeline/dispatch.rs b/src/pipeline/dispatch.rs index 35fe646..8e35f0a 100644 --- a/src/pipeline/dispatch.rs +++ b/src/pipeline/dispatch.rs @@ -89,7 +89,7 @@ pub fn dispatch_once(cfg: &Config, db: &Db, tx: &Sender<String>) -> Vec<String> } #[cfg(not(feature = "test-support"))] -pub(crate) fn dispatch_once(cfg: &Config, db: &Db, tx: &Sender<String>) -> Vec<String> { +fn dispatch_once(cfg: &Config, db: &Db, tx: &Sender<String>) -> Vec<String> { dispatch_once_impl(cfg, db, tx) } @@ -132,7 +132,7 @@ pub fn admissible(cfg: &Config, db: &Db) -> usize { } #[cfg(not(feature = "test-support"))] -pub(crate) fn admissible(cfg: &Config, db: &Db) -> usize { +fn admissible(cfg: &Config, db: &Db) -> usize { admissible_impl(cfg, db) } @@ -159,7 +159,7 @@ pub fn free_disk_mb(path: &std::path::Path) -> u64 { } #[cfg(not(feature = "test-support"))] -pub(crate) fn free_disk_mb(path: &std::path::Path) -> u64 { +fn free_disk_mb(path: &std::path::Path) -> u64 { free_disk_mb_impl(path) } diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index e571d71..3e63a69 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -25,7 +25,7 @@ pub(crate) struct SourceIdentity { } impl SourceIdentity { - pub(crate) fn from_candidate(c: &CandidateRow, snapshot: &SnapshotRow) -> Self { + fn from_candidate(c: &CandidateRow, snapshot: &SnapshotRow) -> Self { Self { aur_commit: snapshot.aur_commit.clone(), recipe_hash: snapshot.recipe_hash.clone(), @@ -36,7 +36,7 @@ impl SourceIdentity { pkgrel: c.pkgrel.clone(), } } - pub(crate) fn from_release(r: &ReleaseRow) -> Self { + fn from_release(r: &ReleaseRow) -> Self { Self { aur_commit: r.aur_commit.clone(), recipe_hash: r.recipe_hash.clone(), @@ -53,7 +53,7 @@ impl SourceIdentity { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub(crate) struct CollectedPkg { +struct CollectedPkg { pub name: String, pub version: String, pub arch: String, @@ -69,7 +69,7 @@ pub(crate) struct CollectedPkg { } #[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)] -pub(crate) struct Collect { +struct Collect { pub packages: Vec<CollectedPkg>, } @@ -154,7 +154,7 @@ impl Ctx { self.backend.acquire(&spec) } - pub(crate) fn log_line(&self, line: &str) { + fn log_line(&self, line: &str) { use std::io::Write; if let Some(parent) = self.log.parent() { let _ = std::fs::create_dir_all(parent); @@ -195,7 +195,7 @@ pub fn run_with(ctx: &Ctx) -> Result<Outcome> { } #[cfg(not(feature = "test-support"))] -pub(crate) fn run_with(ctx: &Ctx) -> Result<Outcome> { +fn run_with(ctx: &Ctx) -> Result<Outcome> { run_with_impl(ctx) } @@ -299,7 +299,7 @@ pub fn enqueue_manual_rebuild(cfg: &Config, db: &Db, pkgbase: &str) -> Result<St Ok(id) } -pub(crate) enum StepResult { +enum StepResult { Done(Option<String>), Skipped(String), Blocked(Vec<String>), diff --git a/src/pipeline/publish.rs b/src/pipeline/publish.rs index 332e673..d22b833 100644 --- a/src/pipeline/publish.rs +++ b/src/pipeline/publish.rs @@ -232,7 +232,7 @@ fn commit_release(ctx: &Ctx, collect: &Collect) -> Result<i64> { }) } -pub(crate) fn sweep_render_dirs(arch_dir: &Path) { +fn sweep_render_dirs(arch_dir: &Path) { let Ok(entries) = std::fs::read_dir(arch_dir) else { return; }; diff --git a/src/pipeline/steps.rs b/src/pipeline/steps.rs index ebb50c5..775485d 100644 --- a/src/pipeline/steps.rs +++ b/src/pipeline/steps.rs @@ -454,7 +454,7 @@ fn publish(ctx: &Ctx) -> Result<StepResult> { use std::path::PathBuf; -pub(crate) fn recipe_at(dir: &Path) -> Result<Recipe> { +fn recipe_at(dir: &Path) -> Result<Recipe> { let mut files = std::collections::BTreeMap::new(); for entry in walkdir::WalkDir::new(dir).max_depth(2).into_iter().filter_map(|e| e.ok()) { let p = entry.path(); diff --git a/src/sandbox/kata.rs b/src/sandbox/kata.rs index a54110a..cfc3bd6 100644 --- a/src/sandbox/kata.rs +++ b/src/sandbox/kata.rs @@ -40,7 +40,7 @@ pub trait Provisioner: Send + Sync { /// TTL even if the hub dies. The token rides in args for v1; a production /// deployment should mount it from a Secret, and this comment is the honest /// place that says so. -pub(crate) fn sandbox_cr(req: &ProvisionRequest) -> serde_json::Value { +fn sandbox_cr(req: &ProvisionRequest) -> serde_json::Value { serde_json::json!({ "apiVersion": "agents.x-k8s.io/v1alpha1", "kind": "Sandbox", @@ -75,7 +75,7 @@ pub(crate) fn sandbox_cr(req: &ProvisionRequest) -> serde_json::Value { } impl K8sSandboxProvisioner { - pub(crate) fn for_config(cfg: &Config) -> Option<Self> { + fn for_config(cfg: &Config) -> Option<Self> { match &cfg.sandbox { crate::config::Sandbox::AgentSandbox { api, namespace, bearer, .. } => Some(Self { api: api.clone(), @@ -87,7 +87,7 @@ impl K8sSandboxProvisioner { } } -pub(crate) struct K8sSandboxProvisioner { +struct K8sSandboxProvisioner { pub api: String, pub bearer: String, pub namespace: String, diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs index fb5ba00..64875c6 100644 --- a/src/sandbox/loopback.rs +++ b/src/sandbox/loopback.rs @@ -57,7 +57,7 @@ impl SandboxBackend for LoopbackBackend { } } -pub(crate) struct LoopbackSandbox { +struct LoopbackSandbox { id: String, blobs: PathBuf, cfg: Config, diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs index b82647b..bb6ab60 100644 --- a/src/sandbox/mod.rs +++ b/src/sandbox/mod.rs @@ -123,12 +123,12 @@ pub fn backend_for(cfg: &Config) -> Result<Arc<dyn SandboxBackend>> { } #[derive(Clone)] -pub(crate) struct Bound { +struct Bound { pub local: String, pub rx: Receiver<TcpStream>, } -pub(crate) fn bound_listener(addr: &str, token: &str) -> Result<Bound> { +fn bound_listener(addr: &str, token: &str) -> Result<Bound> { static REGISTRY: OnceLock<Mutex<HashMap<(String, String), Bound>>> = OnceLock::new(); let registry = REGISTRY.get_or_init(|| Mutex::new(HashMap::new())); let key = (addr.to_string(), token.to_string()); diff --git a/src/sandbox/wire.rs b/src/sandbox/wire.rs index ae89d6d..4ae1ec0 100644 --- a/src/sandbox/wire.rs +++ b/src/sandbox/wire.rs @@ -2,7 +2,7 @@ use std::io::{self, BufRead, Write}; use serde::{Deserialize, Serialize}; -pub(crate) const MAX_FRAME_BYTES: u32 = 2 * 1024 * 1024 * 1024; +const MAX_FRAME_BYTES: u32 = 2 * 1024 * 1024 * 1024; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(tag = "t", rename_all = "snake_case")] diff --git a/src/shims/mod.rs b/src/shims/mod.rs index 8e6e231..a918515 100644 --- a/src/shims/mod.rs +++ b/src/shims/mod.rs @@ -42,7 +42,7 @@ impl Default for FakePackage { } impl FakePackage { - pub(crate) fn split_version(&self) -> (String, String) { + fn split_version(&self) -> (String, String) { match self.version.rsplit_once('-') { Some((v, r)) => (v.to_string(), r.to_string()), None => (self.version.clone(), "1".into()), @@ -98,7 +98,7 @@ pub fn manifest() -> Manifest { } #[cfg(not(feature = "test-support"))] -pub(crate) fn manifest() -> Manifest { +fn manifest() -> Manifest { manifest_impl() } @@ -113,7 +113,7 @@ fn manifest_impl() -> Manifest { } /// Called by `run` to log the invocation; nothing outside `shims` records a shim call. -pub(crate) fn record(tool: &str, args: &[String]) { +fn record(tool: &str, args: &[String]) { let dir = match std::env::var("AUR_SHIM_DIR") { Ok(d) => d, Err(_) => return, @@ -211,7 +211,7 @@ pub fn run(tool: &str) -> i32 { } /// Reached only through `run`, which matches the tool name to it. The tool name appears in test strings, which is not a caller. -pub(crate) fn mkarchroot(args: &[String]) -> Result<i32, String> { +fn mkarchroot(args: &[String]) -> Result<i32, String> { let mut target = None; let mut skip = false; for a in args { @@ -235,7 +235,7 @@ pub(crate) fn mkarchroot(args: &[String]) -> Result<i32, String> { } /// Reached only through `run`, which matches the tool name to it. The tool name appears in test strings, which is not a caller. -pub(crate) fn makechrootpkg(args: &[String], m: &Manifest) -> Result<i32, String> { +fn makechrootpkg(args: &[String], m: &Manifest) -> Result<i32, String> { if !args.iter().any(|a| a == "-r") { return Err("makechrootpkg: expected -r <chroot>".into()); } @@ -243,7 +243,7 @@ pub(crate) fn makechrootpkg(args: &[String], m: &Manifest) -> Result<i32, String emit_packages(m, "makechrootpkg", wants_sig) } -pub(crate) fn emit_packages(m: &Manifest, tool: &str, wants_sig: bool) -> Result<i32, String> { +fn emit_packages(m: &Manifest, tool: &str, wants_sig: bool) -> Result<i32, String> { for l in &m.log_lines { println!("{l}"); } @@ -323,7 +323,7 @@ fn packages_to_emit(m: &Manifest, startdir: &Path) -> Vec<FakePackage> { } } -pub(crate) fn write_package(dir: &Path, p: &FakePackage, m: &Manifest) -> Result<PathBuf, String> { +fn write_package(dir: &Path, p: &FakePackage, m: &Manifest) -> Result<PathBuf, String> { let (pkgver, pkgrel) = p.split_version(); let filename = format!("{}-{}-{}.pkg.tar.zst", p.name, p.version, p.arch); let path = dir.join(&filename); @@ -414,7 +414,7 @@ fn fake_sig(bytes: &[u8]) -> Vec<u8> { } /// Reached only through `run`, which matches the tool name to it. The tool name appears in test strings, which is not a caller. -pub(crate) fn makepkg(args: &[String], m: &Manifest) -> Result<i32, String> { +fn makepkg(args: &[String], m: &Manifest) -> Result<i32, String> { if args.iter().any(|a| a == "--vercheck" || a == "-V-check") { let v = m.vercheck.clone().unwrap_or_else(|| "1.0-1".into()); println!("{v}"); @@ -464,7 +464,7 @@ pub(crate) fn makepkg(args: &[String], m: &Manifest) -> Result<i32, String> { } /// Reached only through `run`, which matches the tool name to it. The tool name appears in test strings, which is not a caller. -pub(crate) fn pacman(args: &[String]) -> Result<i32, String> { +fn pacman(args: &[String]) -> Result<i32, String> { if args.iter().any(|a| a == "-U") { for path in args.iter().filter(|a| !a.starts_with('-')) { let p = std::path::Path::new(path); @@ -505,7 +505,7 @@ fn installed_db() -> Option<std::path::PathBuf> { std::env::var("AUR_SHIM_DIR").ok().map(|d| std::path::Path::new(&d).join("installed.txt")) } -pub(crate) const DB_SUFFIXES: [&str; 5] = [ +const DB_SUFFIXES: [&str; 5] = [ ".db.tar", ".db.tar.gz", ".db.tar.zst", @@ -523,7 +523,7 @@ pub fn valid_db_arg(p: &Path) -> bool { } #[cfg(not(feature = "test-support"))] -pub(crate) fn valid_db_arg(p: &Path) -> bool { +fn valid_db_arg(p: &Path) -> bool { valid_db_arg_impl(p) } @@ -538,7 +538,7 @@ fn valid_db_arg_impl(p: &Path) -> bool { .any(|sfx| name.ends_with(sfx)) } -pub(crate) fn repo_add(args: &[String], _m: &Manifest) -> Result<i32, String> { +fn repo_add(args: &[String], _m: &Manifest) -> Result<i32, String> { let mut positional: Vec<&String> = Vec::new(); let mut skip = false; for a in args { @@ -633,7 +633,7 @@ fn pkginfo_fields(pkg_bytes: &[u8]) -> Result<(String, String, String, String), } /// Reached only through `run`, which matches the tool name to it. The tool name appears in test strings, which is not a caller. -pub(crate) fn gpg(args: &[String]) -> Result<i32, String> { +fn gpg(args: &[String]) -> Result<i32, String> { let out = args .iter() .position(|a| a == "--output" || a == "-o") |
