Extra features and fixes #1

Merged
matteo merged 3 commits from arthurep/sysroot-cleaner:extra-features into main 2025-03-19 21:29:34 +01:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit 266a00d983 - Show all commits

View file

@ -41,13 +41,15 @@ pub struct Args {
pub split_to: Option<PathBuf>,
/// An allowlist of files to keep, in .gitignore format.
/// Can be passed multiple times.
/// Note: this will take precedence over all other removal decisions.
#[arg(long, value_parser = AbsolutePathBufValueParser::default())]
pub allowlist: Option<PathBuf>,
pub allowlist: Vec<PathBuf>,
/// A blocklist of files to remove, in .gitignore format.
/// Can be passed multiple times.
#[arg(long)]
pub blocklist: Option<PathBuf>,
pub blocklist: Vec<PathBuf>,
/// An optional path to save the file graph of the DSO cleaner
/// in GraphViz format. Useful for debugging.

View file

@ -41,11 +41,11 @@ impl Runner {
let removal_fn = Self::new_removal_fn(&args);
let mut cleaners: Cleaners = vec![];
if let Some(wl) = args.allowlist {
for wl in args.allowlist {
cleaners.push(Box::new(ListCleaner::new(list::ListType::Allow, wl)));
}
if let Some(bl) = args.blocklist {
for bl in args.blocklist {
cleaners.push(Box::new(ListCleaner::new(list::ListType::Block, bl)));
}