ostree.git
8 years agolib/repo-commit: Import detached metadata even if hardlink exists
Philip Withnall [Tue, 3 Oct 2017 14:45:34 +0000 (15:45 +0100)]
lib/repo-commit: Import detached metadata even if hardlink exists

Spotted while reading through the code, it looks like the
copy_detached_metadata() call is accidentally omitted if a hardlink
already exists for the .commit object.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1242
Approved by: cgwalters

8 years agolib/gpg: Print debug info when reading GPG keys
Matthew Leeds [Tue, 3 Oct 2017 05:35:17 +0000 (22:35 -0700)]
lib/gpg: Print debug info when reading GPG keys

This commit adds debug output whenever libostree reads GPG keys, which
can come from different locations in the file system. This is especially
helpful in debugging "GPG signatures found, but none are in trusted
keyring" errors, which in my case was caused by OSTree looking in
/usr/local/share/ostree/trusted.gpg.d/ rather than
/usr/share/ostree/trusted.gpg.d/.

Closes: #1241
Approved by: cgwalters

8 years agolib/pull: Minor cleanup to metadata scanning function, add docs
Colin Walters [Mon, 2 Oct 2017 19:36:47 +0000 (15:36 -0400)]
lib/pull: Minor cleanup to metadata scanning function, add docs

I'm regretting a bit having the `guint8*csum` variant of checksums
except for the serialized form.  Once we start doing processing
it's easier to just have it remain hex.

Do an on-stack conversion for the metadata scanning function; this
drops a malloc and also just looks nicer.

Also add some long-awaited function comments to the two.

Closes: #1240
Approved by: jlebon

8 years agolib/bloom: Add some missing preconditions on n_bytes
Philip Withnall [Mon, 2 Oct 2017 17:04:37 +0000 (18:04 +0100)]
lib/bloom: Add some missing preconditions on n_bytes

These shouldn’t change the bloom filter’s behaviour at all, but make it
a bit more obvious what the programmatical limitations are on the sizes
it can deal with.

In reality, those sizes should never be reached because they won’t fit
in a DNS-SD record.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1239
Approved by: cgwalters

8 years agolib/uboot: Port to fd-relative
Colin Walters [Sun, 1 Oct 2017 20:34:30 +0000 (16:34 -0400)]
lib/uboot: Port to fd-relative

Prep for `ostree_sysroot_new_at()`.

Closes: #1237
Approved by: jlebon

8 years agolib/syslinux: Port to fd-relative
Colin Walters [Sun, 1 Oct 2017 17:52:15 +0000 (10:52 -0700)]
lib/syslinux: Port to fd-relative

Prep for `ostree_sysroot_new_at()`.  Also just generally nicer.

Closes: #1237
Approved by: jlebon

8 years agolib/pull: Fix regression with pull-local for nonexistent refs
Colin Walters [Mon, 2 Oct 2017 15:24:05 +0000 (11:24 -0400)]
lib/pull: Fix regression with pull-local for nonexistent refs

I was reading the pull code for the last release, and spotted
a bug in commit f923c2e1eaebe0c781f07d34ae1a03f94357bccd - in
the case where the ref doesn't exist, we don't set an error,
tripping an assertion in the main code.

The previous code wanted the ref to always exist, so just flip back the boolean
for "ignore noent". I moved the `g_strchomp()` just into the HTTP path - if a
local repo is corrupted in this way it's something to fix in that repo.

Closes: #1238
Approved by: pwithnall

8 years agolib/sysroot: Add some more comments
Colin Walters [Fri, 29 Sep 2017 21:20:10 +0000 (17:20 -0400)]
lib/sysroot: Add some more comments

Also avoid gtk-doc style for private functions, as it tries to parse them and
complains since they aren't public.

Closes: #1230
Approved by: jlebon

8 years agolib/commit: Add some gtk-doc and internal doc comments
Colin Walters [Fri, 29 Sep 2017 19:31:03 +0000 (15:31 -0400)]
lib/commit: Add some gtk-doc and internal doc comments

Just making more of an effort for this for obvious reasons. We had a few public
APIs not documented too.

Closes: #1230
Approved by: jlebon

8 years agobuild-sys: Post-release version bump
Jonathan Lebon [Mon, 2 Oct 2017 14:48:03 +0000 (14:48 +0000)]
build-sys: Post-release version bump

Closes: #1236
Approved by: cgwalters

8 years agoRelease 2017.12
Colin Walters [Mon, 2 Oct 2017 14:21:27 +0000 (10:21 -0400)]
Release 2017.12

Closes: #1234
Approved by: jlebon

8 years agoostree/summary: Generate an ostree-metadata ref when updating summary
Philip Withnall [Mon, 11 Sep 2017 13:42:52 +0000 (14:42 +0100)]
ostree/summary: Generate an ostree-metadata ref when updating summary

This is the new way of publishing repository metadata, rather than as
additional-metadata in the summary file. The use of an ostree-metadata
ref means that the metadata from multiple upstream collections is not
conflated when doing P2P mirroring of many repositories.

The new ref is only generated if the repository has a collection ID set.
The old summary file continues to be generated for backwards
compatibility (and because it continues to be the canonical ref →
checksum map for the repository).

The new code is only used if configured with --enable-experimental-api.

Includes unit tests.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1158
Approved by: cgwalters

8 years agoostree/summary: Eliminate redundant gotos from error handling path
Philip Withnall [Mon, 11 Sep 2017 13:42:07 +0000 (14:42 +0100)]
ostree/summary: Eliminate redundant gotos from error handling path

There is no error handling to do, so just return everywhere instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1158
Approved by: cgwalters

8 years agoman: Fix a copypasta error in ostree-summary.xml
Philip Withnall [Mon, 11 Sep 2017 14:35:48 +0000 (15:35 +0100)]
man: Fix a copypasta error in ostree-summary.xml

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1158
Approved by: cgwalters

8 years agolib/bloom: Fix a -Wconversion warning in OstreeBloom
Philip Withnall [Sat, 30 Sep 2017 23:13:17 +0000 (00:13 +0100)]
lib/bloom: Fix a -Wconversion warning in OstreeBloom

Compiling with -Wconversion warns on this line, as the conversion from
guint64 to guint8 is implicit (but safe: there is no bug here, since the
implicit cast is applied after the modulus arithmetic).

