Commit Graph

2826 Commits

Author SHA1 Message Date
Giuseppe Scrivano 47b0b4120a pull: use same name for parameter and documentation comment
Fixes this warning:

src/libostree/ostree-repo-pull.c:2162: Warning: OSTree: ostree_repo_pull_with_options: unknown parameter 'remote_name_or_baseurl' in documentation comment, should be 'remote_name'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #472
Approved by: jlebon
2016-08-27 12:40:46 +00:00
Colin Walters 3ef4cc2e5b lib: Add an API to list only "our" objects, fix prune to use it
When doing a prune, we should not try to delete objects in parent
repos, since it'll fail.  There is a bigger discussion about the
semantics of `parent=` to be had, but this will fix trying to use
`ostree prune --repo=/ostree/repo/extensions/rpmostree/pkgcache`.

Closes: https://github.com/ostreedev/ostree/issues/467

Closes: #471
Approved by: jlebon
2016-08-25 20:01:37 +00:00
Colin Walters 683e060099 repo: Add prefixes to errors for querying size/deleting
I hit these while causing errors in prune.  Let's add the specific
object we were looking for.

Closes: #471
Approved by: jlebon
2016-08-25 20:01:37 +00:00
Colin Walters 05ac14326c pull: Make .commitpartial files world readable
In CentOS, these happened to appear in a repo that is served
via rsync, and having them not be world-readable caused mirroring
tools to fail.

They aren't secret, so don't make them so.

Closes: #468
Approved by: giuseppe
2016-08-25 13:03:16 +00:00
Jonathan Lebon 76166cb52e pull_with_options: fix stray return FALSE
Closes: #465
Approved by: cgwalters
2016-08-18 14:45:01 +00:00
Jonathan Lebon 21d3063fcf pull_with_options: allow GPG verification override
We used to only look at the "gpg-verify" and "gpg-verify-summary"
options when we're passed a local URL. Make these options also have an
effect in the configured remote case.

Closes: #465
Approved by: cgwalters
2016-08-18 14:45:01 +00:00
Jonathan Lebon e005da74ef pull_with_options: fix remote parameter name & desc
Closes: #465
Approved by: cgwalters
2016-08-18 14:45:01 +00:00
Colin Walters 77af6844d8 rofiles-fuse: Rework to be based on nlink
Programs like `useradd` try to `open(/etc/passwd, O_RDWR)` to append,
which didn't work with rofiles-fuse.  Thinking about this, I realized
that there's a simpler algorithm for "can we write to this file" which
is "does it have a hardlink count <= 1"?

Switching to this both drops complexity (we no longer need to keep a
hash table of files we created), and also lets useradd work.

Closes: #462
Approved by: jlebon
2016-08-16 21:22:28 +00:00
Colin Walters 3469161e41 test-rofiles-fuse: Actually check out via hardlinks
The test suite was actually doing something before, just
not quite what I intended.  Without `-U` for bare-user checkouts
we end up doing a copy.

Now, a future commit will change how rofiles work, which would cause
the test suite to permit inplace mutation for non-hardlinked files.
So let's ensure they *are* hardlinked.

Closes: #462
Approved by: jlebon
2016-08-16 21:22:28 +00:00
Colin Walters 3c6d2bc120 fixup! fix typo in docs/manual/atomic-upgrades.md
Closes: #461
Approved by: giuseppe
2016-08-12 21:20:08 +00:00
Colin Walters f9933a2631 prune: Elaborate on what formats are accepted by dates
Inquiring minds want to know.

Closes: #461
Approved by: giuseppe
2016-08-12 21:20:08 +00:00
Adam Miller e5cae81404 fix typo in docs/manual/atomic-upgrades.md
Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

Closes: #460
Approved by: cgwalters
2016-08-12 19:40:53 +00:00
Dan Nicholson b1d13bb356 repo: Really ignore progress changed user data
The documentation says this is ignored, implying that you should pass
NULL to it. However, the function immediately returns in this case even
though the argument isn't used anywhere.

