Update to OSTree 2020.4
This commit is contained in:
1 parent
d7156df1da
commit
aee92d14a8
15 files changed
+2958
-963
No files matched your search
@@ -6,6 +6,8 @@ use ostree_sys;
|
||||
use std::ffi::CStr;
|
||||
|
||||
pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()});
|
||||
#[cfg(any(feature = "v2020_4", feature = "dox"))]
|
||||
pub static COMMIT_META_KEY_ARCHITECTURE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ARCHITECTURE).to_str().unwrap()});
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()});
|
||||
#[cfg(any(feature = "v2017_7", feature = "dox"))]
|
||||
@@ -26,6 +28,7 @@ pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> =
|
||||
pub static ORIGIN_TRANSIENT_GROUP: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()});
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub static REPO_METADATA_REF: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()});
|
||||
pub static SIGN_NAME_ED25519: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SIGN_NAME_ED25519).to_str().unwrap()});
|
||||
pub static SUMMARY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()});
|
||||
pub static SUMMARY_SIG_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()});
|
||||
pub static TREE_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()});
|
||||
@@ -150,46 +150,6 @@ impl FromGlib<ostree_sys::OstreeGpgSignatureAttr> for GpgSignatureAttr {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
pub enum GpgSignatureFormatFlags {
|
||||
GpgSignatureFormatDefault,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for GpgSignatureFormatFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "GpgSignatureFormatFlags::{}", match *self {
|
||||
GpgSignatureFormatFlags::GpgSignatureFormatDefault => "GpgSignatureFormatDefault",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for GpgSignatureFormatFlags {
|
||||
type GlibType = ostree_sys::OstreeGpgSignatureFormatFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeGpgSignatureFormatFlags {
|
||||
match *self {
|
||||
GpgSignatureFormatFlags::GpgSignatureFormatDefault => ostree_sys::OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT,
|
||||
GpgSignatureFormatFlags::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeGpgSignatureFormatFlags) -> Self {
|
||||
match value {
|
||||
0 => GpgSignatureFormatFlags::GpgSignatureFormatDefault,
|
||||
value => GpgSignatureFormatFlags::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
@@ -546,54 +506,6 @@ impl FromGlib<ostree_sys::OstreeRepoMode> for RepoMode {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
pub enum RepoPruneFlags {
|
||||
None,
|
||||
NoPrune,
|
||||
RefsOnly,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoPruneFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoPruneFlags::{}", match *self {
|
||||
RepoPruneFlags::None => "None",
|
||||
RepoPruneFlags::NoPrune => "NoPrune",
|
||||
RepoPruneFlags::RefsOnly => "RefsOnly",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoPruneFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoPruneFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoPruneFlags {
|
||||
match *self {
|
||||
RepoPruneFlags::None => ostree_sys::OSTREE_REPO_PRUNE_FLAGS_NONE,
|
||||
RepoPruneFlags::NoPrune => ostree_sys::OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE,
|
||||
RepoPruneFlags::RefsOnly => ostree_sys::OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY,
|
||||
RepoPruneFlags::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoPruneFlags> for RepoPruneFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoPruneFlags) -> Self {
|
||||
match value {
|
||||
0 => RepoPruneFlags::None,
|
||||
1 => RepoPruneFlags::NoPrune,
|
||||
2 => RepoPruneFlags::RefsOnly,
|
||||
value => RepoPruneFlags::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
|
||||
@@ -61,6 +61,28 @@ impl FromGlib<ostree_sys::OstreeDiffFlags> for DiffFlags {
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct GpgSignatureFormatFlags: u32 {
|
||||
const GPG_SIGNATURE_FORMAT_DEFAULT = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for GpgSignatureFormatFlags {
|
||||
type GlibType = ostree_sys::OstreeGpgSignatureFormatFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeGpgSignatureFormatFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeGpgSignatureFormatFlags) -> GpgSignatureFormatFlags {
|
||||
GpgSignatureFormatFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoCommitModifierFlags: u32 {
|
||||
const NONE = 0;
|
||||
@@ -188,6 +210,30 @@ impl FromGlib<ostree_sys::OstreeRepoListRefsExtFlags> for RepoListRefsExtFlags {
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoPruneFlags: u32 {
|
||||
const NONE = 0;
|
||||
const NO_PRUNE = 1;
|
||||
const REFS_ONLY = 2;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoPruneFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoPruneFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoPruneFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoPruneFlags> for RepoPruneFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoPruneFlags) -> RepoPruneFlags {
|
||||
RepoPruneFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoPullFlags: u32 {
|
||||
const NONE = 0;
|
||||
|
||||
@@ -120,6 +120,7 @@ pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<GString> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_3", feature = "dox"))]
|
||||
pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_commit_get_timestamp(commit_variant.to_glib_none().0)
|
||||
|
||||
@@ -62,6 +62,10 @@ pub use self::repo_finder_override::RepoFinderOverrideExt;
|
||||
mod se_policy;
|
||||
pub use self::se_policy::{SePolicy, SePolicyClass};
|
||||
|
||||
mod sign;
|
||||
pub use self::sign::{Sign, NONE_SIGN};
|
||||
pub use self::sign::SignExt;
|
||||
|
||||
mod sysroot;
|
||||
pub use self::sysroot::{Sysroot, SysrootClass};
|
||||
|
||||
@@ -98,7 +102,6 @@ pub use self::repo_transaction_stats::RepoTransactionStats;
|
||||
mod enums;
|
||||
pub use self::enums::DeploymentUnlockedState;
|
||||
pub use self::enums::GpgSignatureAttr;
|
||||
pub use self::enums::GpgSignatureFormatFlags;
|
||||
pub use self::enums::ObjectType;
|
||||
#[cfg(any(feature = "v2018_2", feature = "dox"))]
|
||||
pub use self::enums::RepoCheckoutFilterResult;
|
||||
@@ -107,7 +110,6 @@ pub use self::enums::RepoCheckoutOverwriteMode;
|
||||
pub use self::enums::RepoCommitFilterResult;
|
||||
pub use self::enums::RepoCommitIterResult;
|
||||
pub use self::enums::RepoMode;
|
||||
pub use self::enums::RepoPruneFlags;
|
||||
pub use self::enums::RepoRemoteChange;
|
||||
pub use self::enums::StaticDeltaGenerateOpt;
|
||||
|
||||
@@ -115,12 +117,14 @@ mod flags;
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
pub use self::flags::ChecksumFlags;
|
||||
pub use self::flags::DiffFlags;
|
||||
pub use self::flags::GpgSignatureFormatFlags;
|
||||
pub use self::flags::RepoCommitModifierFlags;
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
pub use self::flags::RepoCommitState;
|
||||
pub use self::flags::RepoCommitTraverseFlags;
|
||||
pub use self::flags::RepoListObjectsFlags;
|
||||
pub use self::flags::RepoListRefsExtFlags;
|
||||
pub use self::flags::RepoPruneFlags;
|
||||
pub use self::flags::RepoPullFlags;
|
||||
pub use self::flags::RepoResolveRevExtFlags;
|
||||
pub use self::flags::SePolicyRestoreconFlags;
|
||||
@@ -132,6 +136,8 @@ pub mod functions;
|
||||
|
||||
mod constants;
|
||||
pub use self::constants::COMMIT_GVARIANT_STRING;
|
||||
#[cfg(any(feature = "v2020_4", feature = "dox"))]
|
||||
pub use self::constants::COMMIT_META_KEY_ARCHITECTURE;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::constants::COMMIT_META_KEY_COLLECTION_BINDING;
|
||||
#[cfg(any(feature = "v2017_7", feature = "dox"))]
|
||||
@@ -152,6 +158,7 @@ pub use self::constants::META_KEY_DEPLOY_COLLECTION_ID;
|
||||
pub use self::constants::ORIGIN_TRANSIENT_GROUP;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::constants::REPO_METADATA_REF;
|
||||
pub use self::constants::SIGN_NAME_ED25519;
|
||||
pub use self::constants::SUMMARY_GVARIANT_STRING;
|
||||
pub use self::constants::SUMMARY_SIG_GVARIANT_STRING;
|
||||
pub use self::constants::TREE_GVARIANT_STRING;
|
||||
@@ -169,4 +176,5 @@ pub mod traits {
|
||||
pub use super::RepoFinderMountExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderOverrideExt;
|
||||
pub use super::SignExt;
|
||||
}
|
||||
@@ -4,10 +4,12 @@
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::ptr;
|
||||
use Repo;
|
||||
use RepoCommitFilterResult;
|
||||
use RepoCommitModifierFlags;
|
||||
@@ -65,6 +67,14 @@ impl RepoCommitModifier {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_sepolicy_from_commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, rev: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_commit_modifier_set_sepolicy_from_commit(self.to_glib_none().0, repo.to_glib_none().0, rev.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_xattr_callback<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(&self, callback: P) {
|
||||
let callback_data: Box_<P> = Box_::new(callback);
|
||||
unsafe extern "C" fn callback_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> *mut glib_sys::GVariant {
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
use Repo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Sign(Interface<ostree_sys::OstreeSign>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_sign_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Sign {
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
pub fn get_all() -> Vec<Sign> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ostree_sys::ostree_sign_get_all())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
pub fn get_by_name(name: &str) -> Result<Sign, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sign_get_by_name(name.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_SIGN: Option<&Sign> = None;
|
||||
|
||||
pub trait SignExt: 'static {
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn clear_keys(&self) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, out_success_message: &str, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, out_success_message: &str) -> Result<(), glib::Error>;
|
||||
|
||||
fn dummy_add_pk(&self, key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn dummy_data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
|
||||
fn dummy_data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, success_message: &str) -> Result<(), glib::Error>;
|
||||
|
||||
fn dummy_get_name(&self) -> Option<GString>;
|
||||
|
||||
fn dummy_metadata_format(&self) -> Option<GString>;
|
||||
|
||||
fn dummy_metadata_key(&self) -> Option<GString>;
|
||||
|
||||
fn dummy_set_pk(&self, key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn dummy_set_sk(&self, key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_clear_keys(&self) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, out_success_message: &str) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_get_name(&self) -> Option<GString>;
|
||||
|
||||
fn ed25519_load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_metadata_format(&self) -> Option<GString>;
|
||||
|
||||
fn ed25519_metadata_key(&self) -> Option<GString>;
|
||||
|
||||
fn ed25519_set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn ed25519_set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn get_name(&self) -> Option<GString>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_format(&self) -> Option<GString>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_key(&self) -> Option<GString>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
fn summary<P: IsA<gio::Cancellable>>(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<Sign>> SignExt for O {
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_add_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn clear_keys(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_clear_keys(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_commit(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, out_success_message: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_commit_verify(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, out_success_message.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, signature.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, out_success_message: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, out_success_message.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_add_pk(&self, key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_dummy_add_pk(self.as_ref().to_glib_none().0, key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_dummy_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, signature.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, success_message: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_dummy_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, success_message.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_get_name(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_dummy_get_name(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_metadata_format(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_dummy_metadata_format(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_metadata_key(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_dummy_metadata_key(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_set_pk(&self, key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_dummy_set_pk(self.as_ref().to_glib_none().0, key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_set_sk(&self, key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_dummy_set_sk(self.as_ref().to_glib_none().0, key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_add_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_clear_keys(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_clear_keys(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, signature.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, out_success_message: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, out_success_message.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_get_name(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_ed25519_get_name(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_load_pk(self.as_ref().to_glib_none().0, options.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_metadata_format(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_ed25519_metadata_format(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_metadata_key(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_ed25519_metadata_key(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_set_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ed25519_set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_ed25519_set_sk(self.as_ref().to_glib_none().0, secret_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn get_name(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_get_name(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_load_pk(self.as_ref().to_glib_none().0, options.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_format(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_key(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_set_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_set_sk(self.as_ref().to_glib_none().0, secret_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn summary<P: IsA<gio::Cancellable>>(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_summary(self.as_ref().to_glib_none().0, repo.to_glib_none().0, keys.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Sign {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Sign")
|
||||
}
|
||||
}
|
||||
@@ -270,14 +270,6 @@ impl Sysroot {
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn lock_with_mount_namespace(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_lock_with_mount_namespace(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ aa3c638)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 48a4a23+)
|
||||
Reference in new issue
Block a user