diff --git a/rust-bindings/rust/Cargo.toml b/rust-bindings/rust/Cargo.toml index bb293dbb..557805bb 100644 --- a/rust-bindings/rust/Cargo.toml +++ b/rust-bindings/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ostree" -version = "0.2.0" +version = "0.3.0" authors = ["Felix Krull"] license = "MIT" @@ -36,7 +36,7 @@ gio = "0.5" glib-sys = "0.7" gobject-sys = "0.7" gio-sys = "0.7" -ostree-sys = { version = "0.2", path = "sys" } +ostree-sys = { version = "0.3", path = "sys" } [dev-dependencies] tempfile = "3" diff --git a/rust-bindings/rust/gir-files/OSTree-1.0.gir b/rust-bindings/rust/gir-files/OSTree-1.0.gir index f5ba7245..6257837a 100644 --- a/rust-bindings/rust/gir-files/OSTree-1.0.gir +++ b/rust-bindings/rust/gir-files/OSTree-1.0.gir @@ -550,8 +550,8 @@ Any watchers of the #OstreeAsyncProgress will be notified of the change if - - + + @@ -562,6 +562,11 @@ Any watchers of the #OstreeAsyncProgress will be notified of the change if + + + + + @@ -1120,7 +1125,8 @@ that should have been under an explicit group. + c:identifier="ostree_deployment_unlocked_state_to_string" + version="2016.4"> @@ -1264,7 +1270,8 @@ or concatenate it with the full ostree_sysroot_get_path(). + c:identifier="ostree_deployment_get_unlocked" + version="2016.4"> @@ -1790,6 +1797,7 @@ If no match is found, the function returns %FALSE and leaves Checks if the result contains at least one signature from the trusted keyring. You can call this function immediately after @@ -1885,18 +1893,39 @@ signature from trusted keyring, otherwise %FALSE - Maximum permitted size in bytes of metadata objects. This is an -arbitrary number, but really, no one should be putting humongous -data in metadata. + Default limit for maximum permitted size in bytes of metadata objects fetched +over HTTP (including repo/config files, refs, and commit/dirtree/dirmeta +objects). This is an arbitrary number intended to mitigate disk space +exhaustion attacks. - Objects committed above this size will be allowed, but a warning -will be emitted. + This variable is no longer meaningful, it is kept only for compatibility. + + GVariant type `s`. This key can be used in the repo metadata which is stored +in OSTREE_REPO_METADATA_REF as well as in the summary. The semantics of this +are that the remote repository wants clients to update their remote config +to add this collection ID (clients can't do P2P operations involving a +remote without a collection ID configured on it, even if one is configured +on the server side). Clients must never change or remove a collection ID +already set in their remote config. + +Currently, OSTree does not implement changing a remote config based on this +key, but it may do so in a later release, and until then clients such as +Flatpak may implement it. + +This is a replacement for the similar metadata key implemented by flatpak, +`xa.collection-id`, which is now deprecated as clients which supported it had +bugs with their P2P implementations. + + + c:identifier="ostree_mutable_tree_new_from_checksum" + version="2018.7"> Creates a new OstreeMutableTree with the contents taken from the given repo and checksums. The data will be loaded from the repo lazily as needed. @@ -2012,7 +2042,8 @@ exist. + c:identifier="ostree_mutable_tree_fill_empty_from_dirtree" + version="2018.7"> Merges @self with the tree given by @contents_checksum and @metadata_checksum, but only if it's possible without writing new objects to the @repo. We can do this if either @self is empty, the tree given by @@ -2113,6 +2144,29 @@ the contents will be loaded only when needed. + + Remove the file or subdirectory named @name from the mutable tree @self. + + + + + + Tree + + + + Name of file or subdirectory to remove + + + + If @FALSE, an error will be thrown if @name does not exist in the tree + + + + @@ -2250,7 +2304,7 @@ content, the other types are metadata. ostree release version component (e.g. 2 if %OSTREE_VERSION is 2017.2) @@ -2395,6 +2449,7 @@ instead of assuming "/". This is a file-descriptor relative version of ostree_repo_create(). Create the underlying structure on disk for the repository, and call @@ -2453,7 +2508,10 @@ The @options dict may contain: - + This combines ostree_repo_new() (but using fd-relative access) with ostree_repo_open(). Use this when you know you should be operating on an already extant repository. If you want to create one, use ostree_repo_create_at(). @@ -2648,6 +2706,7 @@ transaction will do nothing and return successfully. Similar to ostree_repo_checkout_tree(), but uses directory-relative paths for the destination, uses a new `OstreeRepoCheckoutAtOptions`, @@ -3026,7 +3085,7 @@ The following @options are currently defined: provided. * `n-network-retries` (`u`): Number of times to retry each download on receiving a transient network error, such as a socket timeout; default is - 5, 0 means return errors without retrying. + 5, 0 means return errors without retrying. Since: 2018.6 @finders must be a non-empty %NULL-terminated array of the #OstreeRepoFinder instances to use, or %NULL to use the system default set of finders, which @@ -3154,6 +3213,22 @@ traverse metadata objects for example. + + Get the bootloader configured. See the documentation for the +"sysroot.bootloader" config key. + + bootloader configuration for the sysroot + + + + + an #OstreeRepo + + + + @@ -3180,7 +3255,28 @@ traverse metadata objects for example. - + + Get the set of default repo finders configured. See the documentation for +the "core.default-repo-finders" config key. + + + %NULL-terminated array of strings. + + + + + + + an #OstreeRepo + + + + + In some cases it's useful for applications to access the repository directly; for example, writing content into `repo/tmp` ensures it's on the same filesystem. Another case is detecting the mtime on the @@ -3210,6 +3306,29 @@ repository (to see whether a ref was written). + + It can be used to query the value (in bytes) of min-free-space-* config option. + + %TRUE on success, %FALSE otherwise. + + + + + Repo + + + + Location to store the result + + + + @@ -3251,6 +3370,7 @@ that API. In general, you should avoid use of this API. OSTree remotes are represented by keyfile groups, formatted like: `[remote "remotename"]`. This function returns a value named @option_name @@ -3289,6 +3409,7 @@ error is returned, @out_value will be set to %FALSE. OSTree remotes are represented by keyfile groups, formatted like: `[remote "remotename"]`. This function returns a value named @option_name @@ -3327,6 +3448,7 @@ to %NULL. OSTree remotes are represented by keyfile groups, formatted like: `[remote "remotename"]`. This function returns a value named @option_name @@ -3367,6 +3489,7 @@ option name. If an error is returned, @out_value will be set to %NULL. Verify @signatures for @data using GPG keys in the keyring for @remote_name, and return an #OstreeGpgVerifyResult. @@ -3563,11 +3686,12 @@ Otherwise, a copy will be performed. Copy object named by @objtype and @checksum into @self from the -source repository @source. If both repositories are of the same -type and on the same filesystem, this will simply be a fast Unix -hard link operation. +source repository @source. If @trusted is %TRUE and both +repositories are of the same type and on the same filesystem, +this will simply be a fast Unix hard link operation. Otherwise, a copy will be performed. @@ -3646,7 +3770,9 @@ collection ID is configured for the repository (ostree_repo_get_collection_id()). If you want to exclude refs from `refs/remotes`, use -%OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES in @flags. +%OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES in @flags. Similarly use +%OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS to exclude refs from +`refs/mirrors`. %TRUE on success, %FALSE otherwise @@ -3812,6 +3938,7 @@ removed as a prefix from the hash table keys. If @refspec_prefix is %NULL, list all local and remote refspecs, with their current values in @out_all_refs. Otherwise, only list @@ -4245,6 +4372,7 @@ Locking: exclusive Delete content from the repository. This function is the "backend" half of the higher level ostree_repo_prune(). To use this function, @@ -4425,7 +4553,18 @@ The following @options are currently defined: * `subdirs` (`as`): Pull just these subdirectories * `update-frequency` (`u`): Frequency to call the async progress callback in milliseconds, if any; only values higher than 0 are valid - * `append-user-agent` (`s`): Additional string to append to the user agent + * `append-user-agent` (`s`): Additional string to append to the user agent + * `n-network-retries` (`u`): Number of times to retry each download on receiving + a transient network error, such as a socket timeout; default is 5, 0 + means return errors without retrying. Since: 2018.6 + * `ref-keyring-map` (`a(sss)`): Array of (collection ID, ref name, keyring + remote name) tuples specifying which remote's keyring should be used when + doing GPG verification of each collection-ref. This is useful to prevent a + remote from serving malicious updates to refs which did not originate from + it. This can be a subset or superset of the refs being pulled; any ref + not being pulled will be ignored and any ref without a keyring remote + will be verified with the keyring of the remote being pulled from. + Since: 2019.2 @@ -4573,6 +4712,7 @@ The following are currently defined: * require-static-deltas (b): Require static deltas * override-commit-ids (as): Array of specific commit IDs to fetch for refs * timestamp-check (b): Verify commit timestamps are newer than current (when pulling via ref); Since: 2017.11 + * metadata-size-restriction (t): Restrict metadata objects to a maximum number of bytes; 0 to disable. Since: 2018.9 * dry-run (b): Only print information on what will be downloaded (requires static deltas) * override-url (s): Fetch objects from this URL if remote specifies no metalink in options * inherit-transaction (b): Don't initiate, finish or abort a transaction, useful to do multiple pulls in one transaction. @@ -4582,7 +4722,15 @@ The following are currently defined: * append-user-agent (s): Additional string to append to the user agent * n-network-retries (u): Number of times to retry each download on receiving a transient network error, such as a socket timeout; default is 5, 0 - means return errors without retrying + means return errors without retrying. Since: 2018.6 + * ref-keyring-map (a(sss)): Array of (collection ID, ref name, keyring + remote name) tuples specifying which remote's keyring should be used when + doing GPG verification of each collection-ref. This is useful to prevent a + remote from serving malicious updates to refs which did not originate from + it. This can be a subset or superset of the refs being pulled; any ref + not being pulled will be ignored and any ref without a keyring remote + will be verified with the keyring of the remote being pulled from. + Since: 2019.2 @@ -4772,6 +4920,7 @@ Locking: exclusive By default, an #OstreeRepo will cache the remote configuration and its own repo/config data. This API can be used to reload it. @@ -4969,6 +5118,7 @@ with #OSTREE_SUMMARY_GVARIANT_FORMAT as the format string. Like ostree_repo_remote_fetch_summary(), but supports an extensible set of flags. The following are currently defined: @@ -5288,7 +5438,9 @@ returned and @out_rev will be set to %NULL. If @allow_noent is %FALSE and the given @ref cannot be found, a %G_IO_ERROR_NOT_FOUND error will be returned. -There are currently no @flags which affect the behaviour of this function. +If you want to check only local refs, not remote or mirrored ones, use the +flag %OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY. This is analogous to using +ostree_repo_resolve_rev_ext() but for collection-refs. %TRUE on success, %FALSE on failure @@ -5402,11 +5554,15 @@ find the given refspec in local. Look up the given refspec, returning the checksum it references in the parameter @out_rev. Differently from ostree_repo_resolve_rev(), this will not fall back to searching through remote repos if a -local ref is specified but not found. +local ref is specified but not found. + +The flag %OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY is implied so +using it has no effect. @@ -5476,6 +5632,7 @@ Multithreading: This function is *not* MT safe. Like ostree_repo_set_ref_immediate(), but creates an alias. @@ -5515,6 +5672,7 @@ Multithreading: This function is *not* MT safe. Set a custom location for the cache directory used for e.g. per-remote summary caches. Setting this manually is useful when @@ -6201,6 +6359,7 @@ checksum @commit_checksum. Read GPG signature(s) on the commit named by the ASCII checksum @commit_checksum and return detailed results, based on the keyring @@ -7056,8 +7215,11 @@ ostree_repo_checkout_tree() and ostree_repo_checkout_tree_at(). + + + - + @@ -7090,7 +7252,8 @@ ostree_repo_checkout_tree() and ostree_repo_checkout_tree_at(). + c:identifier="ostree_repo_checkout_at_options_set_devino" + version="2017.13"> This function simply assigns @cache to the `devino_to_csum_cache` member of @opts; it's only useful for introspection. @@ -8863,6 +9026,11 @@ Note that enabling pathname translation will always override the setting for c:identifier="OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES"> Exclude remote refs. Since: 2017.11 + + Exclude mirrored refs. Since: 2019.2 + See the documentation of #OstreeRepo for more information about the @@ -8984,15 +9152,25 @@ possible modes. c:identifier="OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS"> Delete a remote, do nothing if the remote does not exist + + Add or replace a remote (Since: 2019.2) + - - + No flags. - + + Exclude remote and mirrored refs. Since: 2019.2 + + in bytes, counting only content objects. + + + reserved - + reserved @@ -9123,6 +9304,7 @@ in bytes, counting only content objects. An accessor object for SELinux policy in root located at @rootfs_dfd @@ -9158,7 +9340,9 @@ in bytes, counting only content objects. - + Checksum of current policy @@ -9626,6 +9810,7 @@ the staged deployment (as it's not in the bootloader entries). Configure the target deployment @deployment such that it is writable. There are multiple modes, essentially differing @@ -9838,7 +10023,8 @@ the first one in the current deployment list which matches osname. + c:identifier="ostree_sysroot_get_staged_deployment" + version="2018.5"> The currently staged deployment, or %NULL if none @@ -9863,6 +10049,7 @@ the first one in the current deployment list which matches osname. Initialize the directory structure for an "osname", which is a group of operating system deployments, with a shared `/var`. One @@ -9910,6 +10097,7 @@ rootfs @self. @@ -10081,7 +10269,7 @@ we're not looking at the booted deployment. - + This function is a variant of ostree_sysroot_get_repo() that cannot fail, and returns a cached repository. Can only be called after ostree_sysroot_load() has been invoked successfully. @@ -10163,6 +10351,7 @@ later, instead. Like ostree_sysroot_deploy_tree(), but "finalization" only occurs at OS shutdown time. @@ -10312,6 +10501,7 @@ version will perform post-deployment cleanup by default. Assuming @new_deployments have already been deployed in place on disk via ostree_sysroot_deploy_tree(), atomically update bootloader configuration. By @@ -10820,14 +11010,14 @@ users who had been using zero before. disguised="1"> ostree version. ostree version, encoded as a string, useful for printing and @@ -10835,7 +11025,7 @@ concatenation. ostree year version component (e.g. 2017 if %OSTREE_VERSION is 2017.2) @@ -10883,7 +11073,9 @@ care of synchronization. - + %TRUE if current libostree has at least the requested version, %FALSE otherwise @@ -10900,7 +11092,8 @@ care of synchronization. + c:identifier="ostree_checksum_b64_from_bytes" + version="2016.8"> Modified base64 encoding of @csum @@ -10960,7 +11153,8 @@ character is used. + c:identifier="ostree_checksum_b64_to_bytes" + version="2016.8"> Binary version of @checksum. @@ -11411,7 +11605,8 @@ must be %NULL-terminated; it may be empty, but must not be %NULL. + c:identifier="ostree_commit_get_content_checksum" + version="2018.2"> There are use cases where one wants a checksum just of the content of a commit. OSTree commits by default capture the current timestamp, and may have additional metadata, which means that re-committing identical content @@ -11687,6 +11882,7 @@ sets of #OstreeDiffItem in @modified, @removed, and @added. Compute the difference between directory @a and @b as 3 separate sets of #OstreeDiffItem in @modified, @removed, and @added. @@ -11774,7 +11970,9 @@ sets of #OstreeDiffItem in @modified, @removed, and @added. - + @@ -11960,6 +12158,7 @@ will be `gnome-ostree/buildmaster`. In both cases, %TRUE will be returned. Convert from a "bare" file representation into an OSTREE_OBJECT_TYPE_FILE stream suitable for ostree pull. diff --git a/rust-bindings/rust/src/auto/constants.rs b/rust-bindings/rust/src/auto/constants.rs index a215cb26..f5707eab 100644 --- a/rust-bindings/rust/src/auto/constants.rs +++ b/rust-bindings/rust/src/auto/constants.rs @@ -38,6 +38,10 @@ lazy_static! { lazy_static! { pub static ref FILEMETA_GVARIANT_STRING: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()}; } +#[cfg(any(feature = "v2018_9", feature = "dox"))] +lazy_static! { + pub static ref META_KEY_DEPLOY_COLLECTION_ID: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()}; +} #[cfg(any(feature = "v2018_3", feature = "dox"))] lazy_static! { pub static ref ORIGIN_TRANSIENT_GROUP: &'static str = unsafe{CStr::from_ptr(ffi::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()}; diff --git a/rust-bindings/rust/src/auto/enums.rs b/rust-bindings/rust/src/auto/enums.rs index 03bdfe7b..191c1330 100644 --- a/rust-bindings/rust/src/auto/enums.rs +++ b/rust-bindings/rust/src/auto/enums.rs @@ -237,6 +237,7 @@ pub enum RepoRemoteChange { AddIfNotExists, Delete, DeleteIfExists, + Replace, #[doc(hidden)] __Unknown(i32), } @@ -251,6 +252,7 @@ impl ToGlib for RepoRemoteChange { RepoRemoteChange::AddIfNotExists => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS, RepoRemoteChange::Delete => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE, RepoRemoteChange::DeleteIfExists => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS, + RepoRemoteChange::Replace => ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE, RepoRemoteChange::__Unknown(value) => value } } @@ -264,41 +266,12 @@ impl FromGlib for RepoRemoteChange { 1 => RepoRemoteChange::AddIfNotExists, 2 => RepoRemoteChange::Delete, 3 => RepoRemoteChange::DeleteIfExists, + 4 => RepoRemoteChange::Replace, value => RepoRemoteChange::__Unknown(value), } } } -#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] -#[derive(Clone, Copy)] -pub enum RepoResolveRevExtFlags { - RepoResolveRevExtNone, - #[doc(hidden)] - __Unknown(i32), -} - -#[doc(hidden)] -impl ToGlib for RepoResolveRevExtFlags { - type GlibType = ffi::OstreeRepoResolveRevExtFlags; - - fn to_glib(&self) -> ffi::OstreeRepoResolveRevExtFlags { - match *self { - RepoResolveRevExtFlags::RepoResolveRevExtNone => ffi::OSTREE_REPO_RESOLVE_REV_EXT_NONE, - RepoResolveRevExtFlags::__Unknown(value) => value - } - } -} - -#[doc(hidden)] -impl FromGlib for RepoResolveRevExtFlags { - fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self { - match value { - 0 => RepoResolveRevExtFlags::RepoResolveRevExtNone, - value => RepoResolveRevExtFlags::__Unknown(value), - } - } -} - #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] pub enum StaticDeltaGenerateOpt { diff --git a/rust-bindings/rust/src/auto/flags.rs b/rust-bindings/rust/src/auto/flags.rs index 407d630e..ccbad10f 100644 --- a/rust-bindings/rust/src/auto/flags.rs +++ b/rust-bindings/rust/src/auto/flags.rs @@ -36,6 +36,7 @@ bitflags! { const NONE = 0; const ALIASES = 1; const EXCLUDE_REMOTES = 2; + const EXCLUDE_MIRRORS = 4; } } @@ -82,6 +83,29 @@ impl FromGlib for RepoPullFlags { } } +bitflags! { + pub struct RepoResolveRevExtFlags: u32 { + const NONE = 0; + const LOCAL_ONLY = 1; + } +} + +#[doc(hidden)] +impl ToGlib for RepoResolveRevExtFlags { + type GlibType = ffi::OstreeRepoResolveRevExtFlags; + + fn to_glib(&self) -> ffi::OstreeRepoResolveRevExtFlags { + self.bits() + } +} + +#[doc(hidden)] +impl FromGlib for RepoResolveRevExtFlags { + fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> RepoResolveRevExtFlags { + RepoResolveRevExtFlags::from_bits_truncate(value) + } +} + bitflags! { pub struct SePolicyRestoreconFlags: u32 { const NONE = 0; diff --git a/rust-bindings/rust/src/auto/functions.rs b/rust-bindings/rust/src/auto/functions.rs index 52017ed6..b197a355 100644 --- a/rust-bindings/rust/src/auto/functions.rs +++ b/rust-bindings/rust/src/auto/functions.rs @@ -24,12 +24,14 @@ pub fn break_hardlink<'a, P: Into>>(dfd: i32, path: } } +#[cfg(any(feature = "v2017_4", feature = "dox"))] pub fn check_version(required_year: u32, required_release: u32) -> bool { unsafe { from_glib(ffi::ostree_check_version(required_year, required_release)) } } +//#[cfg(any(feature = "v2016_8", feature = "dox"))] //pub fn checksum_b64_from_bytes(csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32) -> Option { // unsafe { TODO: call ffi::ostree_checksum_b64_from_bytes() } //} @@ -42,6 +44,7 @@ pub fn check_version(required_year: u32, required_release: u32) -> bool { // unsafe { TODO: call ffi::ostree_checksum_b64_inplace_to_bytes() } //} +//#[cfg(any(feature = "v2016_8", feature = "dox"))] //pub fn checksum_b64_to_bytes(checksum: &str) -> /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 { // unsafe { TODO: call ffi::ostree_checksum_b64_to_bytes() } //} @@ -99,6 +102,7 @@ pub fn checksum_to_bytes_v(checksum: &str) -> Option { // unsafe { TODO: call ffi::ostree_cmd__private__() } //} +#[cfg(any(feature = "v2018_2", feature = "dox"))] pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option { unsafe { from_glib_full(ffi::ostree_commit_get_content_checksum(commit_variant.to_glib_none().0)) @@ -168,6 +172,7 @@ pub fn create_directory_metadata<'a, P: Into>>(dir_inf // unsafe { TODO: call ffi::ostree_diff_dirs() } //} +//#[cfg(any(feature = "v2017_4", feature = "dox"))] //pub fn diff_dirs_with_options<'a, 'b, P: IsA, Q: IsA, R: Into>, S: Into>>(flags: /*Ignored*/DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 24 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: R, cancellable: S) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_diff_dirs_with_options() } //} @@ -176,6 +181,7 @@ pub fn create_directory_metadata<'a, P: Into>>(dir_inf // unsafe { TODO: call ffi::ostree_diff_print() } //} +//#[cfg(any(feature = "v2017_10", feature = "dox"))] //pub fn gpg_error_quark() -> /*Ignored*/glib::Quark { // unsafe { TODO: call ffi::ostree_gpg_error_quark() } //} @@ -240,6 +246,7 @@ pub fn parse_refspec(refspec: &str) -> Result<(Option, String), Error> { } } +#[cfg(any(feature = "v2016_6", feature = "dox"))] pub fn raw_file_to_archive_z2_stream<'a, 'b, P: IsA, Q: Into>, R: Into>>(input: &P, file_info: &gio::FileInfo, xattrs: Q, cancellable: R) -> Result { let xattrs = xattrs.into(); let xattrs = xattrs.to_glib_none(); diff --git a/rust-bindings/rust/src/auto/gpg_verify_result.rs b/rust-bindings/rust/src/auto/gpg_verify_result.rs index d6d479d2..0f29e26d 100644 --- a/rust-bindings/rust/src/auto/gpg_verify_result.rs +++ b/rust-bindings/rust/src/auto/gpg_verify_result.rs @@ -2,6 +2,7 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#[cfg(any(feature = "v2016_6", feature = "dox"))] use Error; use GpgSignatureFormatFlags; use ffi; @@ -44,6 +45,7 @@ pub trait GpgVerifyResultExt { fn lookup(&self, key_id: &str) -> Option; + #[cfg(any(feature = "v2016_6", feature = "dox"))] fn require_valid_signature(&self) -> Result<(), Error>; } @@ -86,6 +88,7 @@ impl> GpgVerifyResultExt for O { } } + #[cfg(any(feature = "v2016_6", feature = "dox"))] fn require_valid_signature(&self) -> Result<(), Error> { unsafe { let mut error = ptr::null_mut(); diff --git a/rust-bindings/rust/src/auto/mod.rs b/rust-bindings/rust/src/auto/mod.rs index 18ffe462..400198f2 100644 --- a/rust-bindings/rust/src/auto/mod.rs +++ b/rust-bindings/rust/src/auto/mod.rs @@ -53,7 +53,6 @@ pub use self::enums::RepoCheckoutOverwriteMode; pub use self::enums::RepoMode; pub use self::enums::RepoPruneFlags; pub use self::enums::RepoRemoteChange; -pub use self::enums::RepoResolveRevExtFlags; pub use self::enums::StaticDeltaGenerateOpt; mod flags; @@ -61,6 +60,7 @@ mod flags; pub use self::flags::RepoCommitState; pub use self::flags::RepoListRefsExtFlags; pub use self::flags::RepoPullFlags; +pub use self::flags::RepoResolveRevExtFlags; pub use self::flags::SePolicyRestoreconFlags; pub mod functions; @@ -81,6 +81,8 @@ 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; +#[cfg(any(feature = "v2018_9", feature = "dox"))] +pub use self::constants::META_KEY_DEPLOY_COLLECTION_ID; #[cfg(any(feature = "v2018_3", feature = "dox"))] pub use self::constants::ORIGIN_TRANSIENT_GROUP; #[cfg(any(feature = "v2018_6", feature = "dox"))] diff --git a/rust-bindings/rust/src/auto/mutable_tree.rs b/rust-bindings/rust/src/auto/mutable_tree.rs index b7c49668..5fc898f5 100644 --- a/rust-bindings/rust/src/auto/mutable_tree.rs +++ b/rust-bindings/rust/src/auto/mutable_tree.rs @@ -3,6 +3,7 @@ // DO NOT EDIT use Error; +#[cfg(any(feature = "v2018_7", feature = "dox"))] use Repo; use ffi; use glib::object::IsA; @@ -27,6 +28,7 @@ impl MutableTree { } } + #[cfg(any(feature = "v2018_7", feature = "dox"))] pub fn new_from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree { unsafe { from_glib_full(ffi::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0)) @@ -48,6 +50,7 @@ pub trait MutableTreeExt { //fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result; + #[cfg(any(feature = "v2018_7", feature = "dox"))] fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool; fn get_contents_checksum(&self) -> Option; @@ -58,6 +61,9 @@ pub trait MutableTreeExt { //fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 }; + #[cfg(any(feature = "v2018_9", feature = "dox"))] + fn remove(&self, name: &str, allow_noent: bool) -> Result<(), Error>; + fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error>; fn set_contents_checksum(&self, checksum: &str); @@ -90,6 +96,7 @@ impl> MutableTreeExt for O { // unsafe { TODO: call ffi::ostree_mutable_tree_ensure_parent_dirs() } //} + #[cfg(any(feature = "v2018_7", feature = "dox"))] fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool { unsafe { from_glib(ffi::ostree_mutable_tree_fill_empty_from_dirtree(self.to_glib_none().0, repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0)) @@ -116,6 +123,15 @@ impl> MutableTreeExt for O { // unsafe { TODO: call ffi::ostree_mutable_tree_get_subdirs() } //} + #[cfg(any(feature = "v2018_9", feature = "dox"))] + fn remove(&self, name: &str, allow_noent: bool) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ostree_mutable_tree_remove(self.to_glib_none().0, name.to_glib_none().0, allow_noent.to_glib(), &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error> { unsafe { let mut error = ptr::null_mut(); diff --git a/rust-bindings/rust/src/auto/repo.rs b/rust-bindings/rust/src/auto/repo.rs index 02cbd47d..1f3216d5 100644 --- a/rust-bindings/rust/src/auto/repo.rs +++ b/rust-bindings/rust/src/auto/repo.rs @@ -21,6 +21,7 @@ use RepoMode; use RepoPruneFlags; use RepoPullFlags; use RepoRemoteChange; +#[cfg(any(feature = "v2016_7", feature = "dox"))] use RepoResolveRevExtFlags; use RepoTransactionStats; use StaticDeltaGenerateOpt; @@ -69,6 +70,7 @@ impl Repo { } } + #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn create_at<'a, P: Into>>(dfd: i32, path: &str, mode: RepoMode, options: &glib::Variant, cancellable: P) -> Result { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); @@ -79,6 +81,7 @@ impl Repo { } } + #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn open_at<'a, P: Into>>(dfd: i32, path: &str, cancellable: P) -> Result { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); @@ -115,6 +118,7 @@ pub trait RepoExt { fn append_gpg_signature<'a, P: Into>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error>; + //#[cfg(any(feature = "v2016_8", feature = "dox"))] //fn checkout_at<'a, 'b, P: Into>, Q: Into>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>; fn checkout_gc<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error>; @@ -139,27 +143,41 @@ pub trait RepoExt { #[cfg(any(feature = "v2017_15", feature = "dox"))] fn fsck_object<'a, P: Into>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error>; + #[cfg(any(feature = "v2019_2", feature = "dox"))] + fn get_bootloader(&self) -> Option; + #[cfg(any(feature = "v2018_6", feature = "dox"))] fn get_collection_id(&self) -> Option; fn get_config(&self) -> Option; + #[cfg(any(feature = "v2018_9", feature = "dox"))] + fn get_default_repo_finders(&self) -> Vec; + + #[cfg(any(feature = "v2016_4", feature = "dox"))] fn get_dfd(&self) -> i32; fn get_disable_fsync(&self) -> bool; + #[cfg(any(feature = "v2018_9", feature = "dox"))] + fn get_min_free_space_bytes(&self) -> Result; + fn get_mode(&self) -> RepoMode; fn get_parent(&self) -> Option; fn get_path(&self) -> Option; + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result; + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result, Error>; + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_remote_option<'a, P: Into>>(&self, remote_name: &str, option_name: &str, default_value: P) -> Result; + #[cfg(any(feature = "v2016_6", feature = "dox"))] fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into>, Q: IsA + 'b, R: Into>, S: IsA + 'c, T: Into>, U: Into>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result; fn has_object<'a, P: Into>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result; @@ -171,6 +189,7 @@ pub trait RepoExt { fn import_object_from<'a, P: Into>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(), Error>; + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn import_object_from_with_trust<'a, P: Into>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: P) -> Result<(), Error>; fn is_system(&self) -> bool; @@ -186,6 +205,7 @@ pub trait RepoExt { //fn list_refs<'a, 'b, P: Into>, Q: Into>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Q) -> Result<(), Error>; + //#[cfg(any(feature = "v2016_4", feature = "dox"))] //fn list_refs_ext<'a, 'b, P: Into>, Q: Into>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Q) -> Result<(), Error>; //fn list_static_delta_names<'a, P: Into>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>; @@ -210,6 +230,7 @@ pub trait RepoExt { fn prune<'a, P: Into>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error>; + //#[cfg(any(feature = "v2017_1", feature = "dox"))] //fn prune_from_reachable<'a, P: Into>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error>; fn prune_static_deltas<'a, 'b, P: Into>, Q: Into>>(&self, commit: P, cancellable: Q) -> Result<(), Error>; @@ -228,6 +249,7 @@ pub trait RepoExt { fn regenerate_summary<'a, 'b, P: Into>, Q: Into>>(&self, additional_metadata: P, cancellable: Q) -> Result<(), Error>; + #[cfg(any(feature = "v2017_2", feature = "dox"))] fn reload_config<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error>; fn remote_add<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, url: &str, options: P, cancellable: Q) -> Result<(), Error>; @@ -238,6 +260,7 @@ pub trait RepoExt { fn remote_fetch_summary<'a, P: Into>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error>; + #[cfg(any(feature = "v2016_6", feature = "dox"))] fn remote_fetch_summary_with_options<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error>; fn remote_get_gpg_verify(&self, name: &str) -> Result; @@ -261,12 +284,15 @@ pub trait RepoExt { fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result; + #[cfg(any(feature = "v2016_7", feature = "dox"))] fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result; fn scan_hardlinks<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error>; + #[cfg(any(feature = "v2017_10", feature = "dox"))] fn set_alias_ref_immediate<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, remote: P, ref_: &str, target: Q, cancellable: R) -> Result<(), Error>; + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn set_cache_dir<'a, P: Into>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error>; #[cfg(any(feature = "v2018_6", feature = "dox"))] @@ -308,6 +334,7 @@ pub trait RepoExt { fn verify_commit_ext<'a, 'b, 'c, P: IsA + 'a, Q: Into>, R: IsA + 'b, S: Into>, T: Into>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result; + #[cfg(any(feature = "v2016_14", feature = "dox"))] fn verify_commit_for_remote<'a, P: Into>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result; fn verify_summary<'a, P: Into>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result; @@ -378,6 +405,7 @@ impl + IsA> RepoExt for O { } } + //#[cfg(any(feature = "v2016_8", feature = "dox"))] //fn checkout_at<'a, 'b, P: Into>, Q: Into>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_checkout_at() } //} @@ -465,6 +493,13 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2019_2", feature = "dox"))] + fn get_bootloader(&self) -> Option { + unsafe { + from_glib_none(ffi::ostree_repo_get_bootloader(self.to_glib_none().0)) + } + } + #[cfg(any(feature = "v2018_6", feature = "dox"))] fn get_collection_id(&self) -> Option { unsafe { @@ -478,6 +513,14 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2018_9", feature = "dox"))] + fn get_default_repo_finders(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::ostree_repo_get_default_repo_finders(self.to_glib_none().0)) + } + } + + #[cfg(any(feature = "v2016_4", feature = "dox"))] fn get_dfd(&self) -> i32 { unsafe { ffi::ostree_repo_get_dfd(self.to_glib_none().0) @@ -490,6 +533,16 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2018_9", feature = "dox"))] + fn get_min_free_space_bytes(&self) -> Result { + unsafe { + let mut out_reserved_bytes = mem::uninitialized(); + let mut error = ptr::null_mut(); + let _ = ffi::ostree_repo_get_min_free_space_bytes(self.to_glib_none().0, &mut out_reserved_bytes, &mut error); + if error.is_null() { Ok(out_reserved_bytes) } else { Err(from_glib_full(error)) } + } + } + fn get_mode(&self) -> RepoMode { unsafe { from_glib(ffi::ostree_repo_get_mode(self.to_glib_none().0)) @@ -508,6 +561,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result { unsafe { let mut out_value = mem::uninitialized(); @@ -517,6 +571,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result, Error> { unsafe { let mut out_value = ptr::null_mut(); @@ -526,6 +581,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_remote_option<'a, P: Into>>(&self, remote_name: &str, option_name: &str, default_value: P) -> Result { let default_value = default_value.into(); let default_value = default_value.to_glib_none(); @@ -537,6 +593,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_6", feature = "dox"))] fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into>, Q: IsA + 'b, R: Into>, S: IsA + 'c, T: Into>, U: Into>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result { let remote_name = remote_name.into(); let remote_name = remote_name.to_glib_none(); @@ -585,6 +642,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn import_object_from_with_trust<'a, P: Into>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); @@ -626,6 +684,7 @@ impl + IsA> RepoExt for O { // unsafe { TODO: call ffi::ostree_repo_list_refs() } //} + //#[cfg(any(feature = "v2016_4", feature = "dox"))] //fn list_refs_ext<'a, 'b, P: Into>, Q: Into>>(&self, refspec_prefix: P, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Q) -> Result<(), Error> { // unsafe { TODO: call ffi::ostree_repo_list_refs_ext() } //} @@ -731,6 +790,7 @@ impl + IsA> RepoExt for O { } } + //#[cfg(any(feature = "v2017_1", feature = "dox"))] //fn prune_from_reachable<'a, P: Into>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error> { // unsafe { TODO: call ffi::ostree_repo_prune_from_reachable() } //} @@ -829,6 +889,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2017_2", feature = "dox"))] fn reload_config<'a, P: Into>>(&self, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); @@ -887,6 +948,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_6", feature = "dox"))] fn remote_fetch_summary_with_options<'a, 'b, P: Into>, Q: Into>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error> { let options = options.into(); let options = options.to_glib_none(); @@ -977,6 +1039,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_7", feature = "dox"))] fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result { unsafe { let mut out_rev = ptr::null_mut(); @@ -996,6 +1059,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2017_10", feature = "dox"))] fn set_alias_ref_immediate<'a, 'b, 'c, P: Into>, Q: Into>, R: Into>>(&self, remote: P, ref_: &str, target: Q, cancellable: R) -> Result<(), Error> { let remote = remote.into(); let remote = remote.to_glib_none(); @@ -1010,6 +1074,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn set_cache_dir<'a, P: Into>>(&self, dfd: i32, path: &str, cancellable: P) -> Result<(), Error> { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); @@ -1183,6 +1248,7 @@ impl + IsA> RepoExt for O { } } + #[cfg(any(feature = "v2016_14", feature = "dox"))] fn verify_commit_for_remote<'a, P: Into>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); diff --git a/rust-bindings/rust/src/auto/se_policy.rs b/rust-bindings/rust/src/auto/se_policy.rs index f801e478..588895b2 100644 --- a/rust-bindings/rust/src/auto/se_policy.rs +++ b/rust-bindings/rust/src/auto/se_policy.rs @@ -35,6 +35,7 @@ impl SePolicy { } } + #[cfg(any(feature = "v2017_4", feature = "dox"))] pub fn new_at<'a, P: Into>>(rootfs_dfd: i32, cancellable: P) -> Result { let cancellable = cancellable.into(); let cancellable = cancellable.to_glib_none(); @@ -51,6 +52,7 @@ impl SePolicy { } pub trait SePolicyExt { + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_csum(&self) -> Option; fn get_label<'a, P: Into>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result; @@ -67,6 +69,7 @@ pub trait SePolicyExt { } impl + IsA> SePolicyExt for O { + #[cfg(any(feature = "v2016_5", feature = "dox"))] fn get_csum(&self) -> Option { unsafe { from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0)) diff --git a/rust-bindings/rust/sys/Cargo.toml b/rust-bindings/rust/sys/Cargo.toml index e13672bf..235622a0 100644 --- a/rust-bindings/rust/sys/Cargo.toml +++ b/rust-bindings/rust/sys/Cargo.toml @@ -18,12 +18,20 @@ tempdir = "0.3" dox = [] v2014_9 = [] v2015_7 = ["v2014_9"] +v2016_14 = ["v2016_8"] +v2016_4 = ["v2015_7"] +v2016_5 = ["v2016_4"] +v2016_6 = ["v2016_5"] +v2016_7 = ["v2016_6"] +v2016_8 = ["v2016_7"] +v2017_1 = ["v2016_14"] v2017_10 = ["v2017_9"] v2017_11 = ["v2017_10"] v2017_12 = ["v2017_11"] v2017_13 = ["v2017_12"] v2017_15 = ["v2017_13"] -v2017_3 = ["v2015_7"] +v2017_2 = ["v2017_1"] +v2017_3 = ["v2017_2"] v2017_4 = ["v2017_3"] v2017_6 = ["v2017_4"] v2017_7 = ["v2017_6"] @@ -34,6 +42,8 @@ v2018_3 = ["v2018_2"] v2018_5 = ["v2018_3"] v2018_6 = ["v2018_5"] v2018_7 = ["v2018_6"] +v2018_9 = ["v2018_7"] +v2019_2 = ["v2018_9"] [lib] name = "ostree_sys" @@ -49,6 +59,6 @@ license = "MIT" links = "ostree-1" name = "ostree-sys" repository = "https://gitlab.com/fkrull/ostree-rs" -version = "0.2.0" +version = "0.3.0" [package.metadata.docs.rs] features = ["dox"] diff --git a/rust-bindings/rust/sys/build.rs b/rust-bindings/rust/sys/build.rs index ba199e44..700f87bd 100644 --- a/rust-bindings/rust/sys/build.rs +++ b/rust-bindings/rust/sys/build.rs @@ -16,7 +16,11 @@ fn main() { fn find() -> Result<(), Error> { let package_name = "ostree-1"; let shared_libs = ["ostree-1"]; - let version = if cfg!(feature = "v2018_7") { + let version = if cfg!(feature = "v2019_2") { + "2019.2" + } else if cfg!(feature = "v2018_9") { + "2018.9" + } else if cfg!(feature = "v2018_7") { "2018.7" } else if cfg!(feature = "v2018_6") { "2018.6" @@ -48,6 +52,22 @@ fn find() -> Result<(), Error> { "2017.4" } else if cfg!(feature = "v2017_3") { "2017.3" + } else if cfg!(feature = "v2017_2") { + "2017.2" + } else if cfg!(feature = "v2017_1") { + "2017.1" + } else if cfg!(feature = "v2016_14") { + "2016.14" + } else if cfg!(feature = "v2016_8") { + "2016.8" + } else if cfg!(feature = "v2016_7") { + "2016.7" + } else if cfg!(feature = "v2016_6") { + "2016.6" + } else if cfg!(feature = "v2016_5") { + "2016.5" + } else if cfg!(feature = "v2016_4") { + "2016.4" } else if cfg!(feature = "v2015_7") { "2015.7" } else { diff --git a/rust-bindings/rust/sys/src/lib.rs b/rust-bindings/rust/sys/src/lib.rs index e70d101d..c8151c58 100644 --- a/rust-bindings/rust/sys/src/lib.rs +++ b/rust-bindings/rust/sys/src/lib.rs @@ -105,10 +105,7 @@ pub const OSTREE_REPO_REMOTE_CHANGE_ADD: OstreeRepoRemoteChange = 0; pub const OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS: OstreeRepoRemoteChange = 1; pub const OSTREE_REPO_REMOTE_CHANGE_DELETE: OstreeRepoRemoteChange = 2; pub const OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS: OstreeRepoRemoteChange = 3; - -pub type RepoResolveRevExtFlags = c_int; -pub const OSTREE_REPO_RESOLVE_REV_EXT_NONE: RepoResolveRevExtFlags = 0; -pub type OstreeRepoResolveRevExtFlags = RepoResolveRevExtFlags; +pub const OSTREE_REPO_REMOTE_CHANGE_REPLACE: OstreeRepoRemoteChange = 4; pub type OstreeStaticDeltaGenerateOpt = c_int; pub const OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY: OstreeStaticDeltaGenerateOpt = 0; @@ -126,6 +123,7 @@ pub const OSTREE_DIRMETA_GVARIANT_STRING: *const c_char = b"(uuua(ayay))\0" as * pub const OSTREE_FILEMETA_GVARIANT_STRING: *const c_char = b"(uuua(ayay))\0" as *const u8 as *const c_char; pub const OSTREE_MAX_METADATA_SIZE: c_int = 10485760; pub const OSTREE_MAX_METADATA_WARN_SIZE: c_int = 7340032; +pub const OSTREE_META_KEY_DEPLOY_COLLECTION_ID: *const c_char = b"ostree.deploy-collection-id\0" as *const u8 as *const c_char; pub const OSTREE_ORIGIN_TRANSIENT_GROUP: *const c_char = b"libostree-transient\0" as *const u8 as *const c_char; pub const OSTREE_REPO_METADATA_REF: *const c_char = b"ostree-metadata\0" as *const u8 as *const c_char; pub const OSTREE_SHA256_DIGEST_LEN: c_int = 32; @@ -170,6 +168,7 @@ pub type OstreeRepoListRefsExtFlags = c_uint; pub const OSTREE_REPO_LIST_REFS_EXT_NONE: OstreeRepoListRefsExtFlags = 0; pub const OSTREE_REPO_LIST_REFS_EXT_ALIASES: OstreeRepoListRefsExtFlags = 1; pub const OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES: OstreeRepoListRefsExtFlags = 2; +pub const OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS: OstreeRepoListRefsExtFlags = 4; pub type OstreeRepoPullFlags = c_uint; pub const OSTREE_REPO_PULL_FLAGS_NONE: OstreeRepoPullFlags = 0; @@ -179,6 +178,10 @@ pub const OSTREE_REPO_PULL_FLAGS_UNTRUSTED: OstreeRepoPullFlags = 4; pub const OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES: OstreeRepoPullFlags = 8; pub const OSTREE_REPO_PULL_FLAGS_TRUSTED_HTTP: OstreeRepoPullFlags = 16; +pub type OstreeRepoResolveRevExtFlags = c_uint; +pub const OSTREE_REPO_RESOLVE_REV_EXT_NONE: OstreeRepoResolveRevExtFlags = 0; +pub const OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY: OstreeRepoResolveRevExtFlags = 1; + pub type OstreeSePolicyRestoreconFlags = c_uint; pub const OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE: OstreeSePolicyRestoreconFlags = 0; pub const OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL: OstreeSePolicyRestoreconFlags = 1; @@ -429,7 +432,8 @@ pub struct OstreeRepoCheckoutAtOptions { pub no_copy_fallback: gboolean, pub force_copy: gboolean, pub bareuseronly_dirs: gboolean, - pub unused_bools: [gboolean; 5], + pub force_copy_zerosized: gboolean, + pub unused_bools: [gboolean; 4], pub subpath: *const c_char, pub devino_to_csum_cache: *mut OstreeRepoDevInoCache, pub unused_ints: [c_int; 6], @@ -451,6 +455,7 @@ impl ::std::fmt::Debug for OstreeRepoCheckoutAtOptions { .field("no_copy_fallback", &self.no_copy_fallback) .field("force_copy", &self.force_copy) .field("bareuseronly_dirs", &self.bareuseronly_dirs) + .field("force_copy_zerosized", &self.force_copy_zerosized) .field("unused_bools", &self.unused_bools) .field("subpath", &self.subpath) .field("devino_to_csum_cache", &self.devino_to_csum_cache) @@ -697,7 +702,8 @@ pub struct OstreeRepoTransactionStats { pub content_objects_total: c_uint, pub content_objects_written: c_uint, pub content_bytes_written: u64, - pub padding1: u64, + pub devino_cache_hits: c_uint, + pub padding1: c_uint, pub padding2: u64, pub padding3: u64, pub padding4: u64, @@ -711,6 +717,7 @@ impl ::std::fmt::Debug for OstreeRepoTransactionStats { .field("content_objects_total", &self.content_objects_total) .field("content_objects_written", &self.content_objects_written) .field("content_bytes_written", &self.content_bytes_written) + .field("devino_cache_hits", &self.devino_cache_hits) .field("padding1", &self.padding1) .field("padding2", &self.padding2) .field("padding3", &self.padding3) @@ -960,6 +967,7 @@ extern "C" { //========================================================================= // OstreeRepoCheckoutAtOptions //========================================================================= + #[cfg(any(feature = "v2017_13", feature = "dox"))] pub fn ostree_repo_checkout_at_options_set_devino(opts: *mut OstreeRepoCheckoutAtOptions, cache: *mut OstreeRepoDevInoCache); //========================================================================= @@ -1064,6 +1072,7 @@ extern "C" { pub fn ostree_deployment_hash(v: gconstpointer) -> c_uint; #[cfg(any(feature = "v2018_3", feature = "dox"))] pub fn ostree_deployment_origin_remove_transient_state(origin: *mut glib::GKeyFile); + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_deployment_unlocked_state_to_string(state: OstreeDeploymentUnlockedState) -> *const c_char; pub fn ostree_deployment_clone(self_: *mut OstreeDeployment) -> *mut OstreeDeployment; pub fn ostree_deployment_equal(ap: gconstpointer, bp: gconstpointer) -> gboolean; @@ -1076,6 +1085,7 @@ extern "C" { pub fn ostree_deployment_get_origin(self_: *mut OstreeDeployment) -> *mut glib::GKeyFile; pub fn ostree_deployment_get_origin_relpath(self_: *mut OstreeDeployment) -> *mut c_char; pub fn ostree_deployment_get_osname(self_: *mut OstreeDeployment) -> *const c_char; + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_deployment_get_unlocked(self_: *mut OstreeDeployment) -> OstreeDeploymentUnlockedState; #[cfg(any(feature = "v2018_3", feature = "dox"))] pub fn ostree_deployment_is_pinned(self_: *mut OstreeDeployment) -> gboolean; @@ -1097,6 +1107,7 @@ extern "C" { pub fn ostree_gpg_verify_result_get(result: *mut OstreeGpgVerifyResult, signature_index: c_uint, attrs: *mut OstreeGpgSignatureAttr, n_attrs: c_uint) -> *mut glib::GVariant; pub fn ostree_gpg_verify_result_get_all(result: *mut OstreeGpgVerifyResult, signature_index: c_uint) -> *mut glib::GVariant; pub fn ostree_gpg_verify_result_lookup(result: *mut OstreeGpgVerifyResult, key_id: *const c_char, out_signature_index: *mut c_uint) -> gboolean; + #[cfg(any(feature = "v2016_6", feature = "dox"))] pub fn ostree_gpg_verify_result_require_valid_signature(result: *mut OstreeGpgVerifyResult, error: *mut *mut glib::GError) -> gboolean; //========================================================================= @@ -1104,17 +1115,21 @@ extern "C" { //========================================================================= pub fn ostree_mutable_tree_get_type() -> GType; pub fn ostree_mutable_tree_new() -> *mut OstreeMutableTree; + #[cfg(any(feature = "v2018_7", feature = "dox"))] pub fn ostree_mutable_tree_new_from_checksum(repo: *mut OstreeRepo, contents_checksum: *const c_char, metadata_checksum: *const c_char) -> *mut OstreeMutableTree; #[cfg(any(feature = "v2018_7", feature = "dox"))] pub fn ostree_mutable_tree_check_error(self_: *mut OstreeMutableTree, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_mutable_tree_ensure_dir(self_: *mut OstreeMutableTree, name: *const c_char, out_subdir: *mut *mut OstreeMutableTree, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_mutable_tree_ensure_parent_dirs(self_: *mut OstreeMutableTree, split_path: *mut glib::GPtrArray, metadata_checksum: *const c_char, out_parent: *mut *mut OstreeMutableTree, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2018_7", feature = "dox"))] pub fn ostree_mutable_tree_fill_empty_from_dirtree(self_: *mut OstreeMutableTree, repo: *mut OstreeRepo, contents_checksum: *const c_char, metadata_checksum: *const c_char) -> gboolean; pub fn ostree_mutable_tree_get_contents_checksum(self_: *mut OstreeMutableTree) -> *const c_char; pub fn ostree_mutable_tree_get_files(self_: *mut OstreeMutableTree) -> *mut glib::GHashTable; pub fn ostree_mutable_tree_get_metadata_checksum(self_: *mut OstreeMutableTree) -> *const c_char; pub fn ostree_mutable_tree_get_subdirs(self_: *mut OstreeMutableTree) -> *mut glib::GHashTable; pub fn ostree_mutable_tree_lookup(self_: *mut OstreeMutableTree, name: *const c_char, out_file_checksum: *mut *mut c_char, out_subdir: *mut *mut OstreeMutableTree, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2018_9", feature = "dox"))] + pub fn ostree_mutable_tree_remove(self_: *mut OstreeMutableTree, name: *const c_char, allow_noent: gboolean, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_mutable_tree_replace_file(self_: *mut OstreeMutableTree, name: *const c_char, checksum: *const c_char, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_mutable_tree_set_contents_checksum(self_: *mut OstreeMutableTree, checksum: *const c_char); pub fn ostree_mutable_tree_set_metadata_checksum(self_: *mut OstreeMutableTree, checksum: *const c_char); @@ -1127,8 +1142,10 @@ extern "C" { pub fn ostree_repo_new(path: *mut gio::GFile) -> *mut OstreeRepo; pub fn ostree_repo_new_default() -> *mut OstreeRepo; pub fn ostree_repo_new_for_sysroot_path(repo_path: *mut gio::GFile, sysroot_path: *mut gio::GFile) -> *mut OstreeRepo; + #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn ostree_repo_create_at(dfd: c_int, path: *const c_char, mode: OstreeRepoMode, options: *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeRepo; pub fn ostree_repo_mode_from_string(mode: *const c_char, out_mode: *mut OstreeRepoMode, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn ostree_repo_open_at(dfd: c_int, path: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeRepo; pub fn ostree_repo_pull_default_console_progress_changed(progress: *mut OstreeAsyncProgress, user_data: gpointer); #[cfg(any(feature = "v2018_5", feature = "dox"))] @@ -1139,6 +1156,7 @@ extern "C" { pub fn ostree_repo_abort_transaction(self_: *mut OstreeRepo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_add_gpg_signature_summary(self_: *mut OstreeRepo, key_id: *mut *mut c_char, homedir: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_append_gpg_signature(self_: *mut OstreeRepo, commit_checksum: *const c_char, signature_bytes: *mut glib::GBytes, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_8", feature = "dox"))] pub fn ostree_repo_checkout_at(self_: *mut OstreeRepo, options: *mut OstreeRepoCheckoutAtOptions, destination_dfd: c_int, destination_path: *const c_char, commit: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_checkout_gc(self_: *mut OstreeRepo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_checkout_tree(self_: *mut OstreeRepo, mode: OstreeRepoCheckoutMode, overwrite_mode: OstreeRepoCheckoutOverwriteMode, destination: *mut gio::GFile, source: *mut OstreeRepoFile, source_info: *mut gio::GFileInfo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; @@ -1156,23 +1174,35 @@ extern "C" { pub fn ostree_repo_find_remotes_finish(self_: *mut OstreeRepo, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut *mut OstreeRepoFinderResult; #[cfg(any(feature = "v2017_15", feature = "dox"))] pub fn ostree_repo_fsck_object(self_: *mut OstreeRepo, objtype: OstreeObjectType, sha256: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2019_2", feature = "dox"))] + pub fn ostree_repo_get_bootloader(self_: *mut OstreeRepo) -> *const c_char; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_repo_get_collection_id(self_: *mut OstreeRepo) -> *const c_char; pub fn ostree_repo_get_config(self_: *mut OstreeRepo) -> *mut glib::GKeyFile; + #[cfg(any(feature = "v2018_9", feature = "dox"))] + pub fn ostree_repo_get_default_repo_finders(self_: *mut OstreeRepo) -> *mut *mut c_char; + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_repo_get_dfd(self_: *mut OstreeRepo) -> c_int; pub fn ostree_repo_get_disable_fsync(self_: *mut OstreeRepo) -> gboolean; + #[cfg(any(feature = "v2018_9", feature = "dox"))] + pub fn ostree_repo_get_min_free_space_bytes(self_: *mut OstreeRepo, out_reserved_bytes: *mut u64, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_get_mode(self_: *mut OstreeRepo) -> OstreeRepoMode; pub fn ostree_repo_get_parent(self_: *mut OstreeRepo) -> *mut OstreeRepo; pub fn ostree_repo_get_path(self_: *mut OstreeRepo) -> *mut gio::GFile; + #[cfg(any(feature = "v2016_5", feature = "dox"))] pub fn ostree_repo_get_remote_boolean_option(self_: *mut OstreeRepo, remote_name: *const c_char, option_name: *const c_char, default_value: gboolean, out_value: *mut gboolean, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_5", feature = "dox"))] pub fn ostree_repo_get_remote_list_option(self_: *mut OstreeRepo, remote_name: *const c_char, option_name: *const c_char, out_value: *mut *mut *mut c_char, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_5", feature = "dox"))] pub fn ostree_repo_get_remote_option(self_: *mut OstreeRepo, remote_name: *const c_char, option_name: *const c_char, default_value: *const c_char, out_value: *mut *mut c_char, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_6", feature = "dox"))] pub fn ostree_repo_gpg_verify_data(self_: *mut OstreeRepo, remote_name: *const c_char, data: *mut glib::GBytes, signatures: *mut glib::GBytes, keyringdir: *mut gio::GFile, extra_keyring: *mut gio::GFile, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeGpgVerifyResult; pub fn ostree_repo_has_object(self_: *mut OstreeRepo, objtype: OstreeObjectType, checksum: *const c_char, out_have_object: *mut gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; #[cfg(any(feature = "v2017_12", feature = "dox"))] pub fn ostree_repo_hash(self_: *mut OstreeRepo) -> c_uint; pub fn ostree_repo_import_archive_to_mtree(self_: *mut OstreeRepo, opts: *mut OstreeRepoImportArchiveOptions, archive: *mut c_void, mtree: *mut OstreeMutableTree, modifier: *mut OstreeRepoCommitModifier, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_import_object_from(self_: *mut OstreeRepo, source: *mut OstreeRepo, objtype: OstreeObjectType, checksum: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_5", feature = "dox"))] pub fn ostree_repo_import_object_from_with_trust(self_: *mut OstreeRepo, source: *mut OstreeRepo, objtype: OstreeObjectType, checksum: *const c_char, trusted: gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_is_system(repo: *mut OstreeRepo) -> gboolean; pub fn ostree_repo_is_writable(self_: *mut OstreeRepo, error: *mut *mut glib::GError) -> gboolean; @@ -1181,6 +1211,7 @@ extern "C" { pub fn ostree_repo_list_commit_objects_starting_with(self_: *mut OstreeRepo, start: *const c_char, out_commits: *mut *mut glib::GHashTable, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_list_objects(self_: *mut OstreeRepo, flags: OstreeRepoListObjectsFlags, out_objects: *mut *mut glib::GHashTable, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_list_refs(self_: *mut OstreeRepo, refspec_prefix: *const c_char, out_all_refs: *mut *mut glib::GHashTable, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_repo_list_refs_ext(self_: *mut OstreeRepo, refspec_prefix: *const c_char, out_all_refs: *mut *mut glib::GHashTable, flags: OstreeRepoListRefsExtFlags, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_list_static_delta_names(self_: *mut OstreeRepo, out_deltas: *mut *mut glib::GPtrArray, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; #[cfg(any(feature = "v2015_7", feature = "dox"))] @@ -1194,6 +1225,7 @@ extern "C" { pub fn ostree_repo_open(self_: *mut OstreeRepo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_prepare_transaction(self_: *mut OstreeRepo, out_transaction_resume: *mut gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_prune(self_: *mut OstreeRepo, flags: OstreeRepoPruneFlags, depth: c_int, out_objects_total: *mut c_int, out_objects_pruned: *mut c_int, out_pruned_object_size_total: *mut u64, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_1", feature = "dox"))] pub fn ostree_repo_prune_from_reachable(self_: *mut OstreeRepo, options: *mut OstreeRepoPruneOptions, out_objects_total: *mut c_int, out_objects_pruned: *mut c_int, out_pruned_object_size_total: *mut u64, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_prune_static_deltas(self_: *mut OstreeRepo, commit: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_pull(self_: *mut OstreeRepo, remote_name: *const c_char, refs_to_fetch: *mut *mut c_char, flags: OstreeRepoPullFlags, progress: *mut OstreeAsyncProgress, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; @@ -1207,11 +1239,13 @@ extern "C" { pub fn ostree_repo_read_commit(self_: *mut OstreeRepo, ref_: *const c_char, out_root: *mut *mut gio::GFile, out_commit: *mut *mut c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_read_commit_detached_metadata(self_: *mut OstreeRepo, checksum: *const c_char, out_metadata: *mut *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_regenerate_summary(self_: *mut OstreeRepo, additional_metadata: *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_2", feature = "dox"))] pub fn ostree_repo_reload_config(self_: *mut OstreeRepo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_remote_add(self_: *mut OstreeRepo, name: *const c_char, url: *const c_char, options: *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_remote_change(self_: *mut OstreeRepo, sysroot: *mut gio::GFile, changeop: OstreeRepoRemoteChange, name: *const c_char, url: *const c_char, options: *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_remote_delete(self_: *mut OstreeRepo, name: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_remote_fetch_summary(self_: *mut OstreeRepo, name: *const c_char, out_summary: *mut *mut glib::GBytes, out_signatures: *mut *mut glib::GBytes, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_6", feature = "dox"))] pub fn ostree_repo_remote_fetch_summary_with_options(self_: *mut OstreeRepo, name: *const c_char, options: *mut glib::GVariant, out_summary: *mut *mut glib::GBytes, out_signatures: *mut *mut glib::GBytes, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_remote_get_gpg_verify(self_: *mut OstreeRepo, name: *const c_char, out_gpg_verify: *mut gboolean, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_remote_get_gpg_verify_summary(self_: *mut OstreeRepo, name: *const c_char, out_gpg_verify_summary: *mut gboolean, error: *mut *mut glib::GError) -> gboolean; @@ -1226,9 +1260,12 @@ extern "C" { #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_repo_resolve_keyring_for_collection(self_: *mut OstreeRepo, collection_id: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeRemote; pub fn ostree_repo_resolve_rev(self_: *mut OstreeRepo, refspec: *const c_char, allow_noent: gboolean, out_rev: *mut *mut c_char, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_7", feature = "dox"))] pub fn ostree_repo_resolve_rev_ext(self_: *mut OstreeRepo, refspec: *const c_char, allow_noent: gboolean, flags: OstreeRepoResolveRevExtFlags, out_rev: *mut *mut c_char, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_scan_hardlinks(self_: *mut OstreeRepo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn ostree_repo_set_alias_ref_immediate(self_: *mut OstreeRepo, remote: *const c_char, ref_: *const c_char, target: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_5", feature = "dox"))] pub fn ostree_repo_set_cache_dir(self_: *mut OstreeRepo, dfd: c_int, path: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub fn ostree_repo_set_collection_id(self_: *mut OstreeRepo, collection_id: *const c_char, error: *mut *mut glib::GError) -> gboolean; @@ -1252,6 +1289,7 @@ extern "C" { pub fn ostree_repo_traverse_reachable_refs(self_: *mut OstreeRepo, depth: c_uint, reachable: *mut glib::GHashTable, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_verify_commit(self_: *mut OstreeRepo, commit_checksum: *const c_char, keyringdir: *mut gio::GFile, extra_keyring: *mut gio::GFile, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_repo_verify_commit_ext(self_: *mut OstreeRepo, commit_checksum: *const c_char, keyringdir: *mut gio::GFile, extra_keyring: *mut gio::GFile, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeGpgVerifyResult; + #[cfg(any(feature = "v2016_14", feature = "dox"))] pub fn ostree_repo_verify_commit_for_remote(self_: *mut OstreeRepo, commit_checksum: *const c_char, remote_name: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeGpgVerifyResult; pub fn ostree_repo_verify_summary(self_: *mut OstreeRepo, remote_name: *const c_char, summary: *mut glib::GBytes, signatures: *mut glib::GBytes, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeGpgVerifyResult; pub fn ostree_repo_write_archive_to_mtree(self_: *mut OstreeRepo, archive: *mut gio::GFile, mtree: *mut OstreeMutableTree, modifier: *mut OstreeRepoCommitModifier, autocreate_parents: gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; @@ -1327,8 +1365,10 @@ extern "C" { //========================================================================= pub fn ostree_sepolicy_get_type() -> GType; pub fn ostree_sepolicy_new(path: *mut gio::GFile, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeSePolicy; + #[cfg(any(feature = "v2017_4", feature = "dox"))] pub fn ostree_sepolicy_new_at(rootfs_dfd: c_int, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut OstreeSePolicy; pub fn ostree_sepolicy_fscreatecon_cleanup(unused: *mut *mut c_void); + #[cfg(any(feature = "v2016_5", feature = "dox"))] pub fn ostree_sepolicy_get_csum(self_: *mut OstreeSePolicy) -> *const c_char; pub fn ostree_sepolicy_get_label(self_: *mut OstreeSePolicy, relpath: *const c_char, unix_mode: u32, out_label: *mut *mut c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sepolicy_get_name(self_: *mut OstreeSePolicy) -> *const c_char; @@ -1351,6 +1391,7 @@ extern "C" { pub fn ostree_sysroot_deployment_set_mutable(self_: *mut OstreeSysroot, deployment: *mut OstreeDeployment, is_mutable: gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; #[cfg(any(feature = "v2018_3", feature = "dox"))] pub fn ostree_sysroot_deployment_set_pinned(self_: *mut OstreeSysroot, deployment: *mut OstreeDeployment, is_pinned: gboolean, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_sysroot_deployment_unlock(self_: *mut OstreeSysroot, deployment: *mut OstreeDeployment, unlocked_state: OstreeDeploymentUnlockedState, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_ensure_initialized(self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_get_booted_deployment(self_: *mut OstreeSysroot) -> *mut OstreeDeployment; @@ -1362,10 +1403,13 @@ extern "C" { pub fn ostree_sysroot_get_merge_deployment(self_: *mut OstreeSysroot, osname: *const c_char) -> *mut OstreeDeployment; pub fn ostree_sysroot_get_path(self_: *mut OstreeSysroot) -> *mut gio::GFile; pub fn ostree_sysroot_get_repo(self_: *mut OstreeSysroot, out_repo: *mut *mut OstreeRepo, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2018_5", feature = "dox"))] pub fn ostree_sysroot_get_staged_deployment(self_: *mut OstreeSysroot) -> *mut OstreeDeployment; pub fn ostree_sysroot_get_subbootversion(self_: *mut OstreeSysroot) -> c_int; + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_sysroot_init_osname(self_: *mut OstreeSysroot, osname: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_load(self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_4", feature = "dox"))] pub fn ostree_sysroot_load_if_changed(self_: *mut OstreeSysroot, out_changed: *mut gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_lock(self_: *mut OstreeSysroot, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_lock_async(self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer); @@ -1374,13 +1418,16 @@ extern "C" { pub fn ostree_sysroot_prepare_cleanup(self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; #[cfg(any(feature = "v2017_7", feature = "dox"))] pub fn ostree_sysroot_query_deployments_for(self_: *mut OstreeSysroot, osname: *const c_char, out_pending: *mut *mut OstreeDeployment, out_rollback: *mut *mut OstreeDeployment); + #[cfg(any(feature = "v2017_7", feature = "dox"))] pub fn ostree_sysroot_repo(self_: *mut OstreeSysroot) -> *mut OstreeRepo; pub fn ostree_sysroot_simple_write_deployment(sysroot: *mut OstreeSysroot, osname: *const c_char, new_deployment: *mut OstreeDeployment, merge_deployment: *mut OstreeDeployment, flags: OstreeSysrootSimpleWriteDeploymentFlags, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2018_5", feature = "dox"))] pub fn ostree_sysroot_stage_tree(self_: *mut OstreeSysroot, osname: *const c_char, revision: *const c_char, origin: *mut glib::GKeyFile, merge_deployment: *mut OstreeDeployment, override_kernel_argv: *mut *mut c_char, out_new_deployment: *mut *mut OstreeDeployment, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_try_lock(self_: *mut OstreeSysroot, out_acquired: *mut gboolean, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_unload(self_: *mut OstreeSysroot); pub fn ostree_sysroot_unlock(self_: *mut OstreeSysroot); pub fn ostree_sysroot_write_deployments(self_: *mut OstreeSysroot, new_deployments: *mut glib::GPtrArray, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_4", feature = "dox"))] pub fn ostree_sysroot_write_deployments_with_options(self_: *mut OstreeSysroot, new_deployments: *mut glib::GPtrArray, opts: *mut OstreeSysrootWriteDeploymentsOpts, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_sysroot_write_origin_file(sysroot: *mut OstreeSysroot, deployment: *mut OstreeDeployment, new_origin: *mut glib::GKeyFile, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; @@ -1418,10 +1465,13 @@ extern "C" { //========================================================================= #[cfg(any(feature = "v2017_15", feature = "dox"))] pub fn ostree_break_hardlink(dfd: c_int, path: *const c_char, skip_xattrs: gboolean, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_4", feature = "dox"))] pub fn ostree_check_version(required_year: c_uint, required_release: c_uint) -> gboolean; + #[cfg(any(feature = "v2016_8", feature = "dox"))] pub fn ostree_checksum_b64_from_bytes(csum: *mut [u8; 32]) -> *mut c_char; pub fn ostree_checksum_b64_inplace_from_bytes(csum: *mut [u8; 32], buf: *mut c_char); pub fn ostree_checksum_b64_inplace_to_bytes(checksum: *mut [c_char; 32], buf: *mut u8); + #[cfg(any(feature = "v2016_8", feature = "dox"))] pub fn ostree_checksum_b64_to_bytes(checksum: *const c_char) -> *mut [u8; 32]; pub fn ostree_checksum_bytes_peek(bytes: *mut glib::GVariant) -> *mut [u8; 32]; pub fn ostree_checksum_bytes_peek_validate(bytes: *mut glib::GVariant, error: *mut *mut glib::GError) -> *mut [u8; 32]; @@ -1439,6 +1489,7 @@ extern "C" { pub fn ostree_checksum_to_bytes_v(checksum: *const c_char) -> *mut glib::GVariant; //pub fn ostree_cmd__private__() -> /*Ignored*/*const OstreeCmdPrivateVTable; pub fn ostree_cmp_checksum_bytes(a: *const u8, b: *const u8) -> c_int; + #[cfg(any(feature = "v2018_2", feature = "dox"))] pub fn ostree_commit_get_content_checksum(commit_variant: *mut glib::GVariant) -> *mut c_char; pub fn ostree_commit_get_parent(commit_variant: *mut glib::GVariant) -> *mut c_char; pub fn ostree_commit_get_timestamp(commit_variant: *mut glib::GVariant) -> u64; @@ -1447,8 +1498,10 @@ extern "C" { pub fn ostree_content_stream_parse(compressed: gboolean, input: *mut gio::GInputStream, input_length: u64, trusted: gboolean, out_input: *mut *mut gio::GInputStream, out_file_info: *mut *mut gio::GFileInfo, out_xattrs: *mut *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_create_directory_metadata(dir_info: *mut gio::GFileInfo, xattrs: *mut glib::GVariant) -> *mut glib::GVariant; pub fn ostree_diff_dirs(flags: OstreeDiffFlags, a: *mut gio::GFile, b: *mut gio::GFile, modified: *mut glib::GPtrArray, removed: *mut glib::GPtrArray, added: *mut glib::GPtrArray, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2017_4", feature = "dox"))] pub fn ostree_diff_dirs_with_options(flags: OstreeDiffFlags, a: *mut gio::GFile, b: *mut gio::GFile, modified: *mut glib::GPtrArray, removed: *mut glib::GPtrArray, added: *mut glib::GPtrArray, options: *mut OstreeDiffDirsOptions, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; pub fn ostree_diff_print(a: *mut gio::GFile, b: *mut gio::GFile, modified: *mut glib::GPtrArray, removed: *mut glib::GPtrArray, added: *mut glib::GPtrArray); + #[cfg(any(feature = "v2017_10", feature = "dox"))] pub fn ostree_gpg_error_quark() -> glib::GQuark; pub fn ostree_hash_object_name(a: gconstpointer) -> c_uint; pub fn ostree_metadata_variant_type(objtype: OstreeObjectType) -> *const glib::GVariantType; @@ -1459,6 +1512,7 @@ extern "C" { pub fn ostree_object_type_from_string(str: *const c_char) -> OstreeObjectType; pub fn ostree_object_type_to_string(objtype: OstreeObjectType) -> *const c_char; pub fn ostree_parse_refspec(refspec: *const c_char, out_remote: *mut *mut c_char, out_ref: *mut *mut c_char, error: *mut *mut glib::GError) -> gboolean; + #[cfg(any(feature = "v2016_6", feature = "dox"))] pub fn ostree_raw_file_to_archive_z2_stream(input: *mut gio::GInputStream, file_info: *mut gio::GFileInfo, xattrs: *mut glib::GVariant, out_input: *mut *mut gio::GInputStream, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; #[cfg(any(feature = "v2017_3", feature = "dox"))] pub fn ostree_raw_file_to_archive_z2_stream_with_options(input: *mut gio::GInputStream, file_info: *mut gio::GFileInfo, xattrs: *mut glib::GVariant, options: *mut glib::GVariant, out_input: *mut *mut gio::GInputStream, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean; diff --git a/rust-bindings/rust/sys/tests/abi.rs b/rust-bindings/rust/sys/tests/abi.rs index 25bb819b..03e17c62 100644 --- a/rust-bindings/rust/sys/tests/abi.rs +++ b/rust-bindings/rust/sys/tests/abi.rs @@ -316,6 +316,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT", "0"), ("OSTREE_MAX_METADATA_SIZE", "10485760"), ("OSTREE_MAX_METADATA_WARN_SIZE", "7340032"), + ("OSTREE_META_KEY_DEPLOY_COLLECTION_ID", "ostree.deploy-collection-id"), ("OSTREE_OBJECT_TYPE_COMMIT", "4"), ("OSTREE_OBJECT_TYPE_COMMIT_META", "6"), ("OSTREE_OBJECT_TYPE_DIR_META", "3"), @@ -353,6 +354,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("OSTREE_REPO_LIST_OBJECTS_NO_PARENTS", "8"), ("OSTREE_REPO_LIST_OBJECTS_PACKED", "2"), ("OSTREE_REPO_LIST_REFS_EXT_ALIASES", "1"), + ("OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS", "4"), ("OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES", "2"), ("OSTREE_REPO_LIST_REFS_EXT_NONE", "0"), ("OSTREE_REPO_METADATA_REF", "ostree-metadata"), @@ -374,6 +376,8 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS", "1"), ("OSTREE_REPO_REMOTE_CHANGE_DELETE", "2"), ("OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS", "3"), + ("OSTREE_REPO_REMOTE_CHANGE_REPLACE", "4"), + ("OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY", "1"), ("OSTREE_REPO_RESOLVE_REV_EXT_NONE", "0"), ("OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL", "1"), ("OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING", "2"), diff --git a/rust-bindings/rust/sys/tests/manual.h b/rust-bindings/rust/sys/tests/manual.h index a358f11b..0e2e16c3 100644 --- a/rust-bindings/rust/sys/tests/manual.h +++ b/rust-bindings/rust/sys/tests/manual.h @@ -1,2 +1,9 @@ // Feel free to edit this file, it won't be regenerated by gir generator unless removed. #include + +// hack to build and test on versions of libostree < 2019.2 +#if !OSTREE_CHECK_VERSION(2019, 2) +# define OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS 4 +# define OSTREE_REPO_REMOTE_CHANGE_REPLACE 4 +# define OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY 1 +#endif