Commit Graph

4388 Commits

Author SHA1 Message Date
Simon McVittie 3ea61499e8 Fix incorrect type aliasing that caused assertion failures on 64-bit big-endian platforms
Closes: #902209
2018-06-24 13:04:03 +01:00
Simon McVittie d0e6bd9bb7 Mark patch as applied upstream 2018-06-23 16:44:05 +01:00
Simon McVittie 3f99d2addb d/p/avahi-Fail-immediately-if-we-can-t-talk-to-D-Bus-or-Avahi.patch: Mark as forwarded 2018-06-23 13:15:47 +01:00
Simon McVittie 4fc5a4a8d7 2018.6-2 2018-06-23 12:37:48 +01:00
Simon McVittie f5154b48d3 Apply patch from upstream to fix FTBFS on 32-bit architectures
Closes: #902194
2018-06-23 12:37:22 +01:00
Simon McVittie 554618ea51 2018.6-1 2018-06-22 21:25:36 +01:00
Simon McVittie 3c2ac78c0c Add patch to avoid Flatpak test failures
Without this, we get test failures with this ostree if Avahi (or
dbus-daemon --system) is not available on the build/test system.
2018-06-22 01:12:19 +01:00
Simon McVittie 570aeab901 Bump minimum versions for recently-exported symbols 2018-06-21 22:53:10 +01:00
Simon McVittie d01671aac6 d/copyright: Update more 2018-06-21 22:51:50 +01:00
Simon McVittie 3f6208773a New upstream release 2018-06-21 22:51:17 +01:00
Simon McVittie 2932f407c9 Set git branch back to debian/master 2018-06-21 22:51:10 +01:00
Simon McVittie a3efe907cd Merge branch 'upstream/latest' into debian/master 2018-06-21 19:21:40 +01:00
Simon McVittie 8bace1be73 Merge branch 'debian/experimental' into debian/master 2018-06-21 19:21:34 +01:00
Simon McVittie 8125d7d0dd New upstream version 2018.6 2018-06-21 19:16:18 +01:00
Colin Walters 31a356dca9 Release 2018.6 2018-06-19 15:48:14 -04:00
Colin Walters 0f88a2a72d tests/installed: Add a free-space success path test
We implicitly test the success percent path a lot, but not the
absolute path.

Closes: #1632
Approved by: jlebon
2018-06-19 18:29:31 +00:00
Colin Walters 5e9d382811 lib/repo: Do free space math under lock in error path
We were referencing the txn bits outside of the lock in the error
path. Generally shouldn't matter, but e.g. Rust wouldn't let us do this, and
race detector tooling will warn about it.

Closes: #1632
Approved by: jlebon
2018-06-19 18:29:31 +00:00
Colin Walters acab2c1ac6 lib/repo: Rename free_space_size variable to free_space_mb
I generally like having variables include their units where applicable;
timer variables having `_secs` or `_ms`, etc.

Closes: #1632
Approved by: jlebon
2018-06-19 18:29:31 +00:00
Colin Walters a2b08f9342 lib/repo: Fix double-set-error in min-free-space-size code
We need to pass `NULL` as the error, we only care if the key exists;
otherwise we'll try to set the error twice.

Closes: #1632
Approved by: jlebon
2018-06-19 18:29:31 +00:00
Colin Walters cc5254ac34 lib/archive: Tell g-ir-scanner to ignore the private libarchive bits
Squashes this warning:
```
src/libostree/ostree-libarchive-private.h:46: syntax error, unexpected typedef-name in '  g_autoptr(OtAutoArchiveRead) a = archive_read_new ();' at 'OtAutoArchiveRead'
```

Closes: #1629
Approved by: jlebon
2018-06-18 16:40:39 +00:00
Dan Nicholson ce58307757 deploy: Delete .updated file from /etc and /var on new deployments
Systemd units using ConditionNeedsUpdate run if the mtime of .updated in
the specified directory is newer than /usr. Since /usr has an mtime of
0, there's no way to have an older .updated file. Systemd units
typically specify ConditionNeedsUpdate=/etc or ConditionNeedsUpdate=/var
to support stateless systems like ostree.

Remove the file from the new deployment's /etc and the OS's /var
regardless of where they came from to ensure that these systemd units
run when booting new deployments. This will provide a method to run
services only on upgrade.

Closes: #1628
https://bugzilla.gnome.org/show_bug.cgi?id=752950

Closes: #1631
Approved by: cgwalters
2018-06-18 13:21:52 +00:00
Matthew Leeds 7dc3e45b3a lib/prune: Don't modify dirent->d_name in place
Currently when I run `ostree prune` it hits a seg fault when the
hash_func is used (in this case g_str_hash) from the call stack
_ostree_repo_prune_tmp() -> g_hash_table_contains() ->
g_hash_table_lookup_node(). So the key, in this case dent->d_name, must
be corrupt in some way.

glnx_dirfd_iterator_next_dent() uses readdir() to get the dirent struct.
And according to the man page for readdir(3), "POSIX.1 explicitly notes
that this field should not be used as an lvalue" (in reference to
d_name). So this commit avoids modifying d_name in place and copies it
instead. This seems to avoid the seg fault.