Make the cast explicit to silence -Wconversion.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1231
Approved by: cgwalters

8 years agolib/bloom: Fix bloom hashing on 32-bit architectures
Philip Withnall [Sat, 30 Sep 2017 23:12:25 +0000 (00:12 +0100)]
lib/bloom: Fix bloom hashing on 32-bit architectures

There was an implicit cast from guint64 to gsize (which is 32-bit on
armhf, for example) before the modulus arithmetic which safely narrows
the index.

Fix that by using a guint64 intermediate variable and making the cast
explicit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1231
Approved by: cgwalters

8 years agotests/installed: also run test-basic-c
Jonathan Lebon [Fri, 29 Sep 2017 21:42:23 +0000 (21:42 +0000)]
tests/installed: also run test-basic-c

Since we now have a subtest there that needs full xattr support.

Closes: #1170
Approved by: cgwalters

8 years agotests: check for relabeling rather than overlay
Jonathan Lebon [Thu, 28 Sep 2017 18:57:33 +0000 (18:57 +0000)]
tests: check for relabeling rather than overlay

Instead of checking for overlayfs, let's explicitly check for our
ability to relabel files since we now have a `libtest` function to do
this. Also port that logic to `libostreetest`.

Note that overlayfs *does* allow manipulating user xattrs. So ideally,
we should break down `OSTREE_NO_XATTRS` further to distinguish between
tests that use bare repos from other modes.

We check the current directory instead of `/` so that developers can
just point `TEST_TMPDIR` to a non-overlayfs mount point when hacking
from a container.

Closes: #1170
Approved by: cgwalters

8 years agolib/commit: don't query devino cache for modified files
Jonathan Lebon [Thu, 28 Sep 2017 19:08:06 +0000 (19:08 +0000)]
lib/commit: don't query devino cache for modified files

We can't use the cache if the file we want to commit has been modified
by the client through the file info or xattr modifiers. We would
prematurely look into the cache in `write_dfd_iter_to_mtree_internal`,
regardless of whether any filtering applied.

We remove that path there, and make sure that we only use the cache if
there were no modifications. We rename the `get_modified_xattrs` to
`get_final_xattrs` to reflect the fact that the xattrs may not be
modified.

One tricky bit that took me some time was that we now need to store the
st_dev & st_ino values in the GFileInfo because the cache lookup relies
on it. I'm guessing we regressed on this at some point.

This patch does slightly change the semantics of the xattr callback.
Previously, returning NULL from the cb meant no xattrs at all. Now, it
means to default to the on-disk state. We might want to consider putting
that behind a flag instead. Though it seems like a more useful behaviour
so that callers can only override the files they want to without losing
original on-disk state (and if they don't want that, just return an
empty GVariant).

Closes: #1165
Closes: #1170
Approved by: cgwalters

8 years agotests/libtest.sh: always nuke repo and files
Jonathan Lebon [Thu, 28 Sep 2017 18:56:17 +0000 (18:56 +0000)]
tests/libtest.sh: always nuke repo and files

This allows users to easily re-initialize the test repo.

Closes: #1170
Approved by: cgwalters

8 years agolibarchive: Fix assertion error if used with CANONICAL_PERMISSIONS
Colin Walters [Thu, 28 Sep 2017 19:41:02 +0000 (15:41 -0400)]
libarchive: Fix assertion error if used with CANONICAL_PERMISSIONS

I was trying to do a change for rpm-ostree to use
`OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS`
for container builds with `bare-user-only,` but hit an assertion here
ultimtely because we weren't setting `standard::type`.

Rather than hand-rolling `GFileInfo` creation, use the stat buffer conversion
code which is more robust and used in multiple places already.

Closes: #1227
Approved by: jlebon

8 years agotests/repo: Drop modeline from top of file
Philip Withnall [Fri, 22 Sep 2017 11:49:30 +0000 (12:49 +0100)]
tests/repo: Drop modeline from top of file

As per commit 6e4146a3.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1203
Approved by: cgwalters

8 years agotests: Update some tests to use OSTREE_REPO_MODE_ARCHIVE not ARCHIVE_Z2
Philip Withnall [Fri, 22 Sep 2017 11:08:01 +0000 (12:08 +0100)]
tests: Update some tests to use OSTREE_REPO_MODE_ARCHIVE not ARCHIVE_Z2

The latter is deprecated now.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1203
Approved by: cgwalters

8 years agotests: Add a manual integration test for OstreeRepoFinderMount
Philip Withnall [Mon, 18 Sep 2017 14:43:41 +0000 (15:43 +0100)]
tests: Add a manual integration test for OstreeRepoFinderMount

Test an end-to-end flow of pulling refs from an online
repository → local OS repository → create a USB stick of
them → pull to a local OS repository on another machine.

This is a manual test, as it requires a throwaway USB stick which the
test can format as ext4 or vfat to test the flow works with both file
systems.

Run it as:

MOUNT_INTEGRATION_DEV=/dev/sdb1 make check \
  TESTS=tests/test-repo-finder-mount-integration.sh

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1203
Approved by: cgwalters

8 years agotests: Add 404 tests for dirtree objects too
Colin Walters [Fri, 26 May 2017 14:52:26 +0000 (10:52 -0400)]
tests: Add 404 tests for dirtree objects too

I now believe the flatpak issue we were hitting was
https://github.com/ostreedev/ostree/pull/1185
but let's add these tests anyways for more coverage.

Closes: #888
Approved by: jlebon

8 years agotree-wide: Bump libglnx, port to new lockfile init
Colin Walters [Wed, 27 Sep 2017 19:54:32 +0000 (15:54 -0400)]
tree-wide: Bump libglnx, port to new lockfile init

In particular I'd like to get the copy fix in, since it might affect users for
the keyring bits.

Update submodule: libglnx

Closes: #1225
Approved by: jlebon

8 years agolib/pull: Don't request deltas for unchanged commits
Colin Walters [Tue, 26 Sep 2017 21:21:59 +0000 (17:21 -0400)]
lib/pull: Don't request deltas for unchanged commits

I noticed this while debugging why I was seeing "2 metadata objects" fetched for
a different PR. I knew 1 was detached meta, but the other turned out to be this.

