pxar: cleanup: s/PxarDirBuf/PxarDirStack/g and move dir_buffer.rs to dir_stack.rs
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
parent
ead7546a96
commit
fe076c8259
@ -68,7 +68,7 @@ pub use decoder::*;
|
|||||||
mod exclude_pattern;
|
mod exclude_pattern;
|
||||||
pub use exclude_pattern::*;
|
pub use exclude_pattern::*;
|
||||||
|
|
||||||
mod dir_buffer;
|
mod dir_stack;
|
||||||
pub use dir_buffer::*;
|
pub use dir_stack::*;
|
||||||
|
|
||||||
mod helper;
|
mod helper;
|
||||||
|
@ -17,7 +17,7 @@ pub struct PxarDir {
|
|||||||
pub dir: Option<nix::dir::Dir>,
|
pub dir: Option<nix::dir::Dir>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PxarDirBuf {
|
pub struct PxarDirStack {
|
||||||
root: RawFd,
|
root: RawFd,
|
||||||
data: Vec<PxarDir>,
|
data: Vec<PxarDir>,
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ impl PxarDir {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PxarDirBuf {
|
impl PxarDirStack {
|
||||||
pub fn new(parent: RawFd) -> Self {
|
pub fn new(parent: RawFd) -> Self {
|
||||||
Self {
|
Self {
|
||||||
root: parent,
|
root: parent,
|
@ -8,7 +8,7 @@ use endian_trait::Endian;
|
|||||||
use super::flags;
|
use super::flags;
|
||||||
use super::format_definition::*;
|
use super::format_definition::*;
|
||||||
use super::exclude_pattern::*;
|
use super::exclude_pattern::*;
|
||||||
use super::dir_buffer::*;
|
use super::dir_stack::*;
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
@ -626,7 +626,7 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F
|
|||||||
fn restore_dir(
|
fn restore_dir(
|
||||||
&mut self,
|
&mut self,
|
||||||
base_path: &Path,
|
base_path: &Path,
|
||||||
dirs: &mut PxarDirBuf,
|
dirs: &mut PxarDirStack,
|
||||||
entry: PxarEntry,
|
entry: PxarEntry,
|
||||||
filename: &OsStr,
|
filename: &OsStr,
|
||||||
matched: MatchType,
|
matched: MatchType,
|
||||||
@ -682,7 +682,7 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F
|
|||||||
let dir = nix::dir::Dir::open(path, nix::fcntl::OFlag::O_DIRECTORY, nix::sys::stat::Mode::empty())
|
let dir = nix::dir::Dir::open(path, nix::fcntl::OFlag::O_DIRECTORY, nix::sys::stat::Mode::empty())
|
||||||
.map_err(|err| format_err!("unable to open target directory {:?} - {}", path, err))?;
|
.map_err(|err| format_err!("unable to open target directory {:?} - {}", path, err))?;
|
||||||
let fd = dir.as_raw_fd();
|
let fd = dir.as_raw_fd();
|
||||||
let mut dirs = PxarDirBuf::new(fd);
|
let mut dirs = PxarDirStack::new(fd);
|
||||||
// An empty match pattern list indicates to restore the full archive.
|
// An empty match pattern list indicates to restore the full archive.
|
||||||
let matched = if match_pattern.len() == 0 {
|
let matched = if match_pattern.len() == 0 {
|
||||||
MatchType::Include
|
MatchType::Include
|
||||||
@ -722,7 +722,7 @@ impl <'a, R: Read, F: Fn(&Path) -> Result<(), Error>> SequentialDecoder<'a, R, F
|
|||||||
fn restore_dir_entry(
|
fn restore_dir_entry(
|
||||||
&mut self,
|
&mut self,
|
||||||
base_path: &Path,
|
base_path: &Path,
|
||||||
dirs: &mut PxarDirBuf,
|
dirs: &mut PxarDirStack,
|
||||||
filename: &OsStr,
|
filename: &OsStr,
|
||||||
parent_matched: MatchType,
|
parent_matched: MatchType,
|
||||||
match_pattern: &Vec<PxarExcludePattern>,
|
match_pattern: &Vec<PxarExcludePattern>,
|
||||||
|
Loading…
Reference in New Issue
Block a user