src/pxar/encoder.rs: add new skip_lost_and_found parameter

This commit is contained in:
Dietmar Maurer
2019-07-24 12:21:25 +02:00
parent 6c3c9bceb5
commit 5b72c9b4f7
5 changed files with 20 additions and 8 deletions

View File

@ -79,6 +79,7 @@ impl <'a, W: Write> Encoder<'a, W> {
writer: &'a mut W,
device_set: Option<HashSet<u64>>,
verbose: bool,
skip_lost_and_found: bool, // fixme: should be a feature flag ??
feature_flags: u64,
) -> Result<(), Error> {
@ -127,7 +128,11 @@ impl <'a, W: Write> Encoder<'a, W> {
if verbose { println!("{:?}", me.full_path()); }
me.encode_dir(dir, &stat, magic, Vec::new())?;
let mut excludes = Vec::new();
if skip_lost_and_found {
excludes.push(PxarExcludePattern::from_line(b"**/lost+found").unwrap().unwrap());
}
me.encode_dir(dir, &stat, magic, excludes)?;
Ok(())
}