add support for yaml and json manifests

This commit is contained in:
Aiden McClelland
2021-07-19 13:50:21 -06:00
committed by Aiden McClelland
parent a14820087d
commit 48c33be14c
5 changed files with 38 additions and 17 deletions

View File

@@ -355,7 +355,7 @@ pub async fn install_s9pk<R: AsyncRead + AsyncSeek + Unpin>(
.await?;
log::info!("Install {}@{}: Unpacked Docker Images", pkg_id, version,);
progress.read_complete.store(true, Ordering::SeqCst);
progress.unpack_complete.store(true, Ordering::SeqCst);
progress_model.put(&mut ctx.db.handle(), &progress).await?;

View File

@@ -21,8 +21,8 @@ pub struct InstallProgress {
pub download_complete: AtomicBool,
pub validated: AtomicU64,
pub validation_complete: AtomicBool,
pub read: AtomicU64,
pub read_complete: AtomicBool,
pub unpacked: AtomicU64,
pub unpack_complete: AtomicBool,
}
impl InstallProgress {
pub fn new(size: Option<u64>) -> Arc<Self> {
@@ -32,8 +32,8 @@ impl InstallProgress {
download_complete: AtomicBool::new(false),
validated: AtomicU64::new(0),
validation_complete: AtomicBool::new(false),
read: AtomicU64::new(0),
read_complete: AtomicBool::new(false),
unpacked: AtomicU64::new(0),
unpack_complete: AtomicBool::new(false),
})
}
pub fn download_complete(&self) {
@@ -182,7 +182,7 @@ impl<R: AsyncRead> AsyncRead for InstallProgressTracker<R> {
if *this.validating {
&this.progress.validated
} else {
&this.progress.read
&this.progress.unpacked
}
.fetch_add(buf.filled().len() as u64 - prev, Ordering::SeqCst);
@@ -204,7 +204,7 @@ impl<R: AsyncSeek> AsyncSeek for InstallProgressTracker<R> {
if *this.validating {
&this.progress.validated
} else {
&this.progress.read
&this.progress.unpacked
}
.store(n, Ordering::SeqCst);
Poll::Ready(Ok(n))