From 24b5148374927d143b327e3c6478b84b5b4253d8 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Tue, 25 Aug 2020 20:50:23 +0200 Subject: [PATCH] gir: fix out parameters not being marked correctly --- rust-bindings/rust/gir-files/OSTree-1.0.gir | 122 ++++++++++++------- rust-bindings/rust/src/auto/sign.rs | 18 +-- rust-bindings/rust/src/auto/versions.txt | 2 +- rust-bindings/rust/sys/src/auto/versions.txt | 2 +- 4 files changed, 91 insertions(+), 53 deletions(-) diff --git a/rust-bindings/rust/gir-files/OSTree-1.0.gir b/rust-bindings/rust/gir-files/OSTree-1.0.gir index 87775ddc..e457d524 100644 --- a/rust-bindings/rust/gir-files/OSTree-1.0.gir +++ b/rust-bindings/rust/gir-files/OSTree-1.0.gir @@ -13806,13 +13806,13 @@ will be returned. version="2020.2"> Return an array with newly allocated instances of all available + line="520">Return an array with newly allocated instances of all available signing engines; they will not be initialized. an array of signing engines + line="526">an array of signing engines @@ -13824,19 +13824,19 @@ signing engines; they will not be initialized. throws="1"> Create a new instance of a signing engine. + line="544">Create a new instance of a signing engine. New signing engine, or %NULL if the engine is not known + line="551">New signing engine, or %NULL if the engine is not known the name of desired signature engine + line="546">the name of desired signature engine @@ -13957,7 +13957,7 @@ or #ostree_sign_load_pk. @TRUE if @data has been signed at least with any single valid key, + line="317">@TRUE if @data has been signed at least with any single valid key, @FALSE in case of error or no valid keys are available (@error will contain the reason). @@ -13980,7 +13980,16 @@ or #ostree_sign_load_pk. line="307">the signatures to be checked - + + success message returned by the signing engine @@ -13988,12 +13997,12 @@ or #ostree_sign_load_pk. Return the pointer to the name of currently used/selected signing engine. + line="438">Return the pointer to the name of currently used/selected signing engine. pointer to the name + line="444">pointer to the name @NULL in case of error (unlikely). @@ -14001,7 +14010,7 @@ or #ostree_sign_load_pk. an #OstreeSign object + line="440">an #OstreeSign object @@ -14221,7 +14230,7 @@ The @public_key argument depends of the particular engine implementation. throws="1"> Add a signature to a commit. + line="458">Add a signature to a commit. Depending of the signing engine used you will need to load the secret key with #ostree_sign_set_sk. @@ -14229,7 +14238,7 @@ the secret key with #ostree_sign_set_sk. @TRUE if commit has been signed successfully, + line="471">@TRUE if commit has been signed successfully, @FALSE in case of error (@error will contain the reason). @@ -14237,19 +14246,19 @@ the secret key with #ostree_sign_set_sk. an #OstreeSign object + line="460">an #OstreeSign object an #OsreeRepo object + line="461">an #OsreeRepo object SHA256 of given commit to sign + line="462">SHA256 of given commit to sign allow-none="1"> A #GCancellable + line="463">A #GCancellable @@ -14269,7 +14278,7 @@ the secret key with #ostree_sign_set_sk. throws="1"> Verify if commit is signed with known key. + line="371">Verify if commit is signed with known key. Depending of the signing engine used you will need to load the public key(s) for verification with #ostree_sign_set_pk, @@ -14278,7 +14287,7 @@ the public key(s) for verification with #ostree_sign_set_pk, @TRUE if commit has been verified successfully, + line="386">@TRUE if commit has been verified successfully, @FALSE in case of error or no valid keys are available (@error will contain the reason). @@ -14286,22 +14295,31 @@ the public key(s) for verification with #ostree_sign_set_pk, an #OstreeSign object + line="373">an #OstreeSign object an #OsreeRepo object + line="374">an #OsreeRepo object SHA256 of given commit to verify + line="375">SHA256 of given commit to verify - + + success message returned by the signing engine A #GCancellable + line="377">A #GCancellable @@ -14378,7 +14396,7 @@ or #ostree_sign_load_pk. @TRUE if @data has been signed at least with any single valid key, + line="317">@TRUE if @data has been signed at least with any single valid key, @FALSE in case of error or no valid keys are available (@error will contain the reason). @@ -14401,7 +14419,16 @@ or #ostree_sign_load_pk. line="307">the signatures to be checked - + + success message returned by the signing engine @@ -14701,12 +14728,12 @@ or #ostree_sign_load_pk. version="2020.2"> Return the pointer to the name of currently used/selected signing engine. + line="438">Return the pointer to the name of currently used/selected signing engine. pointer to the name + line="444">pointer to the name @NULL in case of error (unlikely). @@ -14714,7 +14741,7 @@ or #ostree_sign_load_pk. an #OstreeSign object + line="440">an #OstreeSign object @@ -14878,32 +14905,32 @@ The @secret_key argument depends of the particular engine implementation. throws="1"> Add a signature to a summary file. + line="586">Add a signature to a summary file. Based on ostree_repo_add_gpg_signature_summary implementation. @TRUE if summary file has been signed with all provided keys + line="597">@TRUE if summary file has been signed with all provided keys Self + line="588">Self ostree repository + line="589">ostree repository keys -- GVariant containing keys as GVarints specific to signature type. + line="590">keys -- GVariant containing keys as GVarints specific to signature type. allow-none="1"> A #GCancellable + line="591">A #GCancellable @@ -14949,7 +14976,7 @@ Based on ostree_repo_add_gpg_signature_summary implementation. pointer to the name + line="444">pointer to the name @NULL in case of error (unlikely). @@ -14957,7 +14984,7 @@ Based on ostree_repo_add_gpg_signature_summary implementation. an #OstreeSign object + line="440">an #OstreeSign object @@ -15010,7 +15037,7 @@ Based on ostree_repo_add_gpg_signature_summary implementation. @TRUE if @data has been signed at least with any single valid key, + line="317">@TRUE if @data has been signed at least with any single valid key, @FALSE in case of error or no valid keys are available (@error will contain the reason). @@ -15033,7 +15060,16 @@ Based on ostree_repo_add_gpg_signature_summary implementation. line="307">the signatures to be checked - + + success message returned by the signing engine @@ -19197,13 +19233,13 @@ for writing data to an #OstreeRepo. version="2020.2"> Return an array with newly allocated instances of all available + line="520">Return an array with newly allocated instances of all available signing engines; they will not be initialized. an array of signing engines + line="526">an array of signing engines @@ -19216,19 +19252,19 @@ signing engines; they will not be initialized. throws="1"> Create a new instance of a signing engine. + line="544">Create a new instance of a signing engine. New signing engine, or %NULL if the engine is not known + line="551">New signing engine, or %NULL if the engine is not known the name of desired signature engine + line="546">the name of desired signature engine diff --git a/rust-bindings/rust/src/auto/sign.rs b/rust-bindings/rust/src/auto/sign.rs index b92b953b..3583a61f 100644 --- a/rust-bindings/rust/src/auto/sign.rs +++ b/rust-bindings/rust/src/auto/sign.rs @@ -56,13 +56,13 @@ pub trait SignExt: 'static { fn commit>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error>; #[cfg(any(feature = "v2020_2", feature = "dox"))] - fn commit_verify>(&self, repo: &Repo, commit_checksum: &str, out_success_message: &str, cancellable: Option<&P>) -> Result<(), glib::Error>; + fn commit_verify>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result, glib::Error>; #[cfg(any(feature = "v2020_2", feature = "dox"))] fn data>(&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 data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result, glib::Error>; #[cfg(any(feature = "v2020_2", feature = "dox"))] fn get_name(&self) -> Option; @@ -115,11 +115,12 @@ impl> SignExt for O { } #[cfg(any(feature = "v2020_2", feature = "dox"))] - fn commit_verify>(&self, repo: &Repo, commit_checksum: &str, out_success_message: &str, cancellable: Option<&P>) -> Result<(), glib::Error> { + fn commit_verify>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result, glib::Error> { unsafe { + let mut out_success_message = ptr::null_mut(); 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)) } + 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, &mut out_success_message, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); + if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) } } } @@ -133,11 +134,12 @@ impl> SignExt for O { } #[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 data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result, glib::Error> { unsafe { + let mut out_success_message = ptr::null_mut(); 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)) } + let _ = ostree_sys::ostree_sign_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, &mut out_success_message, &mut error); + if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) } } } diff --git a/rust-bindings/rust/src/auto/versions.txt b/rust-bindings/rust/src/auto/versions.txt index b396b526..52a580a6 100644 --- a/rust-bindings/rust/src/auto/versions.txt +++ b/rust-bindings/rust/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1) -from gir-files (https://github.com/gtk-rs/gir-files @ a7da7c9+) +from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+) diff --git a/rust-bindings/rust/sys/src/auto/versions.txt b/rust-bindings/rust/sys/src/auto/versions.txt index b396b526..52a580a6 100644 --- a/rust-bindings/rust/sys/src/auto/versions.txt +++ b/rust-bindings/rust/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1) -from gir-files (https://github.com/gtk-rs/gir-files @ a7da7c9+) +from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+)