There's no reason to request a delta if the ref is unchanged.

Closes: #1220
Approved by: jlebon

8 years agotests/commit-sign: Update a bit to more modern style
Colin Walters [Wed, 27 Sep 2017 00:51:24 +0000 (20:51 -0400)]
tests/commit-sign: Update a bit to more modern style

I was trying to debug this while working on another PR. Add `echo ok` lines and
also use `assert_file_has_content` more directly; there's no reason to use an
intermediate `grep` since if it fails it won't print the original file.

Closes: #1220
Approved by: jlebon

8 years agolib/diff: Add compile-time ABI check on 64 bit arches
Colin Walters [Wed, 27 Sep 2017 17:15:06 +0000 (13:15 -0400)]
lib/diff: Add compile-time ABI check on 64 bit arches

Like what was done for most of the `ostree-repo.h` values.  Prep
for adding a new option.

Closes: #1223
Approved by: jlebon

8 years agoci: Record primary context results using g-d-t-r --log-directory
Colin Walters [Tue, 26 Sep 2017 18:05:08 +0000 (14:05 -0400)]
ci: Record primary context results using g-d-t-r --log-directory

So the output isn't all intermingled.  I just pushed a commit
to add `--log-directory`, so we need to build it from git master
for now.

Closes: #1218
Approved by: jlebon

8 years agolib/repo-pull: Fix remote names in refspecs from non-mirror P2P pulls
Philip Withnall [Thu, 21 Sep 2017 15:08:26 +0000 (16:08 +0100)]
lib/repo-pull: Fix remote names in refspecs from non-mirror P2P pulls

Propagate the refspec_name from the OstreeRemote returned by an
OstreeRepoFinder through to the set_ref() call.

This changes ostree_repo_pull_with_options() to accept the
previously-disallowed combination of passing override-remote-name in
options and also setting a remote name in remote_name_or_baseurl.
ostree_repo_pull_with_options() will continue to pull using the remote
config named in remote_name_or_baseurl as before; but will now use the
remote name from override-remote-name when it’s setting the refs at the
end of the pull. This is consistent with the documentation for
override-remote-name.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1202
Approved by: cgwalters

8 years agolib/remote: Store name of remote providing keyring for dynamic remotes
Philip Withnall [Thu, 21 Sep 2017 15:04:11 +0000 (16:04 +0100)]
lib/remote: Store name of remote providing keyring for dynamic remotes

When pulling from a dynamic (peer to peer) remote, the remote’s name is
set to a unique, generated string which doesn’t exist in repo/config. If
doing a non-mirror pull, however, we don’t want to use this name in the
refspecs for newly created or updated refs — we want to use the name of
the remote which provided the keyring for the pull (this will be a
remote from repo/config whose collection ID matches that being used for
the peer to peer pull).

Store both names in OstreeRemote. The name to use for refspecs is stored
as refspec_name, and is typically NULL unless it differs from name.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1202
Approved by: cgwalters

8 years agolib/repo: Change resolve_keyring_for_collection() to return a remote
Philip Withnall [Thu, 21 Sep 2017 15:00:05 +0000 (16:00 +0100)]
lib/repo: Change resolve_keyring_for_collection() to return a remote

Instead of returning just the keyring filename, return the entire
OstreeRemote, which has the keyring filename as one of its members. This
will simplify some upcoming changes, and allows slightly improved debug
logging.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1202
Approved by: cgwalters

8 years agolib/repo-pull: Fix a potential minor leak
Philip Withnall [Thu, 21 Sep 2017 15:01:44 +0000 (16:01 +0100)]
lib/repo-pull: Fix a potential minor leak

If override-remote-name is specified in the options to
ostree_repo_pull_with_options(), but the remote_name_or_baseurl argument
is also set to a remote name, the override-remote-name would be leaked.

Note that this is currently an invalid configuration, so this leak is
basically never hit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1202
Approved by: cgwalters

8 years agolib/pull: Add status for imported objects
Colin Walters [Tue, 26 Sep 2017 17:58:54 +0000 (13:58 -0400)]
lib/pull: Add status for imported objects

Followup for recent work in commits:

 - 8a7a35970928331a028ccddd04590ac300dbd26e
 - 1a9a473580e9066f5d4a969932d703b5b104b2b7

Keep track of how many objects we imported, and print that for `ostree
pull-local` (also do this even if noninteractive, like we did for `pull`).

In implementing this at first I used separate variables for import
from repo vs import from localcache, but that broke some of the
tests that checked those values.

It's easier to just merge them; we know from looking at whether or not
`remote_repo_local` is set whether or not we were doing a "HTTP pull with
localcache" versus a true `pull-local` and can use that when rendering status.

Closes: #1219
Approved by: jlebon

8 years agolib/repo-pull: Use resolve() instead of list() in fetch_ref_contents()
Philip Withnall [Tue, 26 Sep 2017 14:17:47 +0000 (15:17 +0100)]
lib/repo-pull: Use resolve() instead of list() in fetch_ref_contents()

This is more efficient in the non-collection case; in the collection
case, the implementation of ostree_repo_resolve_collection_ref() needs
to be rewritten to improve efficiency.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1182
Approved by: cgwalters

8 years agolib/repo-refs: Add first version of ostree_repo_resolve_collection_ref()
Philip Withnall [Tue, 26 Sep 2017 14:15:57 +0000 (15:15 +0100)]
lib/repo-refs: Add first version of ostree_repo_resolve_collection_ref()

This is a parallel for ostree_repo_resolve_rev_ext() which works on
collection–refs. At the moment, the implementation is simple and uses
ostree_repo_list_collection_refs(). In future, it could be rewritten to
check the checksum directly rather than enumerating all
potentially-relevant checksums.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1182
Approved by: cgwalters

8 years agocreate-usb: Add a create-usb command to complement OstreeRepoFinderMount
Philip Withnall [Fri, 15 Sep 2017 15:05:12 +0000 (16:05 +0100)]
create-usb: Add a create-usb command to complement OstreeRepoFinderMount

This can be used to put OSTree repositories on USB sticks in a format
recognised by OstreeRepoFinderMount.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1182
Approved by: cgwalters

8 years agosrc/pull: Support local pulls for collection–refs
Philip Withnall [Mon, 18 Sep 2017 13:01:21 +0000 (14:01 +0100)]
src/pull: Support local pulls for collection–refs

