Commit Graph

84 Commits

Author SHA1 Message Date
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 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
Jonathan Lebon f3cbe86117 libglnx: bump to latest
OSTree can sometimes print very long lines which lead to many empty
spaces getting printed if the output overflowed the line due to a bug in
libglnx.

Reported-by: Gatis Paeglis <gatis.paeglis@qt.io>

Closes: #406
Approved by: cgwalters
2016-07-22 13:44:19 +00:00
Simon McVittie 24762929e2 Imported Upstream version 2016.6 2016-06-26 12:12:26 +01:00
Yu Qi Zhang 30c34b2f55 libglnx porting: delete temp files on failure of file creation
We noticed the temp files being left over in ostree when (mistakenly)
trying to create refs with names in use by folders. This fix removes
temp files created by glnx_file_replace_contents_at on failure.

Closes: #348
Approved by: cgwalters
2016-06-16 19:18:47 +00:00
Colin Walters 24cb0ffc6a core: Port to new libglnx tempname API
Drops another libgsystem use, and as bonus we malloc less too.

Closes: #311
Approved by: jlebon
2016-05-31 18:08:46 +00:00
Colin Walters 6724519080 libglnx porting: Migrate to glnx_stream_fstat()
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.

Closes: #282
Approved by: jlebon
2016-05-06 14:29:59 +00:00
Colin Walters a6c731f6e7 libglnx porting: Migrate from GSConsole
To GLnxConsoleRef.  There were some subtleties here, for example we
used to reference `GSConsole` inside the progress changed function,
which at first seems like an ABI hazard, because e.g. rpm-ostree or
xdg-app could still be passing a `GSConsole` instance there.  Luckily,
it turns out to be compatible to just start calling libglnx here.

Another issue was that due to libglnx's use of the cleanup function,
we needed to ensure we always called `ostree_async_progress_finish()`
*before* the cleanup function was invoked.

Closes: #280
Approved by: giuseppe
2016-05-02 11:41:00 +00:00
Simon McVittie 67e83bd769 Imported Upstream version 2016.3 2016-03-11 08:08:04 +00:00
Colin Walters ca57ec4aa5 repo: Port -refs.c to openat()
I'd like to incrementally convert all of `ostree-repo*.c` to
fd-relative usage, so that we can sanely introduce
`ostree_repo_new_at()` which doesn't involve GFile.

This one is medium risk, but passes the test suite.
2016-01-28 14:57:13 -05:00
Simon McVittie 62a4fef292 Imported Upstream version 2016.1 2016-01-27 12:31:07 +01:00
Alexander Larsson 211ca6795c Update to latest libglnx 2015-12-14 08:37:17 +01:00
Matthew Barnes 70e121c159 glnx: Update from master
More autocleanup backports, this time GFileOutputStream.
2015-11-23 14:49:06 -05:00
Matthew Barnes 3267267115 libglnx: Update from master
Pick up PATH change for glnx_libcontainer_run_chroot_private().
2015-09-16 14:19:05 -04:00
Colin Walters 2dfe24632a sysroot: Add a try_lock() API
The blocking locking API wasn't sufficient for use in the rpm-ostree
daemon; it really wants to know if the lock is held, then continue to
do other things (like service DBus requests), and get notification
when the lock is available.

We also add an async variant that can be called if the lock is not
available.

Implement a higher level "loop until lock is available" method in the
`ostree admin` commandline.
2015-05-10 16:20:53 -04:00
Matthew Barnes e0f066e9c2 libglnx: Pick up bugfix and backports
Need more autocleanup backports for GIO types.
2015-05-06 10:28:31 -04:00
Giuseppe Scrivano 9fa10e69f9 libglnx: fix reference to commit
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-05-05 16:23:51 +02:00
Colin Walters 9ef98fd05a sysroot: Add an API to lock
If a system administrator happens to type `ostree admin upgrade`
multiple times, currently that will lead to a potentially corrupted
system.

I originally attempted to do locking *internally* in `libostree`, but
that didn't work out because currently a number of the commands
perform multi-step operations that all need to be serialized.  All of
the current code in `ostree admin deploy` is an example.

Therefore, allow callers to perform locking, as most of the higher
level logic is presently implemented there.

At some point, we can revisit having internal locking, but it will be
difficult.  A more likely approach would be similar to Java's approach
with concurrency on iterators - a "fail fast" method.
2015-05-05 08:52:44 -04:00
Matthew Barnes 33b0667597 Fix build when using GLib < 2.44 2015-05-04 12:02:02 -04:00
Colin Walters e0b73d0742 deploy: Drop a fsync, use fd-relative APIs
Now that we can rely on `syncfs()`, drop another fsync in the deploy
path.  While we're here, convert it to fd-relative.
2015-04-20 21:03:23 -04:00
Colin Walters 45406bf815 deploy: Drop fsync of modified config files
These fsyncs were added for what turned out to be a fairly bogus
reason; I was hitting read errors from extlinux after upgrades and out
of conservatisim tried adding fsync calls, but the *actual* problem
was that extlinux didn't support 64 bit ext4.  Now that at least for
Project Atomic hosts we're just targeting grub2, we can drop these
fsync calls and rely on `syncfs()` being both faster and catching any
errors.
2015-04-20 21:03:23 -04:00
Colin Walters 02b3a81d11 libglnx: Update from master
No real changes, but I'd like to use some of the new APIs later.
2015-04-17 16:15:55 -04:00
Colin Walters e5e0b95e27 libglnx: Update to latest
This pulls in more fixes for writes.
2015-04-14 15:53:51 -04:00
Matthew Barnes 79e28a13a3 libglnx: Pick up file permission regression fix
https://bugzilla.gnome.org/747813
2015-04-14 08:49:18 -04:00
Colin Walters 1892a6fe13 refs: Use *at for writes, honor repo fsync flag
I was looking at https://bugzilla.gnome.org/show_bug.cgi?id=738954
which wants us to ensure we chown() the refs.  As part of that,
I did a generic conversion to use `*at()` (which naturally gives
us more low level control so we can call `fchown` etc.

This patch also sneaks in a change to respect the repo's
`disable_fsync` flag - if fsync is not set, then we never
`fdatasync()` (unlike the `g_file_replace_contents()` default.  Also
unlike it, if fsync is enabled, we *always* sync even if the file
didn't exist.
2015-04-13 08:47:05 -04:00
Daniel Svensson 534c4c20c3 build: Use glibc's xattr support instead of requiring libattr
Fixes the build on Debian, and is one library less.

Closes: #78
2015-04-01 06:35:53 -04:00
Colin Walters b11d0e5f52 libglnx: Update to latest
Just on general principle.  Newer is better.
2015-03-20 10:56:45 -04:00
Colin Walters 40385c9874 glnx: Update 2015-03-09 21:25:06 -04:00
Colin Walters a282f94f5d sysroot: Make origin parsing code fd-relative
Just more API conversion.
2015-03-09 14:29:14 -04:00
Colin Walters 488efac728 repo: Port hardlink-scanning code to fd-relative calls
Continuing the migration.
2015-03-03 11:48:41 -05:00
Colin Walters 5b3a495018 deploy: Use glnx file copy code
This is centralizing more generic utility code in libglnx.
2015-03-03 11:48:41 -05:00
Colin Walters 474b071055 libglnx: Use git.gnome.org's copy
Not the master from my laptop.
2015-02-22 22:30:53 -05:00
Colin Walters 965a304a17 Use libglnx
Starting down the path of not using libgsystem.  The main win here
will be code sharing between ostree/rpm-ostree as well as going down
the path of not using GFile * for local files.
2015-02-22 21:02:27 -05:00