Closes: #458
Approved by: cgwalters
2016-08-12 14:56:07 +00:00
Jonathan Lebon fa59f5adfb manual/repo.md: reword bits about the summary file
Closes: #459
Approved by: cgwalters
2016-08-11 20:58:07 +00:00
Jonathan Lebon 0728304a8a ostree_bootdir: properly preprend $(prefix)
Closes: #457
Approved by: cgwalters
2016-08-11 15:52:28 +00:00
Jonathan Lebon 182cb273c6 ostree_bootdir: prepend $(prefix) to path
Otherwise we break local installs.

Closes: #456
Approved by: cgwalters
2016-08-11 14:37:55 +00:00
Gatis Paeglis fd1a044d6e Move ostree-* executables to /usr/lib/ostree
Why not to use libexecdir?

Because this directory does not exist on some distros or paths
between distros varies. There are several reasons why a well
known path is prefered, for example when generating a kernel
command line:

init=${ostree}/usr/lib/ostree-boot/ostree-prepare-root

In addition this saves us some typing in a console when wanting
to access the "ostree" cmd line.

Closes: #449
Approved by: cgwalters
2016-08-11 14:04:59 +00:00
Dan Nicholson 7ed2f1e5af tests: Test that local pulls do not use deltas
Pulls from local repos now default to disabling static deltas so that
objects are copied. To check this is the case, see if the object files
are hardlinked after pulling.

Closes: #447

Closes: #448
Approved by: cgwalters
2016-08-10 10:54:46 +00:00
Dan Nicholson 1caef17c7f pull: Disable static deltas by default for local pulls
For local pulls there's no benefit pulling the static delta over the
individual object files since there's no HTTP overhead. Furthermore,
processing deltas always generates the objects whereas a standard pull
ensures that the exact object files are copied. Using deltas also
prevents hardlinking the objects if the repos exist on the same
filesystem.

Closes: #447

Closes: #448
Approved by: cgwalters
2016-08-10 10:54:46 +00:00
Dan Nicholson 2a810fbef9 tests: Ensure deltas for pulling when needed
When testing pulling of deltas, use the new --require-static-deltas
option to pull-local to ensure that deltas are actually used. To support
the require-static-deltas mode, the summary in the remote repo must be
generated.

Closes: #447

Closes: #448
Approved by: cgwalters
2016-08-10 10:54:46 +00:00
Dan Nicholson 80c573478b pull-local: Support requiring static deltas
Add the --require-static-deltas option like pull to ensure static deltas
are processed for local pulls.

Closes: #447

Closes: #448
Approved by: cgwalters
2016-08-10 10:54:46 +00:00
Dan Nicholson c3c07a2d49 deltas: Use F_DUPFD_CLOEXEC properly
You need to supply an argument to F_DUPFD_CLOEXEC or fcntl will return
EINVAL. Use 3 as the minimum fd number as is standard.

Closes: #454

Closes: #448
Approved by: cgwalters
2016-08-10 10:54:46 +00:00
Dan Nicholson 1e5ff71c49 deltas: Handle cleanup of fd array properly
If there's an early error, part_temp_fds will be NULL and dereferencing
the len member will segfault.

Closes: #454

Closes: #448
Approved by: cgwalters
2016-08-10 10:54:46 +00:00
Colin Walters 07ec35ef03 libostree.sym: Add 2016.9 section
We should remember to do this in the commit updating configure.ac.

Closes: #453
Approved by: jlebon
2016-08-09 20:00:24 +00:00
Colin Walters 73eabca5e8 Release 2016.8
It's time for a new release, there's enough queued and it's
been ~a month.

Closes: #452
Approved by: jlebon
2016-08-09 19:12:25 +00:00
Colin Walters 56a922280f tests: Port sysroot.js away from libgsystem
My case-sensitive `git grep` didn't find this one originally,
but the Travis+Debian setup was configured to run it.