Previously, collection–refs could only be pulled from a repository if it
had a summary file (which listed them). There was no way to pull from a
local repository which doesn’t have a summary file, and where the refs
were stored as refs/remotes/$remote/$ref, with a config section linking
that $remote to the queried collection ID.

Fix that by explicitly supporting pull_data->remote_repo_local in
fetch_ref_contents().

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1182
Approved by: cgwalters

8 years agotests,ci: Move "test-basic" (bare mode) to installed test
Colin Walters [Tue, 26 Sep 2017 16:41:07 +0000 (12:41 -0400)]
tests,ci: Move "test-basic" (bare mode) to installed test

Our CI uses default Docker, which has SELinux labeling but is rather
evil in returning `EOPNOTSUPP` to any attempts to set `security.selinux`,
even if to the same value.

The previous fire 🔥 for this was: https://github.com/ostreedev/ostree/pull/759

The `bare` repo mode really only makes sense as uid 0, so our installed
test framework is a good match for this.  However, the unit tests *do*
work in a privileged container even as non-root, and *also* should
work on SELinux-disabled systems.  So let's teach the test framework
how to skip in those situations.

I tested this both in a priv container (my default builder) and an unpriv
container (like our CI).

At the same time, start executing the `test-basic.sh` from an installed test,
so we get better coverage than before.

This is just the start - all of the sysroot tests really need the
same treatment.

Closes: #1217
Approved by: jlebon

8 years agolib/pull: Default checksum for archive mirror, add TRUSTED_HTTP flag
Colin Walters [Sat, 23 Sep 2017 14:23:47 +0000 (10:23 -0400)]
lib/pull: Default checksum for archive mirror, add TRUSTED_HTTP flag

I now think commit fab1e113db558cb7d6754e243919558df92d4864 was a mistake;
because it breaks the mental model that at least I'd built up that "local repos
don't have checksums verified, HTTP does".

For example, a problem with this is (with that mental model in place) it's easy
for people who set up mirrors like this to then do local pulls, and at that
point we've done a deployment with no checksum verification.

Further, since then we did PR #671 AKA commit 3d38f03 which is really most of
the speed hit.

So let's switch the default even for this case to doing checksum verification,
and add `ostree pull --http-trusted`. People who are in situations where they
know they want this can find it and turn it on.

Closes: https://github.com/ostreedev/ostree/issues/1211
Closes: #1212
Approved by: jlebon

8 years agolib/pull: Refactor to use OstreeRepoImportFlags internally
Colin Walters [Sat, 23 Sep 2017 13:59:53 +0000 (09:59 -0400)]
lib/pull: Refactor to use OstreeRepoImportFlags internally

Rather than carrying two booleans, just convert `OstreeRepoPullFlags`
into `OstreeRepoImportFlags`.  This allows us to drop an internal
wrapper function and just directly call `_ostree_repo_import_object()`.

This though reveals that our mirroring import path doesn't check the
`OSTREE_REPO_PULL_FLAGS_UNTRUSTED` flag...it probably should.

Prep for further work.

Closes: #1212
Approved by: jlebon

8 years agolib/pull: Minor refactoring of metadata scanning function
Colin Walters [Sat, 23 Sep 2017 13:44:49 +0000 (09:44 -0400)]
lib/pull: Minor refactoring of metadata scanning function

Make the "local repo" processing conditional the same as the "localcache" bits;
this is really just a de-indent. Also add some comments. Prep for further work.

Closes: #1212
Approved by: jlebon

8 years agobin/pull: Fix description of --untrusted
Colin Walters [Tue, 26 Sep 2017 17:07:53 +0000 (13:07 -0400)]
bin/pull: Fix description of --untrusted

It means *do* verify for local.

Closes: #1212
Approved by: jlebon

8 years agolib/commit: fix using uninitialized var
Jonathan Lebon [Wed, 13 Sep 2017 16:17:17 +0000 (16:17 +0000)]
lib/commit: fix using uninitialized var

Noticed this while reading the code. The `child` var hasn't been
initialized yet at the time we throw this error (and even then, it's
only conditionally initialized). To be nice, let's just always calculate
the child path and pass that along.

Also do some minor style porting to decl near use.

Closes: #1216
Approved by: cgwalters

8 years agolib/commit: add comments to explain dir commit path
Jonathan Lebon [Wed, 13 Sep 2017 16:05:47 +0000 (16:05 +0000)]
lib/commit: add comments to explain dir commit path

Add a few comments for each of the central functions used for committing
data from a directory. Took me a bit to understand the relationship
between those functions.

Closes: #1216
Approved by: cgwalters

8 years agolib/commit: Add a copy fastpath for imports
Colin Walters [Wed, 20 Sep 2017 03:09:11 +0000 (23:09 -0400)]
lib/commit: Add a copy fastpath for imports

This fixes up the last of the embarassing bits I saw from
the stack trace in:
https://github.com/ostreedev/ostree/issues/1184

We had a hardlink fast path, but that doesn't apply across
devices, which occurs in two notable cases:

 - Installer ISO with local repo
 - Tools like pungi that copy the repo to a local snapshot

Obviously there are a lot of subtleties here around things like the
bare-user-only conversions as well as exactly what data we copy. I think to get
better test coverage we may want to add `pull-local --no-hardlink` or so.

Closes: #1197
Approved by: jlebon

8 years agolib/commit: Some misc porting to decl-after-stmnt
Colin Walters [Tue, 26 Sep 2017 00:39:53 +0000 (20:39 -0400)]
lib/commit: Some misc porting to decl-after-stmnt

Just happened to have this file open.

Closes: #1214
Approved by: jlebon

8 years agolib/repo-finder-mount: Add var/lib/flatpak as a well-known directory
Philip Withnall [Mon, 25 Sep 2017 17:32:07 +0000 (18:32 +0100)]
lib/repo-finder-mount: Add var/lib/flatpak as a well-known directory

Add this as an additional well-known directory which is checked on
mounted removable drives to see if it contains OSTree repos we can pull
refs from.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://github.com/ostreedev/ostree/issues/1210

Closes: #1213
Approved by: cgwalters