Closes: #1627
Approved by: jlebon
2018-06-15 19:01:46 +00:00
Alexander Larsson 677e181025 ostree_repo_resolve_rev: Resolve refs set in the transaction
This allows you to get at the current commit for a ref pending in the transaction.

Closes: #1624
Approved by: cgwalters
2018-06-14 17:58:47 +00:00
Philip Withnall 2d2f218669 lib/repo-commit: Delay propagation of errors from abort_transaction()
If there’s a problem while aborting a transaction, store the error but
don’t report it until the end of the function — do a best effort at
clearing the rest of the transaction state first (since most of it
cannot fail).

If cleanup_tmpdir() fails (which, arguably, should not be a
showstopper), this allows a caller to recover and start a new
transaction in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1626
Approved by: jlebon
2018-06-14 17:13:43 +00:00
Umang Jain 31809d32f2 lib/repo: Add min-free-space-size option
Similar to min-free-space-percent but it supports specific sizes
(in MB, GB or TB). Also, making min-free-space-percent and -size
mutually exclusive.

min-free-space-percent does not give a fine tuning of the free disk
space that a user might decide to keep. It can translate to very large
size (e.g. 1% = ~10GB on 1TB HDD) or very small (e.g. 1% = ~330MB on 32GB
system like Endless devices). Hence, it makes sense to introduce a config
option to honor specific size as per the user.

Closes: #1616
Approved by: jlebon
2018-06-13 18:57:37 +00:00
Matthew Leeds c767f7b739 admin: Fix list of subcommands in help and manpage
This adds subcommands that were missing from the ostree-admin man page,
and makes cosmetic fixes there and in the --help output to ensure
alphabetical order and remove trailing whitespace.