Closes: #451
Approved by: jlebon
2016-08-09 19:01:35 +00:00
Colin Walters 519292114f travis: Disable email notifications
I'm getting spammed.  We'll see the results in the status.

Closes: #450
Approved by: jlebon
2016-08-09 17:36:39 +00:00
Colin Walters a29bb0ab6b Final excision of libgsystem dependency
Lots and lots of preparation led to this moment - when nothing
apparent changes for users!  Woo!

But seriously, having the extra dependency is a minor annoyance, and
in the big picture I think the libgsystem idea was wrong - we need to
land things in GLib, and use git submodules for API-unstable or
Linux-specific sharing.  For a lot of OSTree, the libgsystem `GFile*`
orientation was also wrong, we really want fd-relative.

Closes: #444
Approved by: jlebon
2016-08-09 15:36:09 +00:00
Colin Walters fd9536bb19 prune: Retain the tip of each ref even with date pruning
I hit an error with [CAHC](https://wiki.centos.org/SpecialInterestGroup/Atomic/Devel)
where we were doing time-based pruning.  `ostree summary -u` started failing,
and it took me a bit to realize it was because we were pruning
even the tip of old branches, which I was not at all expecting,
and I don't think users will too.

Perhaps in the future we could add some sort of --prune-ref-tips or
something if people wanted it, but I doubt it.

Closes: #445
Approved by: jlebon
2016-08-09 15:12:35 +00:00
Colin Walters 056cc0543f build: Update .gitignore
The patch to add more symlink bits also needed CLEANFILES updates.

Closes: #446
Approved by: jlebon
2016-08-09 14:41:07 +00:00
Colin Walters d238683332 deploy: Use internal recursive copy rather than libgsystem
Since we already had a "recursive copy" implementation here, let's
reuse it rather than the libgsystem `gs_shutil_cp_a()`.  Part of the
libglnx porting.

Closes: #428
Approved by: jlebon
2016-08-08 14:16:34 +00:00
Colin Walters 686d0352e1 deploy: Port file copying code to GLnxDirFdIterator
It handles ownership of the `DIR*` for us more cleanly, and
is just a better API.

This is in preparation for further changes to this code to do SELinux
labeling while copying.

Closes: #428
Approved by: jlebon
2016-08-08 14:16:34 +00:00
Colin Walters 8dab17f6db repo: Fix an uninitialized variable
Closes: #431
Approved by: giuseppe
2016-08-08 11:13:06 +00:00
Colin Walters e7b3cf9850 build: Make -Werror=int-conversion fatal
This should hopefully avoid me accidentally passing NULL for an `int`
file descriptor in the future.

Closes: #431
Approved by: giuseppe
2016-08-08 11:13:06 +00:00
Colin Walters 76d6afa707 build: Import attributes.m4, detect CFLAGS at build time
I want to add `-Werror=int-conversion`, but it's only available in
newer GCC versions.  So let's start autodetecting available compiler
flags.

Closes: #431
Approved by: giuseppe
2016-08-08 11:13:06 +00:00
Colin Walters 6b089304bf repo: Drop more internally unused GFile members
I forgot to actually remove `config_file` in the previous
commit, the txn lock hasn't been used in a long time, and
for the uncompressed cache, everything uses the fd already.

Closes: #433
Approved by: giuseppe
2016-08-08 08:31:59 +00:00
Simon McVittie 46e118ee84 travis: run the test suite on various distributions
.travis.yml is obviously still Travis-specific, but tests/ci-* are
designed to be shareable with other CI environments if there is interest
in doing so.

At the moment I'm only testing on Debian and Ubuntu. In principle we
could try a non-Debian-derived Docker container such as Fedora or CentOS
inside travis-ci's Ubuntu environment, similar to what I'm doing
for Debian, but I don't know the correct setup commands to use there.

Closes: #438
Approved by: cgwalters
2016-08-05 23:58:19 +00:00
Colin Walters 704c7e57fa .travis.yml: Delete, we aren't using it right now
@smcv will re-add a new version.

Closes: #439
Approved by: smcv
2016-08-05 20:50:43 +00:00
Simon McVittie 0de51bfc45 Skip tests that use whiteouts under Docker/aufs
ostree's naming convention for whiteouts is similar to what is
done in aufs, which means we can't compose the trees to test this
feature under Docker with the aufs storage driver, as used on
travis-ci.

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

Closes: #437
Approved by: cgwalters
2016-08-05 20:32:57 +00:00
Simon McVittie 64e4525793 Update libglnx: Add missing files to libglnx distribution
This fixes distcheck.

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

Closes: #436
Approved by: cgwalters
2016-08-05 19:41:09 +00:00
Colin Walters d55655b096 repo: Drop internal GFile config_file
The remote parsing code still uses GFiles but this is a start.

Closes: #432
Approved by: giuseppe
2016-08-05 08:26:07 +00:00
Colin Walters 18a576c390 lib: Drop GFiles for self->{objects_dir,state_dir}
Everything that used to reference these is now fd-relative.

Closes: #432
Approved by: giuseppe
2016-08-05 08:26:07 +00:00
Colin Walters 308c75e281 repo: Port metadata writing code to fd-relative
It was the last thing referencing `self->objects_dir`.

Closes: #432
Approved by: giuseppe
2016-08-05 08:26:07 +00:00
Colin Walters cfd402e5f7 lib: Fix a compiler warning introduced from earlier patch
I think we'd end up closing stdin...yuck.  Need to investigate
having this be fatal, but CentOS 7 `gcc-4.8.5` doesn't understand
`-Werror=int-conversion`.

Closes: #430
Approved by: giuseppe
2016-08-05 07:38:09 +00:00
Colin Walters 30aa1ec668 lib: Use libglnx file replace API more consistently
We have a better API now, drop use of the internal helper, which also
depended on libgsystem.

This required bumping libglnx to pull in a fix.

Closes: #429
Approved by: giuseppe
2016-08-04 21:27:32 +00:00
Colin Walters 1ce633f158 Update libglnx for O_TMPFILE build time option
See: https://github.com/ostreedev/ostree/issues/421

Closes: #426
Approved by: gatispaeglis
2016-08-04 13:30:55 +00:00
Colin Walters 593effe2fb lib: Add padding booleans to OstreeRepoCheckoutAtOptions
Since this is a new API, and adding booleans is the most likely thing
we'll do, let's stick some explicit padding for them in here now.

We could use the `unused_ints[]` but it'd be out of order, and this
will more clearly remind people about the padding.  The efficiency hit
versus bitfields is annoying, but oh well, not a real world problem.

Closes: #427
Approved by: giuseppe
2016-08-04 12:18:28 +00:00
Colin Walters 18d826e3a5 repo: Flip the fsync default to off for new checkout API
Since we're adding a new API, we have the opportunity to fix
the defaults.  We expect clients to do a `syncfs()` or equivalent
on their own now, since it's way more efficient.

Flip the checkout fsync default to off.

Closes: #425
Approved by: giuseppe
2016-08-04 07:33:31 +00:00
Colin Walters f66906c401 deltas: Port compilation to libglnx/fd-relative
This was the last use of libgsystem tmpfile APIs.  The change here is
a bit uglier than it needs to be because we support creating the delta
in place as well as in the repo, so we needed to abstract over
locations.

Closes: #424
Approved by: giuseppe
2016-08-03 08:10:27 +00:00
Colin Walters a843d16de2 grub2: Port away from gs_file_sync_data()
Inlining this is uglier, but this code kind of sucks anyways =( We're
going to need to do some fd-relative porting in here at some point.

Closes: #424
Approved by: giuseppe
2016-08-03 08:10:27 +00:00