pub fn traverse_etc(
pristine_etc: &Dir,
current_etc: &Dir,
new_etc: Option<&Dir>,
) -> Result<(Directory<CustomMetadata>, Directory<CustomMetadata>, Option<Directory<CustomMetadata>>)>Expand description
Traverses and collects directory trees for three etc states.
Recursively walks through the given pristine, current, and new etc directories, building filesystem trees that capture files, directories, and symlinks. Device files, sockets, pipes etc are ignored
It is primarily used to prepare inputs for later diff computations and comparisons between different etc states.
§Arguments
-
pristine_etc- The reference directory representing the unmodified version or current /etc. Usually this will be obtained by remounting the EROFS image to a temporary location -
current_etc- The current/etcdirectory -
new_etc- The directory representing the/etcdirectory for a new deployment. This will again be usually obtained by mounting the new EROFS image to a temporary location. If merging it will be necessary to make the/etcfor the deployment writeable
§Returns
anyhow::Result containing a tuple of directory trees in the order:
pristine_etc_files– Dirtree of the pristine etc statecurrent_etc_files– Dirtree of the current etc statenew_etc_files– Dirtree of the new etc state (if new_etc directory is passed)