rust/ostree: regenerate for gtk-rs 0.15
This commit is contained in:
43 files changed
+4208
-1168
No files matched your search
@@ -1,5 +1,4 @@
|
||||
use crate::util::TestRepo;
|
||||
use gio::NONE_CANCELLABLE;
|
||||
use ostree::{checksum_file_from_input, ObjectType};
|
||||
|
||||
#[test]
|
||||
@@ -13,7 +12,7 @@ fn list_repo_objects() {
|
||||
|
||||
let objects = repo
|
||||
.repo
|
||||
.list_objects(ffi::OSTREE_REPO_LIST_OBJECTS_ALL, NONE_CANCELLABLE)
|
||||
.list_objects(ffi::OSTREE_REPO_LIST_OBJECTS_ALL, gio::Cancellable::NONE)
|
||||
.expect("List Objects");
|
||||
for (object, _items) in objects {
|
||||
match object.object_type() {
|
||||
@@ -48,7 +47,7 @@ fn should_checksum_file_from_input() {
|
||||
|
||||
let objects = repo
|
||||
.repo
|
||||
.traverse_commit(&commit_checksum, -1, NONE_CANCELLABLE)
|
||||
.traverse_commit(&commit_checksum, -1, gio::Cancellable::NONE)
|
||||
.expect("traverse commit");
|
||||
for obj in objects {
|
||||
if obj.object_type() != ObjectType::File {
|
||||
@@ -56,14 +55,14 @@ fn should_checksum_file_from_input() {
|
||||
}
|
||||
let (stream, file_info, xattrs) = repo
|
||||
.repo
|
||||
.load_file(obj.checksum(), NONE_CANCELLABLE)
|
||||
.load_file(obj.checksum(), gio::Cancellable::NONE)
|
||||
.expect("load file");
|
||||
let result = checksum_file_from_input(
|
||||
&file_info,
|
||||
Some(&xattrs),
|
||||
stream.as_ref(),
|
||||
ObjectType::File,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("checksum file from input");
|
||||
assert_eq!(result.to_string(), obj.checksum());
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use crate::util::*;
|
||||
use gio::NONE_CANCELLABLE;
|
||||
use ostree::*;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
|
||||
@@ -17,7 +16,7 @@ fn should_checkout_at_with_none_options() {
|
||||
dirfd.as_raw_fd(),
|
||||
"test-checkout",
|
||||
&checksum,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("checkout at");
|
||||
|
||||
@@ -38,7 +37,7 @@ fn should_checkout_at_with_default_options() {
|
||||
dirfd.as_raw_fd(),
|
||||
"test-checkout",
|
||||
&checksum,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("checkout at");
|
||||
|
||||
@@ -65,7 +64,7 @@ fn should_checkout_at_with_options() {
|
||||
dirfd.as_raw_fd(),
|
||||
"test-checkout",
|
||||
&checksum,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("checkout at");
|
||||
|
||||
@@ -98,7 +97,7 @@ fn should_checkout_at_with_filter() {
|
||||
dirfd.as_raw_fd(),
|
||||
"test-checkout",
|
||||
&checksum,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("checkout at");
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use crate::util::*;
|
||||
use gio::NONE_CANCELLABLE;
|
||||
use ostree::glib::prelude::*;
|
||||
use ostree::glib::Variant;
|
||||
use ostree::*;
|
||||
@@ -36,7 +35,7 @@ fn should_generate_static_delta_at() {
|
||||
&to,
|
||||
None,
|
||||
Some(varopts),
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("static delta generate");
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use crate::util::*;
|
||||
use ostree::gio::NONE_CANCELLABLE;
|
||||
use ostree::prelude::*;
|
||||
use ostree::{ObjectName, ObjectType};
|
||||
|
||||
@@ -19,9 +18,9 @@ fn should_commit_content_to_repo_and_list_refs_again() {
|
||||
assert_eq!(test_repo.repo.require_rev("test").unwrap(), checksum);
|
||||
|
||||
let repo = ostree::Repo::new_for_path(test_repo.dir.path());
|
||||
repo.open(NONE_CANCELLABLE).expect("OSTree test_repo");
|
||||
repo.open(gio::Cancellable::NONE).expect("OSTree test_repo");
|
||||
let refs = repo
|
||||
.list_refs(None, NONE_CANCELLABLE)
|
||||
.list_refs(None, gio::Cancellable::NONE)
|
||||
.expect("failed to list refs");
|
||||
assert_eq!(1, refs.len());
|
||||
assert_eq!(checksum, refs["test"]);
|
||||
@@ -29,7 +28,7 @@ fn should_commit_content_to_repo_and_list_refs_again() {
|
||||
|
||||
#[test]
|
||||
fn list_commits() {
|
||||
let cancellable = gio::NONE_CANCELLABLE;
|
||||
let cancellable = ostree::gio::Cancellable::NONE;
|
||||
let test_repo = TestRepo::new();
|
||||
|
||||
for prefix in [None, Some("a"), Some("0abcde")] {
|
||||
@@ -72,7 +71,7 @@ fn cap_std_commit() {
|
||||
|
||||
let repo2 = ostree::Repo::open_at_dir(&test_repo.dir, ".").unwrap();
|
||||
let refs = repo2
|
||||
.list_refs(None, NONE_CANCELLABLE)
|
||||
.list_refs(None, gio::Cancellable::NONE)
|
||||
.expect("failed to list refs");
|
||||
assert_eq!(1, refs.len());
|
||||
assert_eq!(checksum, refs["test"]);
|
||||
@@ -85,7 +84,7 @@ fn repo_traverse_and_read() {
|
||||
|
||||
let objects = test_repo
|
||||
.repo
|
||||
.traverse_commit(&checksum, -1, NONE_CANCELLABLE)
|
||||
.traverse_commit(&checksum, -1, gio::Cancellable::NONE)
|
||||
.expect("traverse commit");
|
||||
|
||||
assert_eq!(
|
||||
@@ -122,7 +121,7 @@ fn repo_traverse_and_read() {
|
||||
.repo
|
||||
.query_file(
|
||||
"89f84ca9854a80e85b583e46a115ba4985254437027bad34f0b113219323d3f8",
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(finfo.size(), 5);
|
||||
@@ -136,13 +135,13 @@ fn should_checkout_tree() {
|
||||
let checkout_dir = tempfile::tempdir().expect("checkout dir");
|
||||
let file = test_repo
|
||||
.repo
|
||||
.read_commit("test", NONE_CANCELLABLE)
|
||||
.read_commit("test", gio::Cancellable::NONE)
|
||||
.expect("read commit")
|
||||
.0
|
||||
.downcast::<ostree::RepoFile>()
|
||||
.expect("RepoFile");
|
||||
let info = file
|
||||
.query_info("*", gio::FileQueryInfoFlags::NONE, NONE_CANCELLABLE)
|
||||
.query_info("*", gio::FileQueryInfoFlags::NONE, gio::Cancellable::NONE)
|
||||
.expect("file info");
|
||||
test_repo
|
||||
.repo
|
||||
@@ -152,7 +151,7 @@ fn should_checkout_tree() {
|
||||
&gio::File::for_path(checkout_dir.path().join("test-checkout")),
|
||||
&file,
|
||||
&info,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("checkout tree");
|
||||
|
||||
@@ -168,7 +167,7 @@ fn should_write_content_to_repo() {
|
||||
let dest = TestRepo::new();
|
||||
let objects = src
|
||||
.repo
|
||||
.traverse_commit(&checksum, -1, NONE_CANCELLABLE)
|
||||
.traverse_commit(&checksum, -1, gio::Cancellable::NONE)
|
||||
.expect("traverse");
|
||||
for obj in objects {
|
||||
match obj.object_type() {
|
||||
@@ -192,11 +191,11 @@ fn repo_file() {
|
||||
fn copy_file(src: &TestRepo, dest: &TestRepo, obj: &ObjectName) {
|
||||
let (stream, len) = src
|
||||
.repo
|
||||
.load_object_stream(obj.object_type(), obj.checksum(), NONE_CANCELLABLE)
|
||||
.load_object_stream(obj.object_type(), obj.checksum(), gio::Cancellable::NONE)
|
||||
.expect("load object stream");
|
||||
let out_csum = dest
|
||||
.repo
|
||||
.write_content(None, &stream, len, NONE_CANCELLABLE)
|
||||
.write_content(None, &stream, len, gio::Cancellable::NONE)
|
||||
.expect("write content");
|
||||
assert_eq!(out_csum.to_string(), obj.checksum());
|
||||
}
|
||||
@@ -208,7 +207,7 @@ fn copy_metadata(src: &TestRepo, dest: &TestRepo, obj: &ObjectName) {
|
||||
.expect("load variant");
|
||||
let out_csum = dest
|
||||
.repo
|
||||
.write_metadata(obj.object_type(), None, &data, NONE_CANCELLABLE)
|
||||
.write_metadata(obj.object_type(), None, &data, gio::Cancellable::NONE)
|
||||
.expect("write metadata");
|
||||
assert_eq!(out_csum.to_string(), obj.checksum());
|
||||
}
|
||||
@@ -13,7 +13,7 @@ fn sign_api_should_work() {
|
||||
let result = ostree::prelude::SignExt::data(
|
||||
&dummy_sign,
|
||||
&glib::Bytes::from_static(b"1234"),
|
||||
gio::NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
);
|
||||
assert!(result.is_err());
|
||||
|
||||
@@ -61,7 +61,7 @@ echo $ED25519SECRET > ed25519.secret
|
||||
|
||||
let payload = &glib::Bytes::from_static(b"1234");
|
||||
|
||||
let signature = signer.data(payload, gio::NONE_CANCELLABLE).unwrap();
|
||||
let signature = signer.data(payload, gio::Cancellable::NONE).unwrap();
|
||||
let signatures = [&*signature].to_variant();
|
||||
|
||||
let msg = signer.data_verify(payload, &signatures).unwrap().unwrap();
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use gio::NONE_CANCELLABLE;
|
||||
use glib::prelude::*;
|
||||
use glib::GString;
|
||||
use std::path::Path;
|
||||
@@ -17,7 +16,7 @@ impl TestRepo {
|
||||
pub fn new_with_mode(repo_mode: ostree::RepoMode) -> TestRepo {
|
||||
let dir = tempfile::tempdir().expect("temp repo dir");
|
||||
let repo = ostree::Repo::new_for_path(dir.path());
|
||||
repo.create(repo_mode, NONE_CANCELLABLE)
|
||||
repo.create(repo_mode, gio::Cancellable::NONE)
|
||||
.expect("OSTree repo");
|
||||
TestRepo { dir, repo }
|
||||
}
|
||||
@@ -55,18 +54,18 @@ pub fn create_mtree(repo: &ostree::Repo) -> ostree::MutableTree {
|
||||
let file = gio::File::for_path(
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("rust-bindings/tests/data/test.tar"),
|
||||
);
|
||||
repo.write_archive_to_mtree(&file, &mtree, None, true, NONE_CANCELLABLE)
|
||||
repo.write_archive_to_mtree(&file, &mtree, None, true, gio::Cancellable::NONE)
|
||||
.expect("test mtree");
|
||||
mtree
|
||||
}
|
||||
|
||||
pub fn commit(repo: &ostree::Repo, mtree: &ostree::MutableTree, ref_: &str) -> GString {
|
||||
let txn = repo
|
||||
.auto_transaction(NONE_CANCELLABLE)
|
||||
.auto_transaction(gio::Cancellable::NONE)
|
||||
.expect("prepare transaction");
|
||||
let repo_file = txn
|
||||
.repo()
|
||||
.write_mtree(mtree, NONE_CANCELLABLE)
|
||||
.write_mtree(mtree, gio::Cancellable::NONE)
|
||||
.expect("write mtree")
|
||||
.downcast::<ostree::RepoFile>()
|
||||
.unwrap();
|
||||
@@ -77,11 +76,12 @@ pub fn commit(repo: &ostree::Repo, mtree: &ostree::MutableTree, ref_: &str) -> G
|
||||
None,
|
||||
None,
|
||||
&repo_file,
|
||||
NONE_CANCELLABLE,
|
||||
gio::Cancellable::NONE,
|
||||
)
|
||||
.expect("write commit");
|
||||
repo.transaction_set_ref(None, ref_, checksum.as_str().into());
|
||||
txn.commit(NONE_CANCELLABLE).expect("commit transaction");
|
||||
txn.commit(gio::Cancellable::NONE)
|
||||
.expect("commit transaction");
|
||||
checksum
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user