Commit Graph

2656 Commits

Author SHA1 Message Date
Mathnerd314 1b88dc7f90 docs: Get API docs working again
This changes around a few things that didn't work for me:
* Section names seem to be ostree-* instead of libostree-*
* Also XML files are ostree-* (they didn't show up at all)
- gtk-doc doesn't seem to parse const _OSTREE_PUBLIC correctly
* pull documentation is now on the actual functions rather than stubs
* Update gitignore with some more files

And there some changes to make gtk-doc give fewer warnings (not finished)

Closes: #327
Approved by: cgwalters
2016-06-09 18:15:49 +00:00
Mathnerd314 693b4ec4be pull: Move pull and pull_onedir back into ostree-repo.c
They call pull_with_options, which will fail anyway.

Closes: #327
Approved by: cgwalters
2016-06-09 18:15:49 +00:00
Mathnerd314 da5cb099a6 pull: Move libsoup-related code from ostree-repo.c to ostree-repo-pull.c
This centralizes the ifdef's in one file, which will make it
easier to write new pull backends.

ostree-repo-pull.c is now built unconditionally

Closes: #327
Approved by: cgwalters
2016-06-09 18:15:49 +00:00
Mathnerd314 0e9a875393 repo: use OSTREE_TIMESTAMP (=1) for checked-out files
1 is a better choice than 0 because some programs use 0
as a special value; for example, GNU Tar warns of an
"implausibly old timestamp" with 0.

Closes: #330
Approved by: cgwalters
2016-06-09 18:04:55 +00:00
Colin Walters f94b191ae5 repo: (minor) Drop a GFile usage in signature creation
Just one user of hundreds but, the rest of the function was ported
now.

Closes: #319
Approved by: jlebon
2016-06-09 14:39:09 +00:00
Colin Walters 70e5489258 lib: Add a helper for mmap->bytes with openat(), use it in repo
This kills another GSystem consumer...I think down the line I'd like
to do something like "detect whether file is > 1k if so, mmap,
otherwise just readall()" so we can use this helper in more places.

Closes: #319
Approved by: jlebon
2016-06-09 14:39:09 +00:00
Colin Walters 3a03a35071 lib: Add `_ALLOW_NOENT` flag to internal variant mapping API
We have a lot of "allow_noent" type wrapper functions since
a common pattern is to allow files to not exist, but still
throw cleanly on other issues.

This is another instance of that, and cleans up duplicated error
handling code.

Part of this is prep for moving away from `GFile` consumers.

Closes: #319
Approved by: jlebon
2016-06-09 14:39:09 +00:00
Colin Walters 5a996c04de glnx porting: Drop use of gs_file_openat_noatime
As noted previously the "noatime" thing is mostly obsoleted by
relatime.

Closes: #319
Approved by: jlebon
2016-06-09 14:39:09 +00:00
Colin Walters 882561b01c libglnx porting: Drop last use of gs_transfer_out_value()
Closes: #319
Approved by: jlebon
2016-06-09 14:39:09 +00:00
Colin Walters a79c47415a glnx porting: Drop last uses of gs_file_get_basename_cached()
I apparently missed a few uses in the previous porting.

Closes: #319
Approved by: jlebon
2016-06-09 14:39:09 +00:00
Krzesimir Nowak b5da2f524c repo: Fix build on 32-bit systems
On 32-bit systems the modifier for printing 64bit values should be
%llu instead of %lu. Just use appriopriate macros that do the right
thing.

Closes: #329
Approved by: giuseppe
2016-06-09 11:25:29 +00:00
Jonathan Lebon b4c49f5acf configure.ac: properly check for bison
The AC_PROG_YACC already does the checking for us, so we don't need to
use AC_CHECK_PROGS (which wasn't working anyway because autoconf didn't
run the check thinking it was cached already from the earlier
AC_PROC_YACC, so we didn't get the default ":" value)

Closes: #325
Approved by: cgwalters
2016-06-07 19:47:58 +00:00
Jonathan Lebon 2240d1108e ostree_repo_write_commit: add missing docstring arg
Closes: #325
Approved by: cgwalters
2016-06-07 19:47:58 +00:00
Colin Walters 7fb49037ab tests/test-pull-c: New test that runs through the pull API via C
We have had in the past issues with running `ostree_repo_pull()`
multiple times in the same process, embarassingly enough.  Nothing in
the current test suite covers this, so let's start.

Closes: #322
Approved by: jlebon
2016-06-07 15:58:37 +00:00
Colin Walters 0858011851 tests: Use strict mode by default for C tests
I was extending the C-based test suite to cover more, and noticed that
we weren't aborting if a command failed.  That made the tests somewhat
less useful, so let's fix it.

Closes: #321
Approved by: jlebon
2016-06-06 20:24:21 +00:00
Krzesimir Nowak d78e12fc39 summary: Fix a typo
The --gpg-sign parameter will be used for signing the summary, not the
commit. This probably was copy-pasted from the ostree commit command.

Closes: #320
Approved by: cgwalters
2016-06-03 19:39:40 +00:00
Colin Walters eaea07fe43 glnx porting: Port away from gs_file_get_basename_cached()
In some cases we use glnx_basename(), in others we already had a
`GFileInfo` around with the name.

Closes: #316
Approved by: jlebon
2016-06-02 14:52:40 +00:00
Colin Walters 900c085f21 libglnx porting: Port away from gs_file_map_noatime()
The "no atime" thing was mostly useful only before "relative atime"
updates landed.  Users who care about performance will turn it off
entirely anyways.

Closes: #316
Approved by: jlebon
2016-06-02 14:52:40 +00:00
Colin Walters c148631a98 lib: Drop GFile variant mapping API for fd-relative
In addition to generic fd relative porting,
this is a necessary preparatory step for libglnx porting, because
when I tried to use `g_mapped_file_new` I hit an issue with
it using a different error domain from GIO.

Thankfully libglnx consistently uses the GIO error domain, and here
we're now using it for the `open()` call.

Closes: #317
Approved by: jlebon
2016-06-01 15:02:41 +00:00
Colin Walters f725d39f11 lib: Change ot_util_variant_map helpers to consistently sink refs
This is similar to changes Krzesimir has been doing recently - we
really don't need the ergonomics of floating refs since we have
autocleanups.

We should continue to change most of our code to sink refs.

Specifically here it was pretty broken that the `_map()` API was
sinking but the other two weren't, and this broke some refactoring I
was trying to do later.

Closes: #317
Approved by: jlebon
2016-06-01 15:02:41 +00:00
Sam Spilsbury a189b19fd0 repo: Display estimated time remaining when pulling
Bug 765429 said that not having a time estimate can be annoying
when working with large pulls.

There isn't any complex time estimation logic here - we just take
the number of bytes remaining and do a linear projection of
the bytes per second rate at the current point in time.

Closes: #318
Approved by: cgwalters
2016-06-01 14:09:41 +00:00
Colin Walters 24cb0ffc6a core: Port to new libglnx tempname API
Drops another libgsystem use, and as bonus we malloc less too.

Closes: #311
Approved by: jlebon
2016-05-31 18:08:46 +00:00
Colin Walters 7748c361ef sysroot: Correct error handling path in previous libglnx port
I happened to have the github page open with my commit after it was
merged, and then noticed a bug.

We still need to throw if we hit a non-`ENOENT` error.

Closes: #315
Approved by: giuseppe
2016-05-30 15:40:47 +00:00
Colin Walters 6e57987c7c libglnx porting: Port away from gs_file_ensure_directory()
The init-fs code in particular gets (IMO) a lot cleaner being fd
relative.

Closes: #312
Approved by: giuseppe
2016-05-30 11:33:28 +00:00
Colin Walters e5eb6f3a22 libglnx porting: Port callers of gs_file_unlink to just unlink()
In the second case it's actually less code too.

Closes: #312
Approved by: giuseppe
2016-05-30 11:33:28 +00:00
Colin Walters 9d39d3af85 repo: Port uncompressed cache GC to libglnx
- Kills a user of `gs_file_unlink`
 - Is fd-relative
 - Is way less malloc-y.

Closes: #312
Approved by: giuseppe
2016-05-30 11:33:28 +00:00
Colin Walters 33047d5d4f libglnx porting: Port "load utf8 file" contents API callers
Closes: #312
Approved by: giuseppe
2016-05-30 11:33:28 +00:00
Krzesimir Nowak 4929ab4033 repo: Add functions for verifying any data in repository
This can be useful for validating the 3rd party data that is put in
the extensions directory and is signed with the same keys as commits
or the summary file.

Closes: #310
Approved by: cgwalters
2016-05-27 11:20:00 +00:00
Krzesimir Nowak 27f0c6980a repo: Factor out setting up a GPG verifier
Moved out setting up a GPG verifier to a separate function, as I would
like to use it for the any data verification function in the following
commit.

Closes: #310
Approved by: cgwalters
2016-05-27 11:20:00 +00:00
Krzesimir Nowak 582169f83e repo: Add a missing Returns paragraph
Closes: #310
Approved by: cgwalters
2016-05-27 11:20:00 +00:00
Krzesimir Nowak 89bfb1d503 repo: Factor out the check of gpg result to a separate function
I plan to add a function for verifying any data which may return the
error about lack of trusted signatures, so let's avoid the redundancy
and put the check in the separate function.

Closes: #310
Approved by: cgwalters
2016-05-27 11:20:00 +00:00
Krzesimir Nowak 569e43c280 core: Add a function creating an archive-z2 content stream
It is quite similar to the already existing
ostree_raw_file_to_content_stream function, so I factored the common
part to a separate function. The difference is that we cannot report
the size of the resulting stream.

Can be useful for serving a "bare" repository as a faked "archive-z2"
repository.

Closes: #308
Approved by: cgwalters
2016-05-26 16:53:08 +00:00
Mathnerd314 6bf94ec233 commit: Update manpage to reflect --editor
Closes: #305
Approved by: cgwalters
2016-05-25 18:37:47 +00:00
Mathnerd314 c82f15201a log: Display "(no subject)" for commits without a subject
This resolves the ambiguity for a message with a body but no subject,
and also hints that OSTree is using two bytes to store the empty
commit subject/body (when instead they could be stored, or rather,
not stored, as part of the metadata)

Closes: #305
Approved by: cgwalters
2016-05-25 18:37:47 +00:00
Mathnerd314 80774680e8 commit: Don't require a subject
In practice, a lot of subjects are empty, because the commit date
and branch are sufficient identification. For example, rpm-ostree
does not use subjects. It also doesn't use the command-line ostree
commit tool, so this was not a problem there, but this makes the
behavior consistent.

Also adds a test that empty subjects and omitting the subject
are equivalent. The --timestamp is so that the commits do not
have different timestamps.

Closes: #305
Approved by: cgwalters
2016-05-25 18:37:47 +00:00
Mathnerd314 5e336333f3 commit: Display subject/body in commit editor
This allows automation to prefill the subject/body for the editor.

It could also be useful if some kind of "amend commit" functionality
was implemented.

Closes: #305
Approved by: cgwalters
2016-05-25 18:37:47 +00:00
Mathnerd314 b5bd28adae commit: Add --editor / -e command line argument
Previously, the behavior was to run the editor if no subject or body was specified.
This led to using commit -s '' in scripts, to avoid running the editor.
In practice, manually editing commit messages is rare, whereas automated scripting
is common, so instead default to not running the editor and only run it when -e
is given.

Closes: #305
Approved by: cgwalters
2016-05-25 18:37:47 +00:00
Mathnerd314 dfa1d190b6 commit: accept NULL subject argument
When given a NULL subject, use "" instead, like for the body argument

Closes: #305
Approved by: cgwalters
2016-05-25 18:37:47 +00:00
Alexander Larsson d368624798 Build on older versions of glib
Various places need to include libglnx.h for the autoptr backport
fallbacks to be there before ostree-autocleanups.h is included.

This fixes the build on centos7·

Closes: #309
Approved by: giuseppe
2016-05-25 14:01:39 +00:00
Krzesimir Nowak 2f2af9252d libotutil: Plug a leak
There's no need to allocate the variant builder on a heap, so allocate
it on the stack and avoid a memory leak at the same time.

Closes: #307
Approved by: cgwalters
2016-05-24 11:36:15 +00:00
Giuseppe Scrivano e3e82c54c1 man: add missing options for commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #306
Approved by: cgwalters
2016-05-23 11:46:10 +00:00
Alexander Larsson 86ac8062f5 tests: Fix build with old glib
test-checksum.c was using g_autofree without including libglnx.h which
has the backport for that.

Closes: #304
Approved by: cgwalters
2016-05-20 11:48:02 +00:00
Krzesimir Nowak 506902f8a0 build: Install new autocleanups header
Haven't noticed before that there is a separate variable for a list of
OSTree public headers. This fixes an embarrassing error that prohibits
building a project that includes ostree.h.

Closes: #302
Approved by: cgwalters
2016-05-19 13:04:06 +00:00
Krzesimir Nowak d5f6104335 build: Allow ostree to use g_autoptr on its types internally
As an example, I g_autoptred one OstreeRepo in the "ostree init"
command.

Closes: #295
Approved by: cgwalters
2016-05-17 21:13:20 +00:00
Krzesimir Nowak 24e3ccb780 build: Remind about bumping related versions
Closes: #295
Approved by: cgwalters
2016-05-17 21:13:20 +00:00
Krzesimir Nowak 51e4e3b364 libostree: Add g_autoptr() support for the public types
To avoid breaking the ostree users we hide the autoptr setup behind an
OSTREE_WITH_AUTOCLEANUPS variable. The variable is set to 0 by
default, so users that want to start using them, have to define the
variable themselves to 1.

Probably after some transition period, the variable will be set 1 by
default.

This is conditional on GLib >= 2.44.0 being available. It does not
bump ostree's dependency on GLib.

Closes: #295
Approved by: cgwalters
2016-05-17 21:13:19 +00:00
Gatis Paeglis 441c03ba9e Fix build when have_libsoup_client_certs=no
This fixes a build failure with older libsoup versions
that do not have the client certificates feature.

Closes: #294
Approved by: cgwalters
2016-05-13 14:33:08 +00:00
Colin Walters 574805b0f3 README: x/xdg-app/flatpak/
I'm mostly just testing some Homu updates.

Closes: #299
Approved by: cgwalters
2016-05-13 14:01:37 +00:00
Krzesimir Nowak cb45456708 libostree: Fix bracket-missing warnings
Apparently I got the bracketing wrong in
862e6ecdcc58f025696b1394adfc0fcf7322df23:

src/libostree/ostree-repo.c: In function 'ostree_repo_delete_object':
src/libostree/ostree-repo.c:3538:11: warning: missing braces around
initializer [-Wmissing-braces]
           g_auto(GVariantBuilder) builder = {0,};

Closes: #298
Approved by: cgwalters
2016-05-13 12:22:59 +00:00
Micah Abbott d451b87fbe docs: fix swapped link syntax
A few links in the docs had the Markdown syntax swapped like:

(link title)[link url]

Just cleaned up those.  Verified via `mkdocs serve`

Closes: #297
Approved by: cgwalters
2016-05-12 21:01:54 +00:00