Commit Graph

2512 Commits

Author SHA1 Message Date
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
Colin Walters 817060e772 build: Don't run glib-mkenums if there's nothing to do
This fixes the build without libsoup.

Closes: #296
Approved by: gatispaeglis
2016-05-12 17:15:50 +00:00
Colin Walters a5f703799f Make enum generation private by default, export stub symbol
When we added enum type generation, the generated symbols used
the `ostree_` prefix, and at the time that implied they were public.

So we started (if built with libsoup) exporting
`ostree_fetcher_config_flags_get_type`.

I think it's not worth confusing ABI checkers, so let's export the
dummy symbol forever, and switch enums to be private by default.

We should revisit this and also export some auto-generated enum
types for public enums, but that's a separate patch.

Closes: #296
Approved by: gatispaeglis
2016-05-12 17:15:50 +00:00
Sam Spilsbury f98b8bd0d7 Makefile: Move to AM_DISTCHECK_CONFIGURE_FLAGS
Since automake 1.11.2 it is recommended that packages
use AM_DISTCHECK_CONFIGURE_FLAGS instead of
DISTCHECK_CONFIGURE_FLAGS as the latter is intended
to be a user variable.

https://bugzilla.gnome.org/show_bug.cgi?id=766298

Closes: #293
Approved by: cgwalters
2016-05-12 12:25:08 +00:00
Krzesimir Nowak 862e6ecdcc libostree: Variant-related leak plugs and fixes
This tries to avoid leaking GVariantBuilders and GVariants in some
situations. The leaks were usually happening when some error occurred
or because of unclear variant ownership situation.

The former is mostly about making sure that g_variant_builder_clear is
called on builders that didn't finish their variant building process.

The latter is surely more work - sometimes the result of
g_variant_builder_end() should not be passed directly to a function,
but rather stored in a g_autoptr(GVariant), sunk and then passed to a
function. IMO, with an advent of g_autoptr, GVariants should be always
sunk instead of relying on some receiver function sinking it. This
would make an easy-to-follow policy of always sinking your
variants. Functions could then assume that the passed variant is
already sunk. These leaks are still happenning in commands, but they
are less harmful, since that code will not be used by some daemon as a
library routine.

Closes: #291
Approved by: cgwalters
2016-05-12 11:17:09 +00:00
Krzesimir Nowak aa946cc136 repo: Allow using options for fetching summary
This adds a _with_options variant of the
ostree_repo_remote_fetch_summary function, so we can tell the fetcher
to use a specific URL instead taking it from the remote config.

Closes: #290
Approved by: cgwalters
2016-05-10 13:47:36 +00:00
Krzesimir Nowak bdd73913fb repo: Plug a leak
The base URI created in this line was always (sans erroneous
situations) overwritten in the code block below without freeing it
previously, so it leaked.

Closes: #290
Approved by: cgwalters
2016-05-10 13:47:36 +00:00
Krzesimir Nowak 3ae87e3f9e core: Improve variant format docs
Use markdown to actually format the tuple member descriptions as a
list. Currently they are hardly legible as gtk-doc formats them into a
single sentence.

Also update the additional metadata docs in the summary objects.

Closes: #289
Approved by: cgwalters
2016-05-10 13:30:50 +00:00
Jonathan Lebon 65e7969b0b OstreeRepo: add extensions directory
It's very useful for third-party applications to have someplace to store
their data guaranteed to be on the same device as the repo (thus
ensuring hardlinks) while still being shielded away from any of OSTree's
timely garbage collections.

We create a new "extensions/" subdirectory where apps can include
whatever they wish in "extensions/myapp/". This subdirectory is
completely unmanaged by ostree.

NB: I didn't bother making it a member of the OstreeRepo proper since we
don't really use it for anything else yet.

Closes: #286
Approved by: cgwalters
2016-05-09 14:43:16 +00:00
Krzesimir Nowak 58532e5917 sysroot: Plug some leaks
The deployments and booted deployment were never unreffed.

Also, remote (void) from the call to the unload function - it returns
nothing, so there is no need to fool the compiler.

Closes: #287
Approved by: cgwalters
2016-05-09 13:41:49 +00:00
Colin Walters d270085ef3 trivial-httpd: Add __attribute__((format))
I was briefly looking at building with clang mostly since it
detects unused variables with cleanup attributes, but then
I hit this fatal error.

It's a hard compile error with `-Wformat-nonliteral` since clang
doesn't know it's a format string.
2016-05-07 11:22:47 -04:00
Colin Walters 49322a3f53 build: Use --std=gnu99
It's actually very nice to be able to declare loop variables inside
the initializer.

Ideally we could turn off nested functions though.

Closes: #284
Approved by: jlebon
2016-05-06 16:49:35 +00:00
Jonathan Lebon dfbb61270a tests/test-libarchive-import.c: add tests
- Do a bit of refactoring
- Add test for use_ostree_convention
- Add test for xattr_callback
- Add test for SELinux labeling

