Commit Graph

2473 Commits

Author SHA1 Message Date
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
Colin Walters
e9a1809c4d Rename test-abi to test-symbols, start verifying symbols are documented
We keep forgetting to update `apidoc/ostree-sections.txt`, so let's
start enforcing it.  Of course it turns out we had some bugs here
like symbols marked as public but never implemented, etc.  Those
are fixed in the prior commits.

Closes: #263
Approved by: giuseppe
2016-04-17 13:52:07 +00:00
Colin Walters
6923c088c5 lib: Remove ostree_repo_file_make_empty_tree
This was removed in 14d682305b - long
before we had a stable library.

I again claim removing unimplemented symbols from the header is not an
API/ABI break.

Closes: #263
Approved by: giuseppe
2016-04-17 13:52:07 +00:00
Colin Walters
1ac46828f2 core: Remove ostree_checksum_update_meta that was not implemented
If a symbol falls in a git merkle tree forest, but no one hears it,
did it ever exist?

I'm claiming this isn't an API/ABI break because nothing could
have actually used this.  `git log -S checksum_update_meta` leads
me to 38ef75e6e0 which was before
we really had a stable shared library.

Closes: #263
Approved by: giuseppe
2016-04-17 13:52:07 +00:00
Colin Walters
bfa23bdc1f Release 2016.5
Closes: #261
Approved by: cgwalters
2016-04-15 15:09:31 +00:00
Alexander Larsson
b4b26907c8 static-delta: Initialize read_source_fd to -1
If not, we'll get ESPIPE when seeking on fd 0.

Closes: #260
Approved by: cgwalters
2016-04-15 11:56:06 +00:00
Alexander Larsson
a08b7765b7 static-delta: Put temp files in /var/tmp
We may not have write permissions in the current directory.

Closes: #259
Approved by: cgwalters
2016-04-14 20:49:32 +00:00
Colin Walters
f3796a4458 refs: Add g_prefix_error around opendir for easier debugging
Addresses:
  https://github.com/projectatomic/rpm-ostree/issues/264

We should consider moving this down into `glnx_opendirat`, but for now
a quick fix.

Closes: #255
Approved by: jlebon
2016-04-14 18:25:10 +00:00
Alexander Larsson
7ac8b0442c Look for $remotename.trustedkeys.gpg in remotes.d dir
This is a nice way to add gpg keys for system configured remotes
without making them globally trusted.

Closes: #247
Approved by: cgwalters
2016-04-14 16:21:01 +00:00
Alexander Larsson
c86e4f0c90 Add remotes-config-dir to OstreeRepo
This allows you to replace the default
$sysroot/$sysconfdir/ostree/repos.d string value, and to use a similar
feature for repos that are not the system repo.

In particular, this allows us to support /etc/xdg-app/remotes.d for
xdg-app.

Closes: #247
Approved by: cgwalters
2016-04-14 16:21:01 +00:00
Colin Walters
d9a334950b man: Elaborate on per-remote GPG
Closes: #258
Approved by: alexlarsson
2016-04-14 16:05:52 +00:00
Alexander Larsson
9e7e594907 Add OstreeRepo option for an out-of-band cache dir
This allows you to have a writable cache dir even for a system-owned
repository.

Closes: #250
Approved by: cgwalters
2016-04-14 15:55:08 +00:00
Alexander Larsson
b787fce612 Add cache_dir_fd to OstreeRepo
This will allow us later to easily swap out the cache dir.

Closes: #250
Approved by: cgwalters
2016-04-14 15:55:08 +00:00
Alexander Larsson
77ea287cd2 commit: Fix crash if dfd_iter is NULL
in write_directory_content_to_mtree_internal dfd_iter can be NULL,
for instance if commiting from --tree=ref=FOO. Don't blindly de-ref
it to avoid crashing.

Closes: #256
Approved by: cgwalters
2016-04-13 19:37:06 +00:00
Alexander Larsson
6a57d0a2f0 fetcher: Initialize output_stream_set_lock mutex
ostree pull-local crashed for me in thread_closure_unref () doing:
    g_mutex_clear (&thread_closure->output_stream_set_lock);

Seems like we never initialize this mutex.

Closes: #254
Approved by: cgwalters
2016-04-13 14:11:46 +00:00
Gatis Paeglis
80c68ba7f0 Fix AS_HELP_STRING for builtin grub2 mkconfig
Closes: #253
Approved by: giuseppe
2016-04-12 11:22:50 +00:00
Colin Walters
581a643e17 build: Move grub2-15_ostree back to pkglibexecdir
It's not quite namespaced enough to have
`/usr/libexec/grub2-15_ostree`, and the Fedora spec file expects
things in `/usr/libexec/ostree`.  Changing the spec file would be
annoying as we'd need conditionals.

Closes: #249
Approved by: gatispaeglis
2016-04-11 14:30:22 +00:00
Colin Walters
594162f16a pull: More consistently use remote_repo_local for local repos
I think it's cleaner if we use `remote_repo_local` to know
that we have a local repo.  In reality, it might be nicest
if we didn't even create an `OstreeFetcher` for this case,
but untangling the code is tricky.

Closes: #239
Approved by: alexlarsson
2016-04-11 13:51:50 +00:00
Jonathan Lebon
b69fd11487 ostree-repo-pull: always initialize flags_i
Otherwise we get undefined behaviour if the client didn't explicitly set
any flags.