8 years agoAdd --with-crypto=gnutls
Jussi Laako [Tue, 13 Jun 2017 13:56:21 +0000 (16:56 +0300)]
Add --with-crypto=gnutls

Introduce support for GnuTLS for computing cryptograpic
hashes, similar to the OpenSSL backend.  A reason to do
this is some distributors want to avoid GPLv3, and GPG
pulls that in.

A possible extension of using GnuTLS would be replacing the GPG signing
with `PKCS#7` signatures and `X.509` keys.

We also support `--with-crypto=openssl`, which has the same effect
as `--with-openssl`, and continues to be supported.

Changes by Colin Walters <walters@verbum.org>:

 - Drop libgcrypt option for now
 - Unify buildsystem on --with-crypto

Link: https://mail.gnome.org/archives/ostree-list/2017-June/msg00002.html
Signed-off-by: Jussi Laako <jussi.laako@linux.intel.com>
Closes: #1189
Approved by: cgwalters

8 years agolib: Define an alias OSTREE_REPO_MODE_ARCHIVE
Colin Walters [Thu, 21 Sep 2017 19:48:46 +0000 (15:48 -0400)]
lib: Define an alias OSTREE_REPO_MODE_ARCHIVE

For the old `OSTREE_REPO_MODE_ARCHIVE_Z2`.  Use it mostly tree
wide except for the repo finder tests (to avoid conflicting with
some outstanding PRs).

Just noted another user coming in some of those tests and wanted to do a
cleanup.

Closes: #1209
Approved by: jlebon

8 years agolib/core: Add static assertions for OstreeRepoMode enum values
Colin Walters [Thu, 21 Sep 2017 19:44:24 +0000 (15:44 -0400)]
lib/core: Add static assertions for OstreeRepoMode enum values

Prep for adding an alias.

Closes: #1209
Approved by: jlebon

8 years agoAdd a .vimrc and .editorconfig
Jonathan Lebon [Thu, 21 Sep 2017 19:46:17 +0000 (19:46 +0000)]
Add a .vimrc and .editorconfig

The `.vimrc` requires the `exrc` option to be turned on, and
`.editorconfig` requires https://github.com/editorconfig/editorconfig-vim
apparently.

Closes: #1208
Approved by: cgwalters

8 years agotests/libtest: check that we have setfattr
Jonathan Lebon [Wed, 20 Sep 2017 17:07:54 +0000 (17:07 +0000)]
tests/libtest: check that we have setfattr

We use `setfattr` to determine whether the filesystem we're on supports
xattrs, but we need to check that `setfattr` itself is available. We
just make it a hard requirement but only if trying to run tests that ask
about xattr support.

Closes: #1207
Approved by: cgwalters

8 years agotests: allow specifying tmpdir
Jonathan Lebon [Wed, 20 Sep 2017 17:06:41 +0000 (17:06 +0000)]
tests: allow specifying tmpdir

Allow developers to override the default /var/tmp dir, which e.g. might
be on overlayfs and thus produces reduced coverage.

Closes: #1207
Approved by: cgwalters

8 years agotree-wide: Remove Emacs modelines
Colin Walters [Thu, 21 Sep 2017 19:26:06 +0000 (15:26 -0400)]
tree-wide: Remove Emacs modelines

We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f
There's no need to have it per-file, with that people might think
to add other editors, which is the wrong direction.

Closes: #1206
Approved by: jlebon

8 years agolib/repo: Add ostree_repo_hash() and tests
Philip Withnall [Thu, 21 Sep 2017 19:22:09 +0000 (20:22 +0100)]
lib/repo: Add ostree_repo_hash() and tests

Add a hash function for OstreeRepo instances, which relies on the repo
being open, and hence being able to hash the device and inode of its
root directory.

Add unit tests for this and ostree_repo_equal().

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://github.com/ostreedev/ostree/issues/1191

Closes: #1205
Approved by: cgwalters

8 years agolib/repo: Use correct name for tmpdir lockfile
Colin Walters [Thu, 21 Sep 2017 18:50:54 +0000 (14:50 -0400)]
lib/repo: Use correct name for tmpdir lockfile

Such an evil bug 🙈. I was just reading an strace trying to figure out what was
going on, and noticed we had the `XXXXXX` in the lockfile name. It was only
after that I realized that that this might *be* the cause of the skopeo issue.

This is another case where we definitely need more test coverage of things that
actually use the API multiple times in process; might look at dusting off the
work for the rpm-ostree test.

Closes: https://github.com/ostreedev/ostree/issues/1196
Closes: #1204
Approved by: jlebon

8 years agoci: Add an "all options disabled" context
Colin Walters [Tue, 19 Sep 2017 19:19:05 +0000 (15:19 -0400)]
ci: Add an "all options disabled" context

We keep occasionally regressing this so let's start covering it now. I'm
intentionally not running the tests since that would likely entail a lot more
conditionalizing pain.

Closes: #1194
Approved by: jlebon

8 years agolib/commit: Don't try to call linkat() for import on distinct devices
Colin Walters [Tue, 19 Sep 2017 19:07:30 +0000 (15:07 -0400)]
lib/commit: Don't try to call linkat() for import on distinct devices

While opening a repo we've recorded the device/inode for a while; use it to
avoid calling `linkat()` during object import if we know it's going to fail.

Closes: #1193
Approved by: jlebon

8 years agolib: Move bareuseronly verification into commit/core
Colin Walters [Mon, 18 Sep 2017 19:46:03 +0000 (15:46 -0400)]
lib: Move bareuseronly verification into commit/core

Conceptually `ostree-repo-pull.c` should be be written using
just public APIs; we theoretically support building without HTTP
for people who just want to use the object store portion and
do their own fetching.

We have some nontrivial behaviors in the pull layer though; one
of those is the "bareuseronly" verification.  Make a new internal
API that accepts flags, move it into `commit.c`.  This
is prep for further work in changing object import to support
reflinks.

Closes: #1193
Approved by: jlebon

8 years agorofiles-fuse: also pass mode for O_RDONLY
Jonathan Lebon [Wed, 20 Sep 2017 18:38:16 +0000 (18:38 +0000)]
rofiles-fuse: also pass mode for O_RDONLY

In the `O_RDONLY` case, we were calling `openat` without a mode
argument. However, it's perfectly legal (albeit unusual) to do
`open(O_RDONLY|O_CREAT)`. One such application that makes use of this is
`flock(1)`.