Closes: #275
Approved by: cgwalters
2016-05-06 14:44:55 +00:00
Jonathan Lebon 5ef4898afa tests/test-libarchive.sh: add more test
- Test both tar and cpio archives
- Test more hardlink corner cases
- Test symlinks more rigorously
- Test stat override
- Test skip list

Closes: #275
Approved by: cgwalters
2016-05-06 14:44:55 +00:00
Jonathan Lebon b717fd2c18 ot-builtin-commit.c: add --skip-list option
This was already supported by the commit modifier API, just needed to
expose it. This will also be used to test the libarchive API in a future
test.

Closes: #275
Approved by: cgwalters
2016-05-06 14:44:55 +00:00
Jonathan Lebon b1d3dd151c ostree-repo-libarchive.c: major refactor
- Make hardlink handling more generic. The previous strategy worked for
  tar archives, but not for cpio. It now works for both.
- Add support for SEL labeling (through the OstreeRepoCommitModifier)
- Add support for xattr_callback (through the OstreeRepoCommitModifier)
- Add support for filter (through the OstreeRepoCommitModifier)
- Add a use_ostree_convention option

Closes: #275
Approved by: cgwalters
2016-05-06 14:44:55 +00:00
Colin Walters 6724519080 libglnx porting: Migrate to glnx_stream_fstat()
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.

Closes: #282
Approved by: jlebon
2016-05-06 14:29:59 +00:00
Colin Walters 5a90781cd8 lib: Add more filename validations (no ., .. or /) in commit logic
The filesystem commit code will never give us potentially hostile
filenames, and when importing from archives, we do some validation.

However, we should be extra paranoid and also add error messages in
the mtree in case someone tries to import a hostile
libarchive-supported format.

Closes: #283
Approved by: jlebon
2016-05-06 01:15:19 +00:00
Colin Walters 7021c4f876 repo: Make repo/tmp expiry configurable via tmp-expiry-seconds
We were arbitrarily only deleting content after exactly one day.  Some
use cases may want something else; make it configurable.

Closes: #170
Approved by: jlebon
2016-05-02 18:44:44 +00:00
Colin Walters a56ba6081a repo: Clean up staging directory for previous boot IDs
We had a policy of cleaning up all files in `$repo/tmp` older
than one day, but we should really clean up previous bootid staging
directories too, as they can potentially take up a lot of disk space.

https://bugzilla.gnome.org/show_bug.cgi?id=760531

Closes: #170
Approved by: jlebon
2016-05-02 18:44:44 +00:00
Colin Walters e3ec83a934 repo: Add OSTREE_BOOTID override envvar for debugging
It's useful for test cases to be able to influence this.

Conflicts:
	src/libostree/ostree-repo.c

Closes: #170
Approved by: jlebon
2016-05-02 18:44:44 +00:00
Colin Walters 15b3cab65e repo: Add OSTREE_REPO_TEST_ERROR=pre-commit env var
Setting this causes commit to error out.  There are other ways we
could do this in a more sophisticated fashion, such as via SystemTap
etc.  But this has low-tech applicablity, works as non-root.

The reason I'm adding this is so that we can add test cases for
cleanup of the `tmp/staging-` directory.

Closes: #170
Approved by: jlebon
2016-05-02 18:44:44 +00:00
Colin Walters 3111248373 repo: Fix reading repos on read-only media
I have a cache drive I often mount read-only, and the previous commit
for opening `tmp/cache` broke since `errno == EROFS`, not `EPERM`.

It turns out we already had the concept of a "writable" repo, so just
piggy back off that.

Closes: #281
Approved by: giuseppe
2016-05-02 14:27:33 +00:00
Colin Walters a6c731f6e7 libglnx porting: Migrate from GSConsole
To GLnxConsoleRef.  There were some subtleties here, for example we
used to reference `GSConsole` inside the progress changed function,
which at first seems like an ABI hazard, because e.g. rpm-ostree or
xdg-app could still be passing a `GSConsole` instance there.  Luckily,
it turns out to be compatible to just start calling libglnx here.

Another issue was that due to libglnx's use of the cleanup function,
we needed to ensure we always called `ostree_async_progress_finish()`
*before* the cleanup function was invoked.

Closes: #280
Approved by: giuseppe
2016-05-02 11:41:00 +00:00
Colin Walters 831e9dcdea build: Introduce --with-dracut=yesbutnoconf
It's actually just easier for build systems (e.g. rpm-ostree)
using dracut to use `--add ostree` rather than indirecting
through the conf file.

This makes it easier for yum-managed systems to install ostree without
side effects.

Closes: #279
Approved by: gatispaeglis
2016-05-01 10:25:19 +00:00
Colin Walters 72abe62370 deploy: Start hardlinking kernel/initramfs on single-part again
Commit
1810de2b51
lost an optimization where we would try hardlinks for the
kernel/initramfs in `/boot`.  This would be a noticeable space savings
on single-partition systems.

