Commit Graph

2446 Commits

Author SHA1 Message Date
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
Simon McVittie
18e9169d7a libtest.sh: only check whether $(pwd) is empty once
test-sysroot.js runs libtestExec() twice, one of which is after
creating non-hidden directories in $(pwd), so this check needs to be
skipped the second time.

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

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Simon McVittie
9c4babf316 test-xattrs: sync how this is skipped with test-rofiles-fuse
If we touch test-xattrs before sourcing libtest.sh, we get:

test tmpdir=/tmp/test-tmp-ostree_test-xattrs.sh.test-HSEXEY is not
empty; run this test via `make check TESTS=`, not directly

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

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Simon McVittie
839628b3fa test-abi: use G_TEST_SRCDIR, G_TEST_BUILDDIR
There's no need to invent new variables for these.

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

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Simon McVittie
efb86ba9d3 libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources
This fixes the bug that in installed-tests that run testlib.sh under
"bash -c" (i.e. the C and JS tests), $(dirname $0) is "." and we can't do
the LD_PRELOAD correctly:

ERROR: ld.so: object './libreaddir-rand.so' from LD_PRELOAD cannot be
preloaded (cannot open shared object file): ignored.

Similarly, those tests can't copy gpghome correctly.

This also removes the confusing situation that SRCDIR in libtest.sh
(which is ${top_srcdir}/tests) does not mean the same thing as SRCDIR
in test-abi.sh (which is just ${top_srcdir}).

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

Closes: #234
Approved by: cgwalters
2016-03-31 18:54:13 +00:00
Colin Walters
bdf24cdc04 tests: Make failing to kill the GPG agent non-fatal
It's not working for me in `make check` on a RHEL 7 Workstation,
apparently because no GPG agent is spawned.  I'm guessing this has
something to do with the GPG version?

The downside of this is we will be less likely to notice if GPG
changes again and we start leaking agents like we're in The Matrix
Reloaded.  But the real solution to that is containers anyways.

Closes: #233
Approved by: smcv
2016-03-31 18:43:31 +00:00
Simon McVittie
9dafc82024 Probe for GNU parallel more accurately
moreutils parallel isn't compatible with the command-line syntax
used here. Because it doesn't implement GNU-style --help and exits 1
when that option is given, this test was correctly skipped when
using moreutils parallel, but only by mistake.

moreutils parallel might conceivably gain --help and --version in
future, but hopefully nothing incompatible with GNU parallel is going
to gain a --gnu option.

