-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still need to handle write new ostree ref in deploy_transaction_execute()
- Loading branch information
1 parent
726ec79
commit 8691fe4
Showing
10 changed files
with
194 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Rust portion of `rpmostree-sysroot-upgrader.cxx`. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
use crate::cxxrsutil::*; | ||
use anyhow::{Context, Result}; | ||
use std::convert::TryInto; | ||
use std::pin::Pin; | ||
|
||
/// Import ostree commit in container image using ostree-rs-ext's API. | ||
pub fn import_container( | ||
mut sysroot: Pin<&mut crate::FFIOstreeSysroot>, | ||
imgref: String, | ||
) -> Result<String> { | ||
let sysroot = &sysroot.gobj_wrap(); | ||
let repo = &sysroot.get_repo(gio::NONE_CANCELLABLE)?; | ||
let imgref = imgref.as_str().try_into()?; | ||
let commit = build_runtime()? | ||
.block_on(async { ostree_ext::container::import(&repo, &imgref, None).await })?; | ||
Ok(commit.ostree_commit) | ||
} | ||
|
||
fn build_runtime() -> Result<tokio::runtime::Runtime> { | ||
tokio::runtime::Builder::new_multi_thread() | ||
.enable_all() | ||
.build() | ||
.context("Failed to build tokio runtime") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.