Closes: #1621
Approved by: jlebon
2018-06-12 14:36:24 +00:00
Simon McVittie 3768e58715 2018.5-2 2018-06-10 13:57:33 +01:00
Simon McVittie 31d1b1ecce d/tests/gnome-desktop-testing: Skip libostree/test-concurrency.py.test
It does not appear to be completely reliable. (See #901170)
2018-06-10 13:57:07 +01:00
Simon McVittie da28448005 d/rules: Explicitly enable various desired libraries 2018-06-08 10:43:11 +01:00
Simon McVittie 192e0d9740 New upstream git snapshot
* New upstream git snapshot with support for peer-to-peer software
  collections, required by Flatpak's peer-to-peer app sharing feature
  - d/copyright: Update
  - d/libostree-1-1.symbols: Update
  - Build-depend on Avahi libraries
2018-06-08 10:18:20 +01:00
Simon McVittie 1e3c3827f0 Update upstream source from tag 'upstream/2018.5+42+gecdebeb2'
Update to upstream version '2018.5+42+gecdebeb2'
with Debian dir 90df558038
2018-06-08 09:11:15 +01:00
Simon McVittie f92733af4a New upstream version 2018.5+42+gecdebeb2 2018-06-08 09:11:07 +01:00
Simon McVittie fcb8f45f70 Switch to experimental branch 2018-06-08 09:10:41 +01:00
Jonathan Lebon ecdebeb20e switchroot: Allow letting ostree-prepare-root mount /var
In some scenarios, it might make sense to let `ostree-prepare-root` do
the `/var` mount from the state root as before. For example, one may
want to do some system configuration before the switch root. This of
course comes at the expense of supporting `/var` as a mount point in
`/etc/fstab`.

Closes: #1617
Approved by: cgwalters
2018-06-07 21:41:32 +00:00
Matthew Leeds 6f3b5620de tests: Add test for including ostree.h
Closes: #1615
Approved by: jlebon
2018-06-07 17:28:49 +00:00
Matthew Leeds 6ea21696a3 Fix building against old glib versions
We need to include libglnx.h in places where ostree-autocleanups.h is
included, so that we get backports of G_DEFINE_AUTOPTR_CLEANUP_FUNC and
friends.

Closes: #1615
Approved by: jlebon
2018-06-07 17:28:49 +00:00
Matthew Leeds 1d830c1792 Revert "lib: Fix building against old glib versions"
This reverts commit f1d9196076.

Since libglnx.h does not get installed, it can't be included in
ostree-autocleanups.h, which is included by ostree.h.

Closes: #1615
Approved by: jlebon
2018-06-07 17:28:49 +00:00
Matthew Leeds 8fbf19c9f5 Make P2P API public (no longer experimental)
Currently the API that allows P2P operations (e.g. pulling an ostree ref
from a LAN or USB source) is hidden behind the configure flag
--enable-experimental-api. This commit makes the API public and makes
that flag essentially a no-op (leaving it in place in case we want to
use it again in the future). The P2P API has been tested over the last
several months and proven to work.

This means that since we're no longer using the "experimental" feature
flag, P2P builds of Flatpak will fail when using versions of OSTree from
this commit onwards, until Flatpak is patched in the near future. If you
want to build Flatpak < 0.11.8 with P2P enabled and link against OSTree
2018.6, you'll have to patch Flatpak.  However, since Flatpak won't yet
have a hard dependency on OSTree 2018.6, it needs a new way to determine
if the P2P API in OSTree is available, so this commit adds a "p2p"
feature flag. This way the feature set is more semantically correct than
if we had continued to use the "experimental" feature flag.

In addition to making the P2P API public, this commit makes the P2P unit
tests run by default, removes the f27-experimental CI instance that's no
longer needed, changes a few man pages to reflect the changes, and
updates the bash completion script to accept the new commands and
options.

Closes: #1596
Approved by: cgwalters
2018-06-04 19:20:10 +00:00
Matthew Leeds f1d9196076 lib: Fix building against old glib versions
This commit includes libglnx.h in ostree-autocleanups.h, so we get the
g_autoptr backports wherever they're needed. Also, remove the "#include
libglnx.h" lines elsewhere that are no longer needed.

Closes: #1596
Approved by: cgwalters
2018-06-04 19:20:09 +00:00
Jan Tojnar f200efdb8a tests: Fix locale detection
When a locale with C.utf8 in its name (e.g. es_EC.utf8) was installed
on a system, the C.utf8 locale was chosen, even when it was not available.

This patch fixes the grep pattern to match whole lines returned by locale -a.

See: #1592

Closes: #1611
Approved by: cgwalters
2018-06-03 21:25:07 +00:00
Matthew Leeds bf3525adcb ci: Use master branch as flatpak tag
Closes: #1607
Approved by: jlebon
2018-05-31 19:27:04 +00:00
Matthew Leeds 6a7620b58d ci: Bump flatpak build to F28
Closes: #1607
Approved by: jlebon
2018-05-31 19:27:04 +00:00
Philip Withnall bf1af263d6 lib/repo-pull: Support retries for delta superblocks
Use the recently introduced architecture for retrying network requests
on transient failure to do the same for delta superblock requests, now
that they’re queued.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1600
Approved by: jlebon
2018-05-30 19:57:13 +00:00
Philip Withnall f342e66c11 lib/repo-pull: Support queuing delta superblock requests
Just like all the other requests made for delta parts and objects by the
pull code, use a queue for delta superblocks. Currently this doesn’t do
any prioritisation or retries after transient failures, but it could do
in future.

This means that delta superblocks are now subject to the parallel
request limit in the fetcher, which was a problem highlighted here:
https://github.com/ostreedev/ostree/pull/1453#discussion_r168321706.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1600
Approved by: jlebon
2018-05-30 19:57:13 +00:00
Philip Withnall 197644c406 lib/fetcher: Factor out HTTP status code handling from soup and curl
Use the same G_IO_ERROR_* values for HTTP status codes in both fetchers.
The libsoup fetcher still handles a few more internal error codes than
the libcurl one; this could be built on in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
2018-05-30 16:23:57 +00:00
Philip Withnall 78f40136db lib/repo-pull: Add some missing assertions for progress statistics
Various of the counters already have assertions like this; add some more
for total paranoia.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
2018-05-30 16:23:57 +00:00
Philip Withnall c9619a4904 tests: Test pull behaviour when network timeouts occur
Extend test-pull-repeated.sh to test error 408 as well as error 500, to
ensure that the new retry-on-network-timeout code in ostree-repo-pull.c
correctly retries.

Rather than the 200 iterations needed for the error 500 tests, only do 5
iterations. The pull code internally does 5 retries (by default), which
means a full iteration count of 25. That seems to be sufficient to make
the tests reliably pass, in my testing — we can always bump it up to 200
/ 5 = 40 in future if needed (to put it in parity with the error 500
tests).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
2018-05-30 16:23:57 +00:00
Philip Withnall 97c348d65b ostree/trivial-httpd: Add --random-408s command line option
This is exactly like the --random-500s option, except that it will cause
error 408 (request timeout) to be returned, rather than error 500
(internal server error).

This will be used in a following commit to test pull behaviour when
timeouts occur.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
2018-05-30 16:23:57 +00:00
Philip Withnall 224f3cdd24 lib/fetcher-soup: Map more SoupStatus codes to known GIOErrors
This allows the retry code in ostree-repo-pull.c to recover from (for
example) timeouts at the libsoup layer in the stack, as well as from the
GSocket layer in the stack.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
2018-05-30 16:23:57 +00:00
Philip Withnall 938055392f lib/repo-pull: Support retrying requests on transient network errors
Allow network requests to be re-queued if they failed with a transient
error, such as a socket timeout. Retry each request up to a limit
(default: 5), and only then fail the entire pull and propagate the error
to the caller.

Add a new ostree_repo_pull_with_options() option, n-network-retries, to
control the number of retries (including setting it back to the old
default of 0, if the caller wants).

Currently, retries are not supported for FetchDeltaSuperData requests,
as they are not queued. Once they are queued, adding support for retries
should be trivial. A FIXME comment has been left for this.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1594
Approved by: jlebon
2018-05-30 16:23:57 +00:00