-
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 missing some guesswork logic in rpm_ostreerefspec_classify(). Alternatively (ideally), guess once and store the type in origin, then pass origin around to all places that currently needs to call rpmostree_refspec_classify(), e.g. rpmostree_origin_set_rebase_custom() and change_origin_refspec() ... or smth along these lines, will need to investigate a bit more. Also need to write new ostree ref in deploy_transaction_execute()
- Loading branch information
1 parent
726ec79
commit c8b1487
Showing
9 changed files
with
169 additions
and
25 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