Closes: #277
Approved by: gatispaeglis
2016-04-26 11:48:42 +00:00
Simon McVittie 542df553e2 test-parent: this test requires user xattrs
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #278
Approved by: cgwalters
2016-04-25 20:46:11 +00:00
Gatis Paeglis ad0de186bb Fix --enable_rofiles_fuse=no build
Closes: #276
Approved by: cgwalters
2016-04-25 12:40:58 +00:00
Alexander Larsson f2fd1f50e2 repo: Handle parent repos with different remote configuration
In the case we have a repo with a parent, and the child repo has a
remote called "foo", but some option is unset. Then when we look up
the parent repo for a value before using the default we will fail due
to the parent not having the "foo" remote. As soon as we find the
requested remote at some point in the hierarchy we need to ignore further
errors and use the default value.

Closes: #274
Approved by: giuseppe
2016-04-22 14:38:00 +00:00
Krzesimir Nowak c2931583d3 tests: Add a test for ostree pull --url
Closes: #271
Approved by: cgwalters
2016-04-22 14:27:06 +00:00
Krzesimir Nowak a6ce162231 trivial-httpd: Add a --log-file option
Might be useful to see what files the client wants to fetch.

Closes: #271
Approved by: cgwalters
2016-04-22 14:27:06 +00:00
Krzesimir Nowak 560cc49234 pull: Add a --url option
This allows ostree to pull the objects from a different URL without
modifying the repo's config.

Closes: #271
Approved by: cgwalters
2016-04-22 14:27:06 +00:00
Krzesimir Nowak 08d2b8ab7b lib: Add URL override pull option
The "override-url" option allows to use the other URL while still
using some options from the passed remote.

Closes: #271
Approved by: cgwalters
2016-04-22 14:27:06 +00:00
Alexander Larsson ad019def9a repo: Fix temporary directory allocation
We looked for and locked old temporary directories so we can
reuse them if not in use. However, once we found one that
we can reuse we didn't stop iterating, and eventually we
reached the end. This means we can lock multiple dirs.

Closes: #273
Approved by: giuseppe
2016-04-22 08:46:53 +00:00
Colin Walters 8609cb036b repo: Simplify internal has_object() lookup code
There was some leftover intermediate cruft here I noticed
while reviewing another patch:

 - We had an output `GFile*` for that was never used
 - We required the caller to allocate the loose pathbuf, but
   none of them ever reused it
 - We had an extra intermediate function

Also while looking at this, I'm now uncertain whether some of the
callers of `_ostree_repo_has_loose_object` should really be invoking
`ostree_repo_has_object()`, but let's leave that aside for now.

Closes: #272
Approved by: alexlarsson
2016-04-21 19:50:53 +00:00
Alexander Larsson 8f8ab56211 repo: Allow loading files staged in the transaction
Currently we can load metadata from the stage dir, but not file
data, which makes no sense.

Closes: #269
Approved by: cgwalters
2016-04-21 19:05:06 +00:00
Gatis Paeglis bd3ad8cc5c Remove unused variables from install_deployment_kernel
Closes: #270
Approved by: cgwalters
2016-04-20 15:09:37 +00:00
Alexander Larsson 5595664e47 ostree export: Add --prefix option
This lets you set a prefix for the resulting archive patsh.
Especially useful in combination with --subpath, for instance
--subpath=subdir --prefix=subdir to extract just subdir.

Closes: #265
Approved by: cgwalters
2016-04-19 12:28:06 +00:00
Alexander Larsson 5079f70ec0 ostree export: Add --subpath support
This lets you export a subset of a commit.

Closes: #265
Approved by: cgwalters
2016-04-19 12:28:06 +00:00
Krzesimir Nowak 9db2f43b14 tests, lib: Remove unused variables
Closes: #267
Approved by: cgwalters
2016-04-19 12:16:16 +00:00
Krzesimir Nowak 6ff7c876dc lib: Fix an introspection annotation
The "allow-none" annotation does not make sense for a plain boolean
parameter.

Closes: #267
Approved by: cgwalters
2016-04-19 12:16:16 +00:00
Krzesimir Nowak 90400d3a62 trivial-httpd: Remove useless code
Closes: #267
Approved by: cgwalters
2016-04-19 12:16:16 +00:00
Krzesimir Nowak 925faca108 lib: Fix a typo
Closes: #267
Approved by: cgwalters
2016-04-19 12:16:16 +00:00
Colin Walters d5498a8b16 libtest: Skip FUSE if CAP_SYS_ADMIN not in bounding set
I'm not sure if something changed or there was a race condition , or
if extraterrestrials intervened to make the tests pass before, but
in the Docker container `/dev/fuse` does exist and since we appear
to be running as uid 0 it'll be writable.

We previously discussed that another requirement for FUSE (and most
setuid binaries) is having `CAP_SYS_ADMIN`, so let's check for that in
the bounding set too.

Closes: #266
Approved by: jlebon
2016-04-18 19:53:13 +00:00
Simon McVittie 24cab773a2 libtest: show files' contents when assertions about them fail
I've seen an intermittent test failure in an autobuilder (sbuild)
environment where logs from failed builds cannot be retrieved,
but I can no longer reproduce it. Put the contents of the offending
file in the test's failing output so that if the failure comes back,
it can be debugged.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #264
Approved by: cgwalters
2016-04-17 14:16:34 +00:00