Commit Graph

10 Commits

Author SHA1 Message Date
Colin Walters d1731d0ea8 repo: Add an API to read and parse directory metadata
The fact that the uid/gid/mode are big endian bit me when I was
trying to parse this "by hand" in ostree-rs-ext.

Let's add a footgun-free API for this.

(And yeah, we should probably do the same for the other variant types)
2022-05-06 12:53:57 -04:00
Colin Walters 440d872f68 repo: Add `require_rev` method
The `resolve_rev` C method should really have been
`resolve_rev_optional` from the start - it is more obviously wrong
in Rust because the input parameter `allows_noent` controls
whether the returned `Option` can ever be `None`.

I debated adding this to the C bindings, and may still do so,
but eh it's faster to write + ship in Rust, and the future of ostree is
Rust anyways.
2022-05-06 12:53:57 -04:00
Colin Walters 955f0ddb9d repo: Expose dfd_as_file()
The `dfd()` API returns just an integer.  Add a safe API that
makes a copy of the fd.  What we really want here is `BorrowedFd` from
https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
but that isn't here yet.
2022-05-06 12:53:57 -04:00
Colin Walters deedffde06 Re-export glib, gio
Re-export our dependencies.  See https://gtk-rs.org/blog/2021/06/22/new-release.html
"Dependencies are re-exported".  Users will need e.g. `gio::File`, so this avoids
them needing to update matching versions.

Closes: https://github.com/ostreedev/ostree-rs/issues/12
2022-05-06 12:53:56 -04:00
Colin Walters 8a5ac02822 Update to glib 0.14
An intimidating spam of compiler errors at the start, but the
biggest was handling the new convention of `ostree_sys::` => `ffi::`.

This will require a semver bump of course.
2022-05-06 12:53:56 -04:00
Felix Krull 3290d5c2d1 Rewrite handwritten futures functions 2022-05-06 12:53:55 -04:00
Felix Krull bf27ba5dc0 Fix lint in tests 2022-05-06 12:53:55 -04:00
Felix Krull bb4e0c5978 Implement Repo::write_metadata 2022-05-06 12:53:54 -04:00
Felix Krull 78a14d15a3 Implement Repo::write_content 2022-05-06 12:53:54 -04:00
Felix Krull 6776c819f1 tests: reorganise repo tests so they have fewer feature flags 2022-05-06 12:53:54 -04:00