Release 0.13

Just an update to support libostree v2021.4, but bumping semver
because a few APIs (correctly) gained `Option<T>`.
This commit is contained in:
Colin Walters committed 2022-05-06 12:53:57 -04:00
1 parent b17f3b37f0
commit 09ef16fdbf
13 files changed
+1970 -3640

No files matched your search

+2
View File
@@ -38,6 +38,8 @@ pub static COMMIT_META_KEY_VERSION: once_cell::sync::Lazy<&'static str> = once_c
pub static DIRMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()});
#[doc(alias = "OSTREE_FILEMETA_GVARIANT_STRING")]
pub static FILEMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()});
#[doc(alias = "OSTREE_GPG_KEY_GVARIANT_STRING")]
pub static GPG_KEY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_GPG_KEY_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
#[doc(alias = "OSTREE_METADATA_KEY_BOOTABLE")]
+46
View File
@@ -19,6 +19,8 @@ bitflags! {
const NONE = ffi::OSTREE_CHECKSUM_FLAGS_NONE as u32;
#[doc(alias = "OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS")]
const IGNORE_XATTRS = ffi::OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS as u32;
#[doc(alias = "OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS")]
const CANONICAL_PERMISSIONS = ffi::OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS as u32;
}
}
@@ -404,6 +406,48 @@ impl FromGlib<ffi::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
bitflags! {
#[doc(alias = "OstreeRepoVerifyFlags")]
pub struct RepoVerifyFlags: u32 {
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NONE")]
const NONE = ffi::OSTREE_REPO_VERIFY_FLAGS_NONE as u32;
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NO_GPG")]
const NO_GPG = ffi::OSTREE_REPO_VERIFY_FLAGS_NO_GPG as u32;
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI")]
const NO_SIGNAPI = ffi::OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI as u32;
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
impl fmt::Display for RepoVerifyFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(hidden)]
impl IntoGlib for RepoVerifyFlags {
type GlibType = ffi::OstreeRepoVerifyFlags;
fn into_glib(self) -> ffi::OstreeRepoVerifyFlags {
self.bits()
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoVerifyFlags> for RepoVerifyFlags {
unsafe fn from_glib(value: ffi::OstreeRepoVerifyFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[doc(alias = "OstreeSePolicyRestoreconFlags")]
pub struct SePolicyRestoreconFlags: u32 {
@@ -483,6 +527,8 @@ bitflags! {
pub struct SysrootUpgraderFlags: u32 {
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED")]
const IGNORE_UNCONFIGURED = ffi::OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED as u32;
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE")]
const STAGE = ffi::OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE as u32;
}
}
+4
View File
@@ -145,6 +145,9 @@ pub use self::flags::RepoListRefsExtFlags;
pub use self::flags::RepoPruneFlags;
pub use self::flags::RepoPullFlags;
pub use self::flags::RepoResolveRevExtFlags;
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
pub use self::flags::RepoVerifyFlags;
pub use self::flags::SePolicyRestoreconFlags;
pub use self::flags::SysrootSimpleWriteDeploymentFlags;
pub use self::flags::SysrootUpgraderFlags;
@@ -177,6 +180,7 @@ pub use self::constants::COMMIT_META_KEY_SOURCE_TITLE;
pub use self::constants::COMMIT_META_KEY_VERSION;
pub use self::constants::DIRMETA_GVARIANT_STRING;
pub use self::constants::FILEMETA_GVARIANT_STRING;
pub use self::constants::GPG_KEY_GVARIANT_STRING;
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
pub use self::constants::METADATA_KEY_BOOTABLE;
+44 -3
View File
@@ -36,6 +36,9 @@ use crate::RepoRemoteChange;
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_7")))]
use crate::RepoResolveRevExtFlags;
use crate::RepoTransactionStats;
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
use crate::RepoVerifyFlags;
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
use crate::Sign;
@@ -527,6 +530,20 @@ impl Repo {
}
}
//#[cfg(any(feature = "v2021_3", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_3")))]
//#[doc(alias = "ostree_repo_lock_pop")]
//pub fn lock_pop<P: IsA<gio::Cancellable>>(&self, lock_type: /*Ignored*/RepoLockType, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:ostree_repo_lock_pop() }
//}
//#[cfg(any(feature = "v2021_3", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_3")))]
//#[doc(alias = "ostree_repo_lock_push")]
//pub fn lock_push<P: IsA<gio::Cancellable>>(&self, lock_type: /*Ignored*/RepoLockType, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ffi:ostree_repo_lock_push() }
//}
#[cfg(any(feature = "v2017_15", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))]
#[doc(alias = "ostree_repo_mark_commit_partial")]
@@ -650,7 +667,7 @@ impl Repo {
}
#[doc(alias = "ostree_repo_read_commit_detached_metadata")]
pub fn read_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error> {
pub fn read_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<Option<glib::Variant>, glib::Error> {
unsafe {
let mut out_metadata = ptr::null_mut();
let mut error = ptr::null_mut();
@@ -680,7 +697,7 @@ impl Repo {
}
#[doc(alias = "ostree_repo_remote_add")]
pub fn remote_add<P: IsA<gio::Cancellable>>(&self, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), glib::Error> {
pub fn remote_add<P: IsA<gio::Cancellable>>(&self, name: &str, url: Option<&str>, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ffi::ostree_repo_remote_add(self.to_glib_none().0, name.to_glib_none().0, url.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@@ -689,7 +706,7 @@ impl Repo {
}
#[doc(alias = "ostree_repo_remote_change")]
pub fn remote_change<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, sysroot: Option<&P>, changeop: RepoRemoteChange, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
pub fn remote_change<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, sysroot: Option<&P>, changeop: RepoRemoteChange, name: &str, url: Option<&str>, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ffi::ostree_repo_remote_change(self.to_glib_none().0, sysroot.map(|p| p.as_ref()).to_glib_none().0, changeop.into_glib(), name.to_glib_none().0, url.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@@ -730,6 +747,18 @@ impl Repo {
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(alias = "ostree_repo_remote_get_gpg_keys")]
pub fn remote_get_gpg_keys<P: IsA<gio::Cancellable>>(&self, name: Option<&str>, key_ids: &[&str], cancellable: Option<&P>) -> Result<Vec<glib::Variant>, glib::Error> {
unsafe {
let mut out_keys = ptr::null_mut();
let mut error = ptr::null_mut();
let _ = ffi::ostree_repo_remote_get_gpg_keys(self.to_glib_none().0, name.to_glib_none().0, key_ids.to_glib_none().0, &mut out_keys, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_keys)) } else { Err(from_glib_full(error)) }
}
}
#[doc(alias = "ostree_repo_remote_get_gpg_verify")]
pub fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, glib::Error> {
unsafe {
@@ -926,6 +955,18 @@ impl Repo {
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(alias = "ostree_repo_signature_verify_commit_data")]
pub fn signature_verify_commit_data(&self, remote_name: &str, commit_data: &glib::Bytes, commit_metadata: &glib::Bytes, flags: RepoVerifyFlags) -> Result<Option<glib::GString>, glib::Error> {
unsafe {
let mut out_results = ptr::null_mut();
let mut error = ptr::null_mut();
let _ = ffi::ostree_repo_signature_verify_commit_data(self.to_glib_none().0, remote_name.to_glib_none().0, commit_data.to_glib_none().0, commit_metadata.to_glib_none().0, flags.into_glib(), &mut out_results, &mut error);
if error.is_null() { Ok(from_glib_full(out_results)) } else { Err(from_glib_full(error)) }
}
}
#[doc(alias = "ostree_repo_static_delta_execute_offline")]
pub fn static_delta_execute_offline<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
+1 -1
View File
@@ -3,7 +3,7 @@
// DO NOT EDIT
use std::cmp;
use glib::translate::*;
use glib::translate::ToGlibPtr;
glib::wrapper! {
#[derive(Debug, Hash)]