From 4e7abb3101a4d5925fde6a20a4b6ff74b52ba298 Mon Sep 17 00:00:00 2001 From: Felix Krull Date: Wed, 26 Aug 2020 01:03:41 +0200 Subject: [PATCH] conf: remove some unfixable TODOs --- rust-bindings/rust/conf/ostree.toml | 11 +++++++++-- rust-bindings/rust/src/auto/functions.rs | 12 ------------ rust-bindings/rust/src/auto/se_policy.rs | 4 ---- rust-bindings/rust/src/auto/versions.txt | 2 +- rust-bindings/rust/src/checksum.rs | 2 -- rust-bindings/rust/sys/src/auto/versions.txt | 2 +- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index ae0a5710..0458b8cf 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -48,7 +48,6 @@ generate = [ "OSTree.RepoPullFlags", "OSTree.RepoRemoteChange", "OSTree.RepoResolveRevExtFlags", - "OSTree.SePolicy", "OSTree.SePolicyRestoreconFlags", "OSTree.StaticDeltaGenerateOpt", "OSTree.Sysroot", @@ -185,6 +184,14 @@ status = "generate" init_function_expression = "|_ptr| ()" clear_function_expression = "|_ptr| ()" +[[object]] +name = "OSTree.SePolicy" +status = "generate" + [[object.function]] + # has an unused raw pointer parameter so we wrap it by hand + name = "fscreatecon_cleanup" + ignore = true + [[object]] name = "OSTree.Sign" status = "generate" @@ -197,7 +204,7 @@ name = "OSTree.*" status = "generate" [[object.function]] # low-level functions with unsafe APIs - pattern = "cmp_checksum_bytes|checksum_inplace_to_bytes|hash_object_name" + pattern = "cmp_checksum_bytes|checksum_inplace_from_bytes|checksum_inplace_to_bytes|checksum_b64_inplace_from_bytes|checksum_b64_inplace_to_bytes|hash_object_name" ignore = true [[object.function]] diff --git a/rust-bindings/rust/src/auto/functions.rs b/rust-bindings/rust/src/auto/functions.rs index 8749b57b..e0603115 100644 --- a/rust-bindings/rust/src/auto/functions.rs +++ b/rust-bindings/rust/src/auto/functions.rs @@ -38,14 +38,6 @@ pub fn check_version(required_year: u32, required_release: u32) -> bool { // unsafe { TODO: call ostree_sys:ostree_checksum_b64_from_bytes() } //} -//pub fn checksum_b64_inplace_from_bytes(csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, buf: &str) { -// unsafe { TODO: call ostree_sys:ostree_checksum_b64_inplace_from_bytes() } -//} - -//pub fn checksum_b64_inplace_to_bytes(checksum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 28 }; 32, buf: u8) { -// unsafe { TODO: call ostree_sys:ostree_checksum_b64_inplace_to_bytes() } -//} - //#[cfg(any(feature = "v2016_8", feature = "dox"))] //pub fn checksum_b64_to_bytes(checksum: &str) -> /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 { // unsafe { TODO: call ostree_sys:ostree_checksum_b64_to_bytes() } @@ -86,10 +78,6 @@ pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option { } } -//pub fn checksum_inplace_from_bytes(csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, buf: &str) { -// unsafe { TODO: call ostree_sys:ostree_checksum_inplace_from_bytes() } -//} - //pub fn checksum_to_bytes(checksum: &str) -> /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 { // unsafe { TODO: call ostree_sys:ostree_checksum_to_bytes() } //} diff --git a/rust-bindings/rust/src/auto/se_policy.rs b/rust-bindings/rust/src/auto/se_policy.rs index 57f3014d..b81cea8a 100644 --- a/rust-bindings/rust/src/auto/se_policy.rs +++ b/rust-bindings/rust/src/auto/se_policy.rs @@ -94,10 +94,6 @@ impl SePolicy { value.get().expect("Return Value for property `rootfs-dfd` getter").unwrap() } } - - //pub fn fscreatecon_cleanup(unused: /*Unimplemented*/Option) { - // unsafe { TODO: call ostree_sys:ostree_sepolicy_fscreatecon_cleanup() } - //} } impl fmt::Display for SePolicy { diff --git a/rust-bindings/rust/src/auto/versions.txt b/rust-bindings/rust/src/auto/versions.txt index 557e5d3e..7b36b436 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 @ ff904f0) +from gir-files (https://github.com/gtk-rs/gir-files @ 203ae47) diff --git a/rust-bindings/rust/src/checksum.rs b/rust-bindings/rust/src/checksum.rs index 1058f718..82c87df4 100644 --- a/rust-bindings/rust/src/checksum.rs +++ b/rust-bindings/rust/src/checksum.rs @@ -45,7 +45,6 @@ impl Checksum { /// Unfortunately, the underlying libostree function has no way to report parsing errors. If the /// string is not a valid SHA256 string, the program will abort! pub fn from_hex(checksum: &str) -> Checksum { - // TODO: implement by hand to avoid stupid assertions? assert_eq!(checksum.len(), HEX_LEN); unsafe { // We know checksum is at least as long as needed, trailing NUL is unnecessary. @@ -60,7 +59,6 @@ impl Checksum { /// Invalid base64 characters will not be reported, but will cause unknown output instead, most /// likely 0. pub fn from_base64(b64_checksum: &str) -> Checksum { - // TODO: implement by hand for better error reporting? assert_eq!(b64_checksum.len(), B64_LEN); unsafe { let buf = g_malloc0(BYTES_LEN) as *mut [u8; BYTES_LEN]; diff --git a/rust-bindings/rust/sys/src/auto/versions.txt b/rust-bindings/rust/sys/src/auto/versions.txt index 557e5d3e..7b36b436 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 @ ff904f0) +from gir-files (https://github.com/gtk-rs/gir-files @ 203ae47)