refactor(tvix/castore): switch to ingest_entries for tarball ingestion

With `ingest_entries` being more generalized, we can now use it for
ingesting the directory entries generated from tarballs.

Change-Id: Ie1f7a915c456045762e05fcc9af45771f121eb43
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11489
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
This commit is contained in:
Connor Brewster 2024-04-20 09:19:05 -05:00 committed by clbot
parent 49b63fceee
commit fa69becf4d
3 changed files with 242 additions and 131 deletions

View file

@ -1,6 +1,6 @@
use std::{fs::FileType, path::PathBuf};
use crate::{proto::ValidateDirectoryError, Error as CastoreError};
use crate::Error as CastoreError;
#[derive(Debug, thiserror::Error)]
pub enum Error {
@ -25,11 +25,14 @@ pub enum Error {
#[error("unsupported file {0} type: {1:?}")]
UnsupportedFileType(PathBuf, FileType),
#[error("invalid directory contents {0}: {1}")]
InvalidDirectory(PathBuf, ValidateDirectoryError),
#[error("unsupported tar entry {0} type: {1:?}")]
UnsupportedTarEntry(PathBuf, tokio_tar::EntryType),
#[error("symlink missing target {0}")]
MissingSymlinkTarget(PathBuf),
#[error("unexpected number of top level directory entries")]
UnexpectedNumberOfTopLevelEntries,
}
impl From<CastoreError> for Error {