This was actually caught by `_FORTIFY_SOURCE=2`, and once we run
`rofiles-fuse` with `-f`, the message is clear:

```
*** invalid openat64 call: O_CREAT or O_TMPFILE without mode ***:
rofiles-fuse terminated
======= Backtrace: =========
/lib64/libc.so.6(+0x7c8dc)[0x7f36d9f188dc]
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f36d9fbfaa7]
/lib64/libc.so.6(+0x10019a)[0x7f36d9f9c19a]
rofiles-fuse[0x401768]
...
```

Without `_FORTIFY_SOURCE`, the file gets created, but its mode is
completely random.

I ran into this while investigating
https://github.com/projectatomic/rpm-ostree/pull/1003.

Closes: #1200
Approved by: cgwalters

8 years agotree-wide: Squash a few warnings when building with no features
Colin Walters [Thu, 21 Sep 2017 15:01:29 +0000 (11:01 -0400)]
tree-wide: Squash a few warnings when building with no features

Noticed these since I had a local configured build with no features for testing
the PAPR context for it.

Closes: #1201
Approved by: jlebon

8 years agolib/checkout: Squash a gcc maybe-uninitialized warning
Colin Walters [Thu, 21 Sep 2017 15:00:47 +0000 (11:00 -0400)]
lib/checkout: Squash a gcc maybe-uninitialized warning

gcc doesn't know that our enum cases must be exhaustive.

Closes: #1201
Approved by: jlebon

8 years agolib/repo: Move alloca() outside of loop
Colin Walters [Thu, 21 Sep 2017 15:00:09 +0000 (11:00 -0400)]
lib/repo: Move alloca() outside of loop

Just noticed this while looking at the code for a different issue.

Closes: #1201
Approved by: jlebon

8 years agolib/repo: Don't syncfs or fsync() dirs if fsync opt is disabled
Colin Walters [Mon, 18 Sep 2017 18:29:16 +0000 (14:29 -0400)]
lib/repo: Don't syncfs or fsync() dirs if fsync opt is disabled

There are use cases for not syncing at all; think build cache repos, etc. Let's
be consistent here and make sure if fsync is disabled we do no sync at all.

I chose this opportunity to add tests using the shiny new strace fault
injection.  I can forsee using this for a lot more things, so I made
the support for detecting things generic.

Related: https://github.com/ostreedev/ostree/issues/1184

Closes: #1186
Approved by: jlebon

8 years agotests/libtest: Factor out user xattr detection
Colin Walters [Mon, 18 Sep 2017 17:58:54 +0000 (13:58 -0400)]
tests/libtest: Factor out user xattr detection

Make the equivalent of a `GOnce` or Rust `lazy_static!` detecting this and share
it between the two callers.

Prep for a future similar patch for strace fault injection.

Closes: #1186
Approved by: jlebon

8 years agolib/pull: Clarify use of unsigned summary support
Matthew Leeds [Tue, 19 Sep 2017 23:34:11 +0000 (16:34 -0700)]
lib/pull: Clarify use of unsigned summary support

Update the comments and remove an unneeded variable to make it clear
that the find_remotes_async() / pull_from_remotes_async() functions use
the unsigned summary support.

This is a follow-up of commit 8c148eb7e "lib/repo-finder: Emit
gpg-verify-summary=false in dynamic remote config".

Closes: #1195
Approved by: pwithnall

8 years agotests: Reset umask to 022 while creating test repository
Simon McVittie [Tue, 19 Sep 2017 17:37:58 +0000 (18:37 +0100)]
tests: Reset umask to 022 while creating test repository

In test-basic-root.sh we make assertions about the permissions
of files like baz/cow, which were created without an explicit chmod.
We can't do that unless we control the permissions.

For some reason the "debomatic" autobuilder used to do some Debian
archive rebuilds does the entire build including build-time tests
as uid 0 with umask 002, which broke those assertions. This seems
a weird thing to do, and I've opened a bug, but it also seems
reasonable to fix this test.

This also lets us remove a couple of existing workarounds for the
same issue.

Bug-Debian: https://bugs.debian.org/876138
Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1192
Approved by: cgwalters

8 years agoAdd support for pkcs11 URIs in TLS client key/certificate
Anton Gerasimov [Mon, 18 Sep 2017 14:29:27 +0000 (16:29 +0200)]
Add support for pkcs11 URIs in TLS client key/certificate

Closes: #1183
Approved by: cgwalters

8 years agolib/pull: Wait for pending ops to complete on error
Colin Walters [Mon, 18 Sep 2017 16:08:48 +0000 (12:08 -0400)]
lib/pull: Wait for pending ops to complete on error

I saw in a stack trace that the main thread was calling `exit()` even while
worker threads were alive and doing sha256/write/fsync etc. for objects.

The stack trace was a SEGV as the main thread was calling into library
`atexit()` handlers and we were a liblz4 destructor:

```
 #0  0x00007f2db790f8d4 _fini (liblz4.so.1)
 #1  0x00007f2dbbae1c68 __run_exit_handlers (libc.so.6)
```

(Why that library has a destructor I don't know offhand, can't find
 it in the source in a quick look)

Anyways, global library destructors and worker threads continuing simply don't
mix. Let's wait for our outstanding operations before we exit. This is also a
good idea for projects using libostree as a shared library, as we don't want
worker threads outliving operations.

Our existing pull corruption tests exercise coverage here.

I added a new `caught-error` status boolean to the progress API, and use it the
commandline to tell the user that we're waiting for outstanding ops.

Closes: #1185
Approved by: jlebon

8 years agolib/repo: Minor cleanup to object import function
Colin Walters [Mon, 18 Sep 2017 19:46:03 +0000 (15:46 -0400)]
lib/repo: Minor cleanup to object import function

We have a lot of layers of abstraction here; let's fold in the `trusted`
conditional into the call, since that's all the public API we're using does
anyways.

Prep for a future patch around object copying during imports.

Closes: #1187
Approved by: jlebon

8 years agotests: Explicitly unset LANGUAGE after setting LC_ALL
Simon McVittie [Tue, 19 Sep 2017 13:41:18 +0000 (14:41 +0100)]
tests: Explicitly unset LANGUAGE after setting LC_ALL

