This commit is contained in:
shibazaki 2025-10-05 19:51:50 +02:00
parent d28f1d0032
commit 96713d5110
2 changed files with 4 additions and 7 deletions

View File

@ -27,7 +27,7 @@ pub fn load_sources(path: &str) -> io::Result<Vec<AptSource>> {
continue; continue;
} }
// Determine repository type let name = Some(format!("repo{}", counter));
let repo_type = match parts[0] { let repo_type = match parts[0] {
"deb" => RepoType::Bin, "deb" => RepoType::Bin,
"deb-src" => RepoType::Src, "deb-src" => RepoType::Src,
@ -37,15 +37,12 @@ pub fn load_sources(path: &str) -> io::Result<Vec<AptSource>> {
} }
}; };
// parts[1] = URI
// parts[2] = distribution (bookworm, trixie, etc.)
// parts[3..] = components
let uri = parts[1].to_string(); let uri = parts[1].to_string();
let debian_version = parts[2].to_string(); let debian_version = parts[2].to_string();
let components = parts[3..].iter().map(|s| s.to_string()).collect(); let components = parts[3..].iter().map(|s| s.to_string()).collect();
sources.push(AptSource { sources.push(AptSource {
name: Some(format!("repo{}", counter)), name,
bin_repo: repo_type, bin_repo: repo_type,
uri, uri,
debian_version, debian_version,

View File

@ -17,8 +17,8 @@ pub enum RepoType {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AptSource { pub struct AptSource {
pub name: Option<String>, // optional, not needed pub name: Option<String>, // optional, not needed
pub bin_repo: RepoType, // pub bin_repo: RepoType, // deb / deb-src
pub uri: String, // pub uri: String, // url src
pub debian_version: String, // bookworm, trixie etc. pub debian_version: String, // bookworm, trixie etc.
pub components: Vec<String>, // main, non-free-firmware etc. pub components: Vec<String>, // main, non-free-firmware etc.
} }