pxar: cleanup: refactor and rename exclude pattern

The original name PxarExcludePattern makes no sense anymore as the patterns are
also used to match filenames during restore of the archive.

Therefore, exclude_pattern.rs is moved to match_pattern.rs and PxarExcludePattern
rename to MatchPattern.
Further, since it makes more sense the MatchTypes are now declared as None,
Positive, Negative, PartialPositive or PartialNegative, as this makes more sense
and seems more readable.
Positive matches are those without '!' prefix, Negatives with '!' prefix.

This makes also the filename matching in the encoder/decoder more intuitive and
the logic was adapted accordingly.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner
2019-08-02 17:02:24 +02:00
committed by Dietmar Maurer
parent fe076c8259
commit 4d142ea79e
5 changed files with 93 additions and 92 deletions

View File

@ -65,8 +65,8 @@ pub use sequential_decoder::*;
mod decoder;
pub use decoder::*;
mod exclude_pattern;
pub use exclude_pattern::*;
mod match_pattern;
pub use match_pattern::*;
mod dir_stack;
pub use dir_stack::*;