As a GNU extension, LANGUAGE takes precedence over LC_ALL for
gettext(3) whenever the locale is not C, causing tests that grep for
specific English strings to fail when run in non-English locales.
The upstream glibc proposal for C.UTF-8 would give C.UTF-8 the same
special case as C here, but the implementation in Debian does not
currently have this, so we have to unset LANGUAGE too.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1188
Approved by: jlebon

8 years agotree-wide: Some glnx_fstatat_allow_noent() porting
Colin Walters [Fri, 15 Sep 2017 20:29:22 +0000 (16:29 -0400)]
tree-wide: Some glnx_fstatat_allow_noent() porting

The new API is definitely nicer.

Closes: #1180
Approved by: jlebon

8 years agolib/repo: Drop outdated FIXME comment from ostree-repo.h
Philip Withnall [Fri, 15 Sep 2017 15:03:36 +0000 (16:03 +0100)]
lib/repo: Drop outdated FIXME comment from ostree-repo.h

This was some incomplete planning from while the find_remotes() API was
being designed; now totally outdated.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1179
Approved by: cgwalters

8 years agolib/repo-finder-mount: Change the schema for finding repos on volumes
Philip Withnall [Fri, 15 Sep 2017 14:59:32 +0000 (15:59 +0100)]
lib/repo-finder-mount: Change the schema for finding repos on volumes

See issue #1174 for the rationale behind this. In summary:
 • It required two lists of collection–refs to be maintained: one in the
   repository, and one pointing to the repository.
 • It didn’t automatically work for live USBs of OSs based on OSTree
   (where there’s always a repository at /ostree/repo).
 • It was unnecessarily complex.

The new scheme allows a list of repositories to be searched, but without
needing a layer of indirection through their collection–refs. It adds
/ostree/repo and /.ostree/repo as well-known repository locations which
are always checked on a mounted volume (if they exist).

Update the unit tests accordingly.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://github.com/ostreedev/ostree/issues/1174

Closes: #1179
Approved by: cgwalters

8 years agolib/repo: Add ostree_repo_equal() for comparing repos
Philip Withnall [Fri, 15 Sep 2017 14:26:22 +0000 (15:26 +0100)]
lib/repo: Add ostree_repo_equal() for comparing repos

This will compare their root directory inodes to see if they are the
same repository on disk. A convenience method for the users of the
public API who can’t access OstreeRepo.inode.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1179
Approved by: cgwalters

8 years agoci: Use distro-sync instead of upgrade
Colin Walters [Tue, 19 Sep 2017 13:46:17 +0000 (09:46 -0400)]
ci: Use distro-sync instead of upgrade

This should help ensure that if installing `glibc-devel` downgrades `glibc`
we'll run through our hackround for
<https://bugzilla.redhat.com/show_bug.cgi?id=1394862>.

Closes: #1190
Approved by: jlebon

8 years agobin/prune: Add --only-branch
Colin Walters [Fri, 1 Sep 2017 19:55:17 +0000 (15:55 -0400)]
bin/prune: Add --only-branch

In 5c940987e768523ef1411b65bcaad09fba6befef / #646 we
added `--retain-branch-depth`; this adds a symmetric
`--only-branch` for the case where a repo owner just
wants to prune a specific branch.

The implementation here is pretty straightforward; we
just walk all refs and inject the equivalent of
`--retain-branch-depth=$ref=-1` if they're *not* in
`--only-branch`.

Closes: https://github.com/ostreedev/ostree/issues/1115
Closes: #1127
Approved by: jlebon

8 years agotests/prune: Factor out a helper for counting commits in the repo
Colin Walters [Fri, 1 Sep 2017 20:24:31 +0000 (16:24 -0400)]
tests/prune: Factor out a helper for counting commits in the repo

We had lots of duplicates; prep for adding more tests.

Closes: #1127
Approved by: jlebon

8 years agoUpdate libglnx
Colin Walters [Tue, 12 Sep 2017 13:40:58 +0000 (09:40 -0400)]
Update libglnx

Update libglnx, which is mostly port the repo stagedir code
to the new tmpdir API.  This turned out to require some
libglnx changes to support de-allocating the tmpdir ref while
still maintaining the on-disk dir.

Update submodule: libglnx

Closes: #1172
Approved by: jlebon

8 years agobin/commit: Fix build failure when libarchive is not used
yceh [Mon, 18 Sep 2017 13:10:52 +0000 (13:10 +0000)]
bin/commit: Fix build failure when libarchive is not used

A `"}"` at line 641 is missing when `HAVE_LIBARCHIVE` is not defined
(even though probably few will use ostree without libarchive).

Closes: #1181
Approved by: jlebon

8 years agotest-help.sh: Skip trivial-httpd if enabled
Simon McVittie [Fri, 15 Sep 2017 15:05:48 +0000 (16:05 +0100)]
test-help.sh: Skip trivial-httpd if enabled

Because it runs a binary in ${libexecdir}, it will only work if
libostree was already installed, which makes the build-time test fail.
It also doesn't produce the output we expect: its usage mechanism
mentions "ostree-trivial-httpd", not "ostree trivial-httpd".

Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1177
Approved by: jlebon

8 years agotests: Fix JavaScript tests with gjs 1.50.0
Simon McVittie [Fri, 15 Sep 2017 14:32:55 +0000 (15:32 +0100)]
tests: Fix JavaScript tests with gjs 1.50.0

In recent gjs, you can't declare a variable with "let" multiple times.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1178
Approved by: cgwalters

8 years agolib/pull: Drop partial fetch code from libsoup backend
Colin Walters [Thu, 14 Sep 2017 19:10:54 +0000 (15:10 -0400)]
lib/pull: Drop partial fetch code from libsoup backend

Doing this in prep for libglnx tmpdir porting, but I think we should also do
this because the partial fetch code IMO was never fully baked; among other
things it was never integrated into the scheme we came up with for "boot id
sync" that we use for complete/staged objects.

There's a lot of complexity here that while we have some coverage for, I think
we need to refocus on the core functionality. The libcurl backend doesn't have
an equivalent to this today.

In particular for small objects, this is simply overly complex. The downside is
clearly for large objects like FAH's 61MB initramfs; not being able to resume
fetches of those is unfortunate.

