pull: refactor to remove series argument
All checks were successful
CI / build (push) Successful in 9m31s
All checks were successful
CI / build (push) Successful in 9m31s
This commit is contained in:
@@ -56,7 +56,8 @@ fn parse_series_csv(content: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
Ok(entries.into_iter().map(|(s, _)| s).collect())
|
||||
}
|
||||
|
||||
async fn get_ordered_series(dist: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
/// Get time-ordered list of series for a distribution, development series first
|
||||
pub async fn get_ordered_series(dist: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
let content = if Path::new(format!("/usr/share/distro-info/{dist}.csv").as_str()).exists() {
|
||||
std::fs::read_to_string(format!("/usr/share/distro-info/{dist}.csv"))?
|
||||
} else {
|
||||
@@ -71,9 +72,8 @@ async fn get_ordered_series(dist: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
|
||||
let mut series = parse_series_csv(&content)?;
|
||||
|
||||
// For Debian, ensure 'sid' is first if it's not (it usually doesn't have a date or is very old/new depending on file)
|
||||
// Actually in the file sid has 1993 date.
|
||||
// But we want to try 'sid' (unstable) first for Debian.
|
||||
// For Debian, ensure 'sid' is first if it's not
|
||||
// We want to try 'sid' (unstable) first for Debian.
|
||||
if dist == "debian" {
|
||||
series.retain(|s| s != "sid");
|
||||
series.insert(0, "sid".to_string());
|
||||
|
||||
Reference in New Issue
Block a user