Also, add documentation for all the other options supported by
ostree_repo_pull_with_options().

Closes: #252
Approved by: cgwalters
2016-04-11 13:31:20 +00:00
Alexander Larsson
e62beae695 Fix the symbol versions for ostree_repo_get_remote_*option
These were accidentally added to 2016.4 instead of 2016.5

Closes: #251
Approved by: cgwalters
2016-04-11 13:07:07 +00:00
Jonathan Lebon
41661e47e1 small cleanups
- Revert 'cannot' --> 'can not' (it's the exception!)
- Remove duplicate function
- Squelch compiler warnings

Closes: #248
Approved by: cgwalters
2016-04-08 18:43:18 +00:00
Alexander Larsson
ddda8e5b8b Add support for ostree static-delta delete
Closes: #245
Approved by: giuseppe
2016-04-08 13:42:43 +00:00
Giuseppe Scrivano
8ff9a48ce3 cfg.mk: ignore syntax-check for git.mk
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #246
Approved by: cgwalters
2016-04-08 13:32:41 +00:00
Alexander Larsson
6aa447a917 Add test case for inheriting remote options
Closes: #236
Approved by: cgwalters
2016-04-07 20:02:46 +00:00
Alexander Larsson
d7181f22a6 Inherit remotes and remote options from parent repo
Closes: #236
Approved by: cgwalters
2016-04-07 20:02:46 +00:00
Alexander Larsson
37382590dc Export ostree_repo_get_remote_option* functions
These are useful for ostree users (like xdg-app) that have custom
options for remotes. In particular they are useful when we later make them
all respect self->parent_repo.

Closes: #236
Approved by: cgwalters
2016-04-07 20:02:46 +00:00
Alexander Larsson
91734a8a18 Support pathnames for --subpath=...
This allows you to pull a single file, rather than just a directory.

Closes: #244
Approved by: cgwalters
2016-04-07 15:15:39 +00:00
Colin Walters
984bf91826 Use git.mk
It's a lot nicer than manually maintaining .gitignore in general.

Closes: #235
Approved by: giuseppe
2016-04-07 12:49:40 +00:00
Giuseppe Scrivano
e81aabba8c docs: Prefer the form "cannot" to "can not"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
3152516ab3 Remove empty new lines at the EOF
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
6a091c96ba contrib: indent golang code using only tabs instead of both tabs and spaces
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
7763c452dd tests: add missing ${CMD_PREFIX} before ostree
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Giuseppe Scrivano
039d3f1dbd tests: add libostreetest.h to EXTRA_DIST
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #242
Approved by: cgwalters
2016-04-07 12:25:24 +00:00
Colin Walters
4b1ac83aa6 build: Make tests/libreaddir-rand.so rule use AM_V_GEN
So non-verbose builds don't have a verbose rule smack in the middle.

Closes: #241
Approved by: giuseppe
2016-04-07 07:34:12 +00:00
Colin Walters
e9640ca4d9 build: Find grub2-mkconfig a bit more automagically
If one happens to not have grub2 installed, the previous commit
would cause us to fall back to `grub-mkconfig` with bad results.

We should likely just do dynamic detection and avoid pain, but
there's no harm in also allowing this to be statically determined.

The automagic here is that if `/etc/os-release` says `ID_LIKE=fedora`,
we know to use `grub2-mkconfig`.  But distro scripts should set this
in the build configurations using `--with-grub2-mkconfig=`.

Closes: #240
Approved by: jlebon
2016-04-06 21:16:11 +00:00
Alexander Larsson
ace0d4650b pull-local: Support --gpg-verify and --gpg-verify-summary
Force the otherwise disabled gpg verifications on.
Note: You need to pass --remote=foo so we know what gpg keys to verify
against.

Closes: #237
Approved by: cgwalters
2016-04-05 19:12:09 +00:00
Alexander Larsson
87298c84b8 Fix local-pull test
This was not being run for whatever reason. Also, the test
count was wrong.

Closes: #237
Approved by: cgwalters
2016-04-05 19:12:09 +00:00
Alexander Larsson
eabb4e3545 pull: Don't try to cache summaries for pull-local
Not only does this not make sense from a performance perspective, but
it also doesn't work because we can't use a url as a path element.

Closes: #237
Approved by: cgwalters
2016-04-05 19:12:09 +00:00
Gatis Paeglis
4e81548447 Introducing ostree-grub-generator
ostree-grub-generator can be used to customize
the generated grub.cfg file. Compile time
decision ostree-grub-generator vs grub2-mkconfig
can be overwritten with the OSTREE_GRUB2_EXEC
envvar - useful for auto tests and OS installers.

Why this alternative approach:

1) The current approach is less flexible than using a
   custom 'ostree-grub-generator' script. Each system can
   adjust this script for its needs, instead of using the
   hardcoded values from ostree-bootloader-grub2.c.

2) Too much overhead on embedded to generate grub.cfg
   via /etc/grub.d/ configuration files. It is still
   possible to do so, even with this patch applied.
   No need to install grub2 package on a target device.

3) The grub2-mkconfig code path has other issues:
   https://bugzilla.gnome.org/show_bug.cgi?id=761180

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

Closes: #228
Approved by: cgwalters
2016-04-04 14:19:35 +00:00
Krzesimir Nowak
826c2149b8 manual: Fix a bunch of typos and docbookisms
Closes: #238
Approved by: cgwalters
2016-04-04 14:09:00 +00:00