From ad85c259d40e2248f165d9303ff031cf1b7253e5 Mon Sep 17 00:00:00 2001 From: Soispha Peetz Date: Tue, 10 Nov 2026 16:47:52 +0100 Subject: pkgs/rollup: Really sort the patches by number I hope this works now. --- pkgs/by-name/ro/rollup/src/main.rs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'pkgs') diff --git a/pkgs/by-name/ro/rollup/src/main.rs b/pkgs/by-name/ro/rollup/src/main.rs index ed4e29b4..29746e07 100644 --- a/pkgs/by-name/ro/rollup/src/main.rs +++ b/pkgs/by-name/ro/rollup/src/main.rs @@ -144,19 +144,38 @@ fn main() -> Result<()> { return Ok(()); }; let patch_files = { + let iter = fs::read_dir(&patches_directory)?; + let mut output = vec![None; iter.count()]; + let iter = fs::read_dir(patches_directory)?; - let mut output = vec![]; for entry in iter { let entry = entry?; if !entry.file_type()?.is_file() { unreachable!("Should not be able to get non-files in patches directory"); } - output.push(entry.path()); + let path = entry.path(); + let idx: usize = { + let mut file_name = path + .file_name() + .expect("Should all have a filename") + .to_str() + .expect("Should be valid utf8") + .chars(); + let number = file_name.clone().take(4).collect::(); + assert_eq!(file_name.nth(4), Some('-')); + + number.parse().expect("Should parse as usize number") + }; + output[idx - 1] = Some(path); } output.sort(); output }; - apply_patches(patch_files, to, debug_parse)?; + apply_patches( + patch_files.into_iter().map(|s| s.unwrap()).collect(), + to, + debug_parse, + )?; } } -- cgit v1.3.1