diff --git a/src/loaders/sources.rs b/src/loaders/sources.rs index 486fe2d..5921c52 100644 --- a/src/loaders/sources.rs +++ b/src/loaders/sources.rs @@ -27,7 +27,7 @@ pub fn load_sources(path: &str) -> io::Result> { continue; } - // Determine repository type + let name = Some(format!("repo{}", counter)); let repo_type = match parts[0] { "deb" => RepoType::Bin, "deb-src" => RepoType::Src, @@ -37,15 +37,12 @@ pub fn load_sources(path: &str) -> io::Result> { } }; - // parts[1] = URI - // parts[2] = distribution (bookworm, trixie, etc.) - // parts[3..] = components let uri = parts[1].to_string(); let debian_version = parts[2].to_string(); let components = parts[3..].iter().map(|s| s.to_string()).collect(); sources.push(AptSource { - name: Some(format!("repo{}", counter)), + name, bin_repo: repo_type, uri, debian_version, diff --git a/src/structs.rs b/src/structs.rs index 911e590..460ad6e 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -17,8 +17,8 @@ pub enum RepoType { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AptSource { pub name: Option, // optional, not needed - pub bin_repo: RepoType, // - pub uri: String, // + pub bin_repo: RepoType, // deb / deb-src + pub uri: String, // url src pub debian_version: String, // bookworm, trixie etc. pub components: Vec, // main, non-free-firmware etc. }