In practice though, I think most people should be using deltas, and we need to
make sure deltas work for large objects anyways.

Further ultimately the peer-to-peer work should help a lot for people
with truly unreliable connections.

Closes: #1176
Approved by: jlebon

8 years agolib/checkout: Do UNION_FILES via atomic renameat()
Colin Walters [Wed, 13 Sep 2017 20:22:18 +0000 (16:22 -0400)]
lib/checkout: Do UNION_FILES via atomic renameat()

I was looking at fixing an `rpm-ostree livefs` bug where we need to replace
`/usr/lib/passwd`. It's obviously bad if that temporarily disappears 😉. My plan
is to do a subpath checkout of just `/usr/lib/{passwd,group}`.

Make this atomic (i.e. file always exists) by changing the logic to create a
temporary link in repo/tmp, then rename() it into place.

A bonus here is we kill one of the very few (only?) non-error-cleanup i.e.
"non-linear" `goto`s in the ostree codebase.

Closes: #1171
Approved by: jlebon

8 years agolib/repo: Port gpg signing function to new code style
Colin Walters [Tue, 12 Sep 2017 20:58:58 +0000 (16:58 -0400)]
lib/repo: Port gpg signing function to new code style

We already had all of the autocleanups ready for this.

Closes: #1164
Approved by: jlebon

8 years agobuild-sys: Post-release version bump
Jonathan Lebon [Thu, 14 Sep 2017 18:53:57 +0000 (18:53 +0000)]
build-sys: Post-release version bump

Closes: #1175
Approved by: cgwalters

8 years agoRelease 2017.11
Colin Walters [Thu, 14 Sep 2017 14:44:04 +0000 (10:44 -0400)]
Release 2017.11

Closes: #1173
Approved by: jlebon

8 years agotests: Port some bits of C to new style
Colin Walters [Wed, 13 Sep 2017 16:09:51 +0000 (12:09 -0400)]
tests: Port some bits of C to new style

Where we can; perhaps after updating libglnx we should use the
new test error macro?

Closes: #1169
Approved by: jlebon

8 years agolib/checkout: Rename disjoint union, change to merge identical files
Colin Walters [Fri, 8 Sep 2017 21:07:45 +0000 (17:07 -0400)]
lib/checkout: Rename disjoint union, change to merge identical files

It turns out that librpm automatically merges identical files between
distinct packages, and this occurs in practice with Fedora today between
`chkconfig` and `initscripts` for exmaple.

Since we added this for rpm-ostree, we basically want to do what librpm does,
let's change the semantics to do a merge.  While we're here rename
to `UNION_IDENTICAL`.

Closes: #1156
Approved by: jlebon

8 years agolib/repo: Port tmpdir locking func to new style
Colin Walters [Tue, 12 Sep 2017 14:31:39 +0000 (10:31 -0400)]
lib/repo: Port tmpdir locking func to new style

Prep for future work.

Closes: #1168
Approved by: jlebon

8 years agobuild-sys: Add -Werror=switch
Colin Walters [Wed, 13 Sep 2017 15:18:04 +0000 (11:18 -0400)]
build-sys: Add -Werror=switch

We use the "exhaustive enum" pattern (i.e. no `default:`) in some places so
we're forced to touch all users when adding cases.

Closes: #1167
Approved by: peterbaouoft

8 years agorepo: Ensure new config doesn't set remotes in separate file
Dan Nicholson [Mon, 11 Sep 2017 17:57:42 +0000 (12:57 -0500)]
repo: Ensure new config doesn't set remotes in separate file

If the new configuration passed to ostree_write_config () tries to
update options for a remote defined in a separate config file, return an
error. Without this, the full configuration would contain duplicate
remote specifications, which would raise an error the next time the repo
is opened.

Closes: #1159
Approved by: cgwalters

8 years agobin/remote: don't load repo on root command
Jonathan Lebon [Mon, 11 Sep 2017 21:06:30 +0000 (21:06 +0000)]
bin/remote: don't load repo on root command

Subcommands will demand a repo argument themselves. This allows one to
call `ostree remote` and get the "No subcommand" error rather than the
"Missing --repo" error.

Closes: #1126
Approved by: cgwalters

8 years agobin/admin: Don't load sysroot for root commands
Jonathan Lebon [Fri, 8 Sep 2017 19:40:59 +0000 (15:40 -0400)]
bin/admin: Don't load sysroot for root commands

There's no need to load the sysroot for root commands which have
subcommands, like `ostree admin` and `ostree admin instutil`. Otherwise,
even just calling them without arguments will cause a failure. The
subcommands will have the appropriate flags set as needed.

Closes: #1126
Approved by: cgwalters

8 years agobin/static-delta: Convert to new style and tweak output
Jonathan Lebon [Tue, 5 Sep 2017 18:27:20 +0000 (14:27 -0400)]
bin/static-delta: Convert to new style and tweak output

Convert the whole file to new style. Also tweak the help outputs to make
it similar enough to the other commands for tests to pass. Of course, we
should just centralize all subcommand handling the same way it was done
in rpm-ostree, though let's punt on that for now.

Closes: #1126
Approved by: cgwalters

8 years agobin/admin: Don't require root for instutil
Jonathan Lebon [Tue, 5 Sep 2017 18:27:20 +0000 (14:27 -0400)]
bin/admin: Don't require root for instutil

Otherwise, we can't even do `--help` on it. The subcommands all already
have the root flag set.

Closes: #1126
Approved by: cgwalters

8 years agotests/test-help.sh: Rework and strengthen checks
Jonathan Lebon [Tue, 5 Sep 2017 18:27:20 +0000 (14:27 -0400)]
tests/test-help.sh: Rework and strengthen checks

The `sed` expression wasn't actually matching the main output, so we
weren't recursing into the subcommands. Update the syntax to match the
current output and add a check so we don't miss that happening again.

Add a check that the help output is only printed once in all
circumstances. Also add a check for proper handling of non-existent
commands.

Closes: #1126
Approved by: cgwalters

8 years agobin/config: Tweak parameter string
Jonathan Lebon [Fri, 1 Sep 2017 19:52:13 +0000 (15:52 -0400)]
bin/config: Tweak parameter string

Make the parameter string more detailed.

Closes: #1126
Approved by: cgwalters