Skip to content

Commit

Permalink
feat(oma-refresh): add Deb822 sources.list support
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed May 5, 2024
1 parent 101f37b commit cec0b38
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion oma-refresh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tokio = { version = "1.28", default_features = false, features = ["fs"] }
serde_yaml = "0.9"
once_cell = "1.18"
futures = "0.3"
oma-apt-sources-lists = "0.2"
oma-apt-sources-lists = "0.3"
oma-debcontrol = "0.3"
sequoia-openpgp = { version = "1.20", default-features = false }
anyhow = "1.0"
Expand Down
15 changes: 12 additions & 3 deletions oma-refresh/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,18 @@ pub fn get_sources<P: AsRef<Path>>(sysroot: P) -> Result<Vec<OmaSourceEntry>> {
let list = SourcesLists::scan_from_root(sysroot).map_err(RefreshError::ScanSourceError)?;

for file in list.iter() {
for i in &file.lines {
if let SourceLine::Entry(entry) = i {
res.push(OmaSourceEntry::new(entry)?);
match file.entries {
oma_apt_sources_lists::SourceListType::SourceLine(ref lines) => {
for i in lines {
if let SourceLine::Entry(entry) = i {
res.push(OmaSourceEntry::new(&entry)?);

Check warning on line 166 in oma-refresh/src/db.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> oma-refresh/src/db.rs:166:54 | 166 | res.push(OmaSourceEntry::new(&entry)?); | ^^^^^^ help: change this to: `entry` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
}
}
}
oma_apt_sources_lists::SourceListType::Deb822(ref e) => {
for i in &e.entries {
res.push(OmaSourceEntry::new(&i)?);

Check warning on line 172 in oma-refresh/src/db.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> oma-refresh/src/db.rs:172:50 | 172 | res.push(OmaSourceEntry::new(&i)?); | ^^ help: change this to: `i` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
}
}
}
}
Expand Down

0 comments on commit cec0b38

Please sign in to comment.