Also use the --gnu option to force the new command-line semantics;
some versions optionally supported an incompatible command-line syntax
taken from moreutils parallel.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Jonathan Lebon
8cda8b6866 basic-test: commit with a non-empty subject
[smcv: split out from a larger commit, part of PR #231; add commit message]
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Jonathan Lebon
7835fcdc68 test-pull-untrusted.sh: always corrupt a regular file, not a symlink
test-pull-untrusted.sh would pass when run as root, but fail when run
as testuser. It turned out that the way the files were stored in the
repo when running as a testuser were different, which meant that a
different .file object was chosen for corruption. Except that file
turned out to be a symlink, so the echo "broke" actually just wrote
to the no_such_file symlink target, thus keeping the actual symlink
file's checksum the same and causing the pull-local to pass when it
should have failed.

[smcv: split this out of a larger commit, part of PR #231]
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
e1ce859368 Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab unavailable
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
d458399615 Force libreaddir-rand to be a shared library
If installed-tests are disabled, it would normally be a static
(convenience) library, which isn't something we can LD_PRELOAD.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
1dd85513e5 tests/admin-test.sh: this is a bash script, not a POSIX sh script
The "function foo()" syntax is bash-specific, and Colin indicated in
PR #226 that he prefers to require bash rather than trying to support
every POSIX shell.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
07aa8e1c76 Load g-i bindings from builddir during build-time testing
Previously, the build-time tests would only pass if the g-i bindings to
OSTree were already installed, with a reasonably similar version.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
2b9032f016 .gitignore: update
Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
b25ddd29ab In tests that use gpg, terminate the gpg-agent after testing
Otherwise we leak those processes.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
47fd5c74f1 tap-test: clean up temporary test directories as intended
The script created ./.testtmp but looked for ./.test, which isn't
going to work.

This means the various "ostree trivial-httpd --autoexit" processes
actually exit, because their web roots are cleaned up now.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
f8bef792cb Symlink libreaddir-rand.so into tests directory
This means it can be LD_PRELOADed during build-time testing.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
3e3755c497 various tests: skip if temp directory lacks xattr support
Some autobuilder environments place the entire build chroot on tmpfs, so
even /var/tmp might not have this.

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

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Simon McVittie
c276025466 test-xattrs: use TAP syntax to skip test
Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #232
Approved by: cgwalters
2016-03-31 14:22:06 +00:00
Colin Walters
39777ded54 docs/CONTRIBUTING.md: Update for github move, Homu etc.
Closes: #230
Approved by: jlebon
2016-03-30 16:17:21 +00:00
Jonathan Lebon
9260d3dba1 commit: support editor for orphan commits
This is a follow up to #227 to allow ostree to open the editor also for
orphan commits when no subject or body is given on the cmdline.

Closes: #229
Approved by: cgwalters
2016-03-30 12:19:06 +00:00
Colin Walters
23d26d5f65 commit: Support writing orphans
The API supports this, and it's not hard for us to do in the command
line as well.  One possible use case is separating "content
generation" in a separate server.

Related: https://github.com/ostreedev/ostree/pull/223

Closes: #227
Approved by: jlebon
2016-03-30 03:10:50 +00:00
Colin Walters
c6b4ecd474 commit: Support generating commits with no parent, or a custom one
When I'm doing local development builds, it's quite common for me not
to want to accumulate history.  There are also use cases for this on
build servers as well.

In particular, using this, one could write a build system that didn't
necessarily need to have access to (a copy of) the OSTree repository.
Instead, the build system would determine the last commit ID on the
branch, and pass that to a worker node, then sync the generated
content back.

The API supported generating custom commits that don't necessarily
reference the previous commit on the same branch, let's just expose
this in the command line for convenience.

I plan to also support this rpm-ostree.

Closes: #223
Approved by: jlebon
2016-03-29 14:31:29 +00:00
Colin Walters
a50df5daf7 docs: Add a section on repository management
Just keeping my promise to write more documentation.  There could be a
lot more to write here, but I'm trying to get a start done.

Closes: #222
Approved by: jlebon
2016-03-29 14:10:24 +00:00
Simon McVittie
45a6c109d9 packaging: fix bashism in dist-snapshot target
On Debian and its derivatives, /bin/sh is a lightweight POSIX shell
(currently dash) which does not support the bash {foo,bar} syntax.

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

Closes: #226
Approved by: cgwalters
2016-03-28 11:50:11 +00:00
Dan Nicholson
b1e1e51660 main: Set log handler for OSTree domain
Now that OSTree is used as G_LOG_DOMAIN, set the main handler to match
so the appropriate messages are filtered. It would probably be more
appropriate to spell out "OSTree" in the code, but since G_LOG_DOMAIN is
being defined globally in the project, might as well reuse it here.

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

Closes: #225
Approved by: cgwalters
2016-03-26 18:22:59 +00:00
Dan Nicholson
e9c58fe706 build: Set G_LOG_DOMAIN to OSTree
This will allow ostree programs to filter log messages specifically for
OSTree instead of using the NULL domain for ostree debugging.

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

Closes: #225
Approved by: cgwalters
2016-03-26 18:22:59 +00:00
Dan Nicholson
750e2cbf33 core: Add debug messages for traversing
If you have a repo where a needed object has been inadvertantly removed,
all you'll get is a "No such metadata object" error with no clue about
where it was referenced from.

Add some debug messages to provide clues about which objects are being
traversed and found.

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

Closes: #224
Approved by: cgwalters
2016-03-26 13:50:16 +00:00