Commit Graph

1181 Commits

Author SHA1 Message Date
Colin Walters
cc4844ff02 daemon/upgrader: Clear core ctx after committing
Amazingly we had 3 variations of this bug in the different
layers above using the `RpmOstreeContext` API (in compose, container,
and layering).

We fixed the first two already, this fixes the last one.  We
get a warning if librpm holds a ref to a deleted rpmdb.

Closes: https://github.com/projectatomic/rpm-ostree/issues/987

Closes: #994
Approved by: jlebon
2017-09-15 14:17:59 +00:00
Colin Walters
4a9aebcc02 core: Don't search for base filetriggers if no base rpmdb
Otherwise librpm whines on stderr about a missing database.

Related: https://github.com/projectatomic/rpm-ostree/issues/987

Closes: #989
Approved by: jlebon
2017-09-15 12:03:12 +00:00
Colin Walters
c30e63f283 compose: Clear libdnf context before postprocessing
This ensures we close the rpm database before we start moving
things around during postprocessing, and avoids a warning about
the rpmdb going missing being printed at the end of a compose.

Related: https://github.com/projectatomic/rpm-ostree/issues/987

Closes: #989
Approved by: jlebon
2017-09-15 12:03:12 +00:00
Ruixin
56ef177235 tests/core: allow merging identical files during installation
This PR uses https://github.com/ostreedev/ostree/pull/1156
to ensure that when installing packages containing files with
exact same content, the files will be merged.

When installing packages containing conflicting files,
the error will still be detected at the ostree side.

The checkout overwrite option at rpm-ostree side is also
modified to accomodate the changes made in ostree side.

A test is added for regression
2017-09-13 20:41:15 +00:00
Jonathan Lebon
f62f6b7086 livefs: tweak warning re. /etc
Be more explicit about what the warning means.

Closes: #988
Approved by: dustymabe
2017-09-13 13:51:06 +00:00
Jonathan Lebon
2a5ecf7a3e livefs: add warning that /etc won't be preserved
Since the whole premise of livefs is that you stay in your deployment
just a little longer, it becomes much more likely for people to run into
https://github.com/projectatomic/rpm-ostree/issues/40 (myself included).

Printing such a notice was discussed in the initial livefs design
discussions: https://github.com/projectatomic/rpm-ostree/issues/639.

Closes: #986
Approved by: cgwalters
2017-09-12 19:51:48 +00:00
Jonathan Lebon
4ad3ea58c6 app: smarter deployment change detection
Commands like `upgrade` and `deploy` need to know if a new deployment
was actually laid down so that it may print a pkg diff if so. This is
implemented by listening for changes to the DefaultDeployment D-Bus
property. D-Bus emits a signal when the deployment variant changes
value.

However, in #595, with the introduction of `pending-*` related keys, the
deployment variant no longer represents data solely tied to that
specific deployment. In this case, because `deploy` operations currently
set the ref to the resolved checksum, it can happen that deploying the
same base commit when the current refspec *isn't* pointing to that base
commit will result in the `pending-*` keys dropping out and a default
deployment change notification going out.

In this patch, we strengthen how we determine whether a new deployment
was laid down by actually looking at the deployment id, rather than just
assuming that a change to the property implies a new deployment.

Closes: #981

Closes: #984
Approved by: cgwalters
2017-09-12 17:23:25 +00:00
Jonathan Lebon
077d7c1a9e daemon/deploy: allow redeploying livefs booted commit
Also something I noticed while working on #981. When sitting on a livefs
commit, once a user does `rpm-ostree cleanup --pending --rollback`, it's
impossible to redeploy the same booted commit. Let's allow users to do
this.

Closes: #984
Approved by: cgwalters
2017-09-12 17:23:25 +00:00
Jonathan Lebon
c08ca8f922 daemon/upgrader: make use of override-commit-ids
Currently, when setting the `override-commit` key in the origin, the
upgrader pulls that commit checksum directly and then updates the
refspec to point to it. This behaviour was inherited from its ostree
version; at the time it was implemented, the pull code didn't support
passing a specific commit for a given refspec. However, we now have
the override-commit-ids option, which will make libostree update the ref
for us.

We change the code here to make use of it and simplify the function.
This also fixes the corner case of local branches: we shouldn't change
the ref if we're on a local branch. This is actually what drove me to
this patch as I was debugging #981.

(Aside: I'm still not convinced updating the refspec is always the
correct thing to do even in the remote case, though it's a bit messy to
disentangle).

Closes: #984
Approved by: cgwalters
2017-09-12 17:23:25 +00:00
Colin Walters
f113fc5e27 Rework treecompose kernel processing
Prep for changing `boot_location: new` to use `/usr/lib/ostree-boot`
and `/usr/lib/modules`.  Rework our kernel postprocessing
so that we unify the `boot_location` handling with initramfs generation.

Instead of doing the initramfs first in postprocessing, we do it nearly last,
after e.g. `etc` is renamed to `usr/etc`. This has some consequences, such as
the fact that `run_bwrap_mutably()` is now called in both situations. In
general, our handling of `etc` is inconsistent, although understandably so.

As part of this, I finally got around to implementing the bit from
https://github.com/systemd/systemd/pull/4174 however suboptimal it is; need the
unified core so we can cleanly ignore the posttrans like we do others.  We
intentionally keep the file around in the generated tree so that installing a
kernel RPM per client doesn't try to do any of this either.

This all gets folded together so that the logic for handling the bootloader gets
simpler - in the Fedora case, we now know to find kernels in `/usr/lib/modules`
and can ignore `/boot`.

Closes: #959
Approved by: jlebon
2017-09-12 14:26:44 +00:00
Colin Walters
3ff48589b3 compose: Make boot_location: legacy be an alias for both
We have 3 locations to find kernels now; I can't think of
a reason to support placing kernels *only* in `/boot`.  The
original commit
15ecaacd36
doesn't give a reason, and I certainly can't think of one now.

This makes `legacy` be an alias for `both`, which should be fully compatible.

Prep for further refactoring towards changing `new` to mean both
`/usr/lib/ostree-boot` *and* `/usr/lib/modules`.

Closes: #959
Approved by: jlebon
2017-09-12 14:26:44 +00:00
Jonathan Lebon
bae4faea2b app/upgrade: use signal to determine if changed
Make `upgrade` use the same trick as `deploy` to determine if a new
deployment was laid down. Apart from those two, all other operations
that can lay down a new deployment always do so in the happy path.

Prep for further work.

Closes: #983
Approved by: cgwalters
2017-09-11 18:38:43 +00:00
Jonathan Lebon
df515fd2f1 app/libbuiltin: convert to new style
Pretty straightforward stuff. Prep for further work.

Closes: #983
Approved by: cgwalters
2017-09-11 18:38:43 +00:00
Colin Walters
150de0087e scripts: Support overriding lua, use for glibc-all-langpacks
Today in Fedora the `glibc-all-langpacks.posttrans` is implemented
in lua, for no good reason.  See:
https://bugzilla.redhat.com/show_bug.cgi?id=1367585

Since that's stalled out, let's add support for overrides.  This
is obviously a much bigger step with more long term maintenance
implications over our current "ignore scripts" list.  But we can't
block either.

This is needed for unified core work:
https://github.com/projectatomic/rpm-ostree/issues/729

(We also override `fedora-release-atomichost` but I'll likely
 submit a patch for that upstream)

Closes: #980
Approved by: jlebon
2017-09-08 18:02:22 +00:00
Colin Walters
e40eaebbe0 core: Use fd-relative access to rpmdb
I was linking to this code from elsewhere and noticed that
for our hardlink breaks we were not using fd-relative even
though we can.  Down the line if we fork librpm into a separate
process and do e.g. `--dbpath=.` it'll do it too.

(Side note, I verified that commenting out the hardlink breaking
 here was caught by the `ostree fsck` I added to the test suite)

Closes: #979
Approved by: jlebon
2017-09-07 22:54:40 +00:00
Colin Walters
38d1876270 Update libglnx, do some fstatat-noent porting
Started on porting to the new `glnx_fstatat_allow_noent()`.  The
usage varies a lot and it felt easy to screw up, so I'm just
starting by doing a few of them.

Update submodule: libglnx

Closes: #978
Approved by: jlebon
2017-09-07 22:30:34 +00:00
Colin Walters
79086f8c3d core: Use a single tmpdir/ostreetxn for relabeling
I'd like to cut down on the number of tempdirs we make; when
debugging with gdb I often use e.g. `r` to restart forcibly, and
that leaves the dirs around.

Previously we'd make a tmpdir per relabeled package; this hoists it into a
well-known "relabel/" subdir of the per-core tmpdir we make. (A next step here
is to dedup the core tmpdir with the tmpdir that the upgrader makes)

Further while I'm here, let's use a single OSTree transaction for all of the
relabeling; the rationale here is that it's better to do fewer `syncfs()`
operations.

Closes: #970
Approved by: jlebon
2017-09-07 19:04:08 +00:00
Colin Walters
b5c98ec4f1 daemon: Add a policy for reload-config
This fixes `rpm-ostree reload` as root, and supports configuring
it to be enabled for other users as well.  This was overlooked
in the polkit work originally.

Closes: https://github.com/projectatomic/rpm-ostree/issues/976

Closes: #977
Approved by: jlebon
2017-09-07 15:11:00 +00:00
Colin Walters
f69717bf69 libpriv+daemon: Use autocleanup to abort ostree txn
This allows porting one function each in the unpacker and sysroot to new style.
There were also two cases in the core where we were missing an
`abort_transaction()` invocation.

libostree version in: https://github.com/ostreedev/ostree/pull/1132
Prep for: https://github.com/projectatomic/rpm-ostree/pull/970

Closes: #972
Approved by: jlebon
2017-09-07 13:50:19 +00:00
Colin Walters
20abc85243 unpacker: Translate /boot → /usr/lib/ostree-boot
At one point `rpm-ostree install libvirt` dragged in libguestfs which in turn
brought in `syslinux-extlinux-nonlinux` which has files in `/boot/extlinux`,
which we rejected.  (That dependency chain appears to have been fixed currently)

For the general case, this is just a partial fix in that we haven't nailed down
the semantics of how updates for `/boot` work.  But in this particular case,
we'll just break libguestfs' `extlinux` verb, which I'm OK with.

Another case is `fwupdate-efi` - we require manual intervention to copy the
data into `/boot` after installing the package.

This is also preparation for [unified core](https://github.com/projectatomic/rpm-ostree/issues/729)
in that we now ensure imported kernels don't end up in `/boot` unless
explicitly configured.

Closes: https://github.com/projectatomic/rpm-ostree/issues/853

Closes: #969
Approved by: jlebon
2017-09-07 13:30:36 +00:00
Ruixin Bao
d6b3217a86 lib/core: Detect file name conflict before rpmdb
This PR uses https://github.com/ostreedev/ostree/pull/1116
to ensure that when installing packages containing conflicting files, the
error will be detected at the ostree side, rather than when
writing the rpm database.

Closes: https://github.com/projectatomic/rpm-ostree/issues/365

Closes: #974
Approved by: cgwalters
2017-09-07 13:13:12 +00:00
Jonathan Lebon
5294c1ea69 scripts: squash a -Wmaybe-uninitialized
Closes: #968
Approved by: cgwalters
2017-09-01 19:58:55 +00:00
Colin Walters
a78a88844c libpriv/scripts: Use gperf comments, not C comments
I noticed our C-style comments were actually showing up in the generated hash
table. Consistently use gperf's `#`, and also move all comments to the line
above the value for more readability.

Closes: #967
Approved by: jlebon
2017-09-01 17:58:51 +00:00
Colin Walters
213a656ddf postprocess: Unlink our treecompose-post out of the final /bin
Another variant of <https://github.com/projectatomic/rpm-ostree/pull/822> 😭

Closes: #964
Approved by: jlebon
2017-08-31 03:06:11 +00:00
Colin Walters
3047513509 core: Run %post before %posttrans
While working on unified core and the Fedora Atomic Host content set, I hit a
dependency between `docker.posttrans` which tries to read `/etc/os-release`, and
`fedora-release-atomichost.post` which creates that symlink.

It seems best practice to me to run `%post`s strictly before
`%posttrans`; we're not likely to do parallelization anytime
soon anyways.

While here I cleaned things up by having an enum for the script kind,
rather than multiple functions, otherwise we would have had another
wrapper in core.c.

Closes: #963
Approved by: jlebon
2017-08-30 15:50:09 +00:00
Colin Walters
4cbdcf93c8 daemon/syscore: Add some error prefixing to cleanup paths
Would likely have helped clarify this issue where an ostree repo txn failed
post-bootloader txn: <https://github.com/projectatomic/rpm-ostree/issues/958>

Closes: #960
Approved by: jlebon
2017-08-29 13:24:06 +00:00
Colin Walters
8a87887988 libpriv/postprocess: Port add-files to fd-relative
This is the last bit that used a `yumroot` variable.

Closes: #950
Approved by: jlebon
2017-08-28 13:46:44 +00:00
Colin Walters
d469323693 libpriv/passwd: Fully complete fd-relative porting
I initially thought I wouldn't need this but it turns out it makes things nicer
unified core. In the legacy path we'll need to write
`etc/passwd`, but now we need `usr/etc/passwd` in the unified path, and
we can start to match up with the other code paths which are fd-relative.

Closes: #950
Approved by: jlebon
2017-08-28 13:46:44 +00:00
Colin Walters
3f5cc629dc lib/unpacker: Add a SKIP_EXTRANEOUS flag, use it for filesystem+rootfiles
Prep for unified core. For packages we know ship stuff we want to skip, enable
this flag.

Closes: #951
Approved by: jlebon
2017-08-25 19:25:29 +00:00
Colin Walters
acbf00724d lib/unpacker: Drop ostree convention flag, always enable it
The core use case always enabled this; we exposed it on the command line, but
honestly I think it's a lot simpler if our imports always enable this. If we
need to *undo* it (for example, generating a "traditional feeling" OCI/Docker
image a la <https://github.com/projectatomic/rpm-ostree/pull/367>), we can
easily do that as postprocessing afterwards.

Closes: #951
Approved by: jlebon
2017-08-25 19:25:29 +00:00
Colin Walters
5633424628 lib/unpacker: Fix theoretical error handling case
We should be using `g_propagate_error()` to ensure we handle the case where the
caller specifies `NULL` for the error.

Closes: #951
Approved by: jlebon
2017-08-25 19:25:29 +00:00
Jonathan Lebon
e605386818 daemon: make use of the new deployment flags
Now that we have the semantics we need in libostree, let's just use that
and drop the logic here.

Closes: #942
Approved by: cgwalters
2017-08-25 18:59:24 +00:00
Jonathan Lebon
b05b9679f9 scripts: fix argument ordering
Just noticed this while trying out the unified core work. We were
passing arguments in the wrong order (or alternatively, receiving them
in the wrong order).

Closes: #952
Approved by: cgwalters
2017-08-24 21:48:14 +00:00
Colin Walters
00231446b3 app: Clarify message on repeated Ctrl-C
While we have cancellation issues¹, let's help the
user understand that we heard them the first time.

¹ <https://github.com/projectatomic/rpm-ostree/issues/897>

Closes: #948
Approved by: jlebon
2017-08-24 17:30:10 +00:00
Colin Walters
06f3a1811a lib/passwd: Port passwd checking to fd-relative
Prep for unified core.

Closes: #943
Approved by: jlebon
2017-08-24 15:13:30 +00:00
Colin Walters
a4ca8c8888 app/compose: Drop GFile usage from package install path
Prep for unified core.

Closes: #943
Approved by: jlebon
2017-08-24 15:13:30 +00:00
Colin Walters
addc53a707 tree-wide: Fix extra colon in error prefixes
This is a trap when doing style porting; we added a rule to ostree's `maint.mk`
to catch it but not here. Not sure I want to add `maint.mk` here yet.

Note that in newer libglnx `glnx_opendirat()` does error prefixing, so
drop the prefixing there.

Closes: #943
Approved by: jlebon
2017-08-24 15:13:30 +00:00
Colin Walters
278ed216d0 tree-wide: A bit more libglnx porting
Mostly for `glnx_renameat()`.

Closes: #941
Approved by: jlebon
2017-08-24 13:33:59 +00:00
Colin Walters
3840fad28e tree-wide: Fully purge the rest of "noscripts" support
It was partially removed in 325ee354e9
from PR #873 - this removes all of the rest of the layers in
the daemon and core for this.

Note that while working on this I found it astoundingly confusing that
`rpmts_add_install()` and `add_install()` had separate orderings for `gboolean
noscripts, is_install`. That's fixed by having the latter lose the `noscripts`
flag entirely, but while we're here change `rpmts_add_install()` to use flags
for clarity.

Closes: #938
Approved by: jlebon
2017-08-23 16:31:27 +00:00
Colin Walters
4d32f736e1 lib/unpacker: Port unpack function to new style
Missed this in the tmpdir porting since it used `g_mkdtemp_full()`.
We also now have autocleanups for `OstreeRepoCommitModifier`.

Closes: #939
Approved by: jlebon
2017-08-23 15:14:53 +00:00
Colin Walters
4be8658f65 lib/passwd: Error if presented with an unknown check-passwd value
Prep for sysusers work; let's cleanly reject things we don't know.

Closes: #935
Approved by: jlebon
2017-08-23 14:51:08 +00:00
Colin Walters
5f7d860a33 app: Set GSETTINGS_BACKEND=memory early on if root
I was about to copy this bit from the daemon for subprocess work, so let's
centralize it. Further, we should invoke `setenv()` as early as possible; see
<https://sourceware.org/bugzilla/show_bug.cgi?id=15607#c2>.

Closes: #934
Approved by: jlebon
2017-08-22 21:18:08 +00:00
Colin Walters
6b3a99c3a9 lib/bwrap: Use --die-with-parent
See <https://github.com/projectatomic/bubblewrap/pull/165>; really every
bwrap use case I can think of should specify this (including ours), it's
just not the default out of conservatism.

This way if the daemon happens to e.g. SEGV it'll also cleanly `SIGKILL` any
outstanding scripts.

Was just looking at our bwrap usage for multiprocess work.

Closes: #936
Approved by: jlebon
2017-08-22 18:58:58 +00:00
Colin Walters
0428275a3c tree-wide: Port to new libglnx tmpdir API
Lots of cleanups, and this also allows us to fully port to new style in several
places.

We can drop our own `rpmostree_mkdtemp()`.

Update submodule: libglnx

Closes: #928
Approved by: jlebon
2017-08-22 17:21:37 +00:00
Colin Walters
82f95e7761 daemon/upgrader: Use new libostree timestamp-check option
Since we have a copy of this libostree code, pick up the new
changes from <https://github.com/ostreedev/ostree/pull/1055>.

Note the added test doesn't really test our logic since
we're only doing local pulls, but at least we have something.

Closes: #932
Approved by: jlebon
2017-08-22 16:08:21 +00:00
Colin Walters
ce2033c182 lib/core: Unlink to-import RPMs before unpacking
Was just reading the code. We have similar logic in libostree for individual
objects and deltas.

Closes: #933
Approved by: jlebon
2017-08-22 15:51:05 +00:00
Colin Walters
83bd3c8d13 bin/compose: Move /etc/{passwd,group} injection later
There's no reason to touch things in the target root *before*
we've even downloaded the repodata.  Further, doing so has
the potential trigger the "existing root" logic in libdnf if
it detects `/usr`.  This doesn't matter now since we're writing
to `/etc/`, but it will for later work, so let's put these bits
in the right place.

Prep for <https://github.com/projectatomic/rpm-ostree/pull/927>

Closes: #931
Approved by: jlebon
2017-08-22 01:02:52 +00:00
Colin Walters
129f95b6d8 bin/compose: Move treefile variable into self struct
Prep for a future patch.

Closes: #931
Approved by: jlebon
2017-08-22 01:02:52 +00:00
Colin Walters
b419cb9071 lib/passwd: Misc code cleanup and style porting
I was briefly thinking about sysusers work, and decided to do some quick cleanup
here.

Closes: #929
Approved by: jlebon
2017-08-21 16:59:46 +00:00
Colin Walters
f51611dc74 tree-wide: Some misc libglnx porting
Port away from `glnx_set_error_from_errno` to prefixing errors or libglnx
wrappers as appropriate.

Closes: #926
Approved by: jlebon
2017-08-18 17:38:49 +00:00
Colin Walters
fe1be77025 sysroot: Prefix error when loading deployment with index
This would have helped me debug <https://github.com/projectatomic/rpm-ostree/issues/923>.

Closes: #924
Approved by: jlebon
2017-08-17 16:53:48 +00:00
Colin Walters
8bb604ce67 tree-wide: Port to ostree_repo_{open,create}_at()
A lot of code gets nicer.

Closes: #922
Approved by: jlebon
2017-08-17 15:28:14 +00:00
Colin Walters
1f0a76985e daemon: Use journal over syslog
systemd has to go to a bit more effort to integrate `syslog()`, let's
use the journal directly for consistency.  Just happened to be
reading the code.

Closes: #921
Approved by: jlebon
2017-08-17 13:47:33 +00:00
Jonathan Lebon
ef889b0b3a daemon: use new journal-msg signal
Make use of the new journal-msg signal that OstreeSysroot emits. Since
we now also only rely on the output API to print messages, this allows
us to drop the outrageous hacks we had to do to watch our own stdout,
part of which Coverity didn't like.

Coverity CID: 163694

Closes: #919
Approved by: cgwalters
2017-08-16 16:05:06 +00:00
Jonathan Lebon
1fb9dc57c9 daemon: ensure we consistently use output API
There were places where we were relying on the stdout self read hack to
relay messages to clients. Fix those by explicitly using the output API
in all spots where the daemon may pass. Really, we should exclusively be
using the output API in the daemon and libpriv trees, though many other
instances exist for now.

Closes: #919
Approved by: cgwalters
2017-08-16 16:05:06 +00:00
Jonathan Lebon
7b774cee7e output: add support for messages
This is already supported by the D-Bus API, though not in our output
wrapper.

Closes: #919
Approved by: cgwalters
2017-08-16 16:05:06 +00:00
Jonathan Lebon
35d69c1577 container-builtins: squash a -Wmaybe-uninitialized
Closes: #920
Approved by: cgwalters
2017-08-16 15:48:49 +00:00
Colin Walters
b6705f3feb daemon: Check for updated rpms when upgrading
This closes a longstanding bug - since package layering first
landed, we only checked for newer RPMs if the base tree changed.
In some scenarios like RHELAH, this doesn't matter much by default
since they move at the same cadence.  Except if you use EPEL for example.
In Fedora, today the FAH releases are async of the rpm-md repos, and
there's also COPR which can update more than once a day even.

We should check for both update sources. Luckily we'd already introduced logic
for this in the treecompose case (checksumming the depsolved package sack). We
just need to start using it for client side assembly too.

Closes: https://github.com/projectatomic/rpm-ostree/issues/391

Closes: #911
Approved by: jlebon
2017-08-16 15:33:11 +00:00
Jonathan Lebon
8dddefbad3 unpacker: properly check for glib error
`g_mkdtemp_full` returns a pointer to the template var itself or NULl on
error. We were treating it like an integer.

Coverity CID: 163698

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
8ee1385492 scripts: check var before use
We were using the `bwrap` var before checking it for `NULL`.

Coverity CID: 163704

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
b4411f5fc0 core: log error to journal
I hesitated on this one. Really, we *could* just explicitly cast the
result to mark it as used, though OTOH, we really should at least drop
something in the journal. It's not fatal, but it shouldn't happen so we
should know about it.

Coverity CID: 163717

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
7553b0000b livefs: comment out dead code
The `replacing` var was already checked to be FALSE higher up.

Coverity CID: 163689

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
cf410211d2 dbus-helpers: initialize bus name
In the event that we're not on a message bus, we need to make sure we're
passing NULL.

Coverity CID: 163684

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Jonathan Lebon
c59c11f789 container-builtins: initialize fds to -1
1. We weren't initializing all fds to -1, but 0 is a valid fd number.
2. We were checking for nonzero rather than explicitly for -1.

Coverity CID: 163691
Coverity CID: 163700
Coverity CID: 163714

Closes: #918
Approved by: cgwalters
2017-08-15 20:26:14 +00:00
Ruixin
534fc30308 app: provide command description in a better place
Before, when using rpm-ostree -h command, the command
description was shown together with the command itself

Now, we separate the command description out, providing
user a better view of the description.

Closes: #916
Approved by: jlebon
2017-08-15 13:09:09 +00:00
Ruixin
a2b2758e0f app: add more rpm-ostree -h output
This is brought up by https://github.com/projectatomic/rpm-ostree/issues/806.

When user types in rpm-ostree [subcommands] -h, the user can now see
more useful information for the subcommands.

Closes: #916
Approved by: jlebon
2017-08-15 13:09:09 +00:00
Colin Walters
ee1613e4bf livefs: Stop changing immutable bit on deployment roots
This is no longer necessary since we switched to tracking livefs state in the
origin, and we don't support changing content outside of `/usr` right now
via livefs.

Just noticed this while looking at the livefs code.

Closes: #912
Approved by: jlebon
2017-08-10 13:58:41 +00:00
Colin Walters
f41183e0e5 app/ex-container: Port to new style
Was just looking at this code as part of unified core work. It was an easy port.

Closes: #913
Approved by: jlebon
2017-08-10 13:39:08 +00:00
Colin Walters
0ff4403253 bin/compose: Port to new code style
Move basically everything except early option
processing into a helper function.

Also update a few other misc bits above that to new style.

Closes: #904
Approved by: jlebon
2017-08-08 17:09:13 +00:00
Colin Walters
162b8d4898 bin/compose: Silently ignore --workdir-tmpfs
Down the line when we have a unified core, this will be totally unnecessary.
Even without that, it's not worth the maintenance pain for us. Anyone who wants
this can easily on their own mount a tmpfs and point us at it with --workdir.

Prep for further code cleanup.

Closes: #904
Approved by: jlebon
2017-08-08 17:09:13 +00:00
Colin Walters
39e36db741 postprocess: Port a bit more to new style
Was looking at this file to change how we do kernels, and noticed these two were
straightforward ports.

Closes: #909
Approved by: jlebon
2017-08-08 16:24:45 +00:00
Colin Walters
787c880b64 bin/rebase: Add -b and -m options
The rebase command syntax has confused people a lot.  Let's follow
git here and add a `-b/--branch` option and encourage people to use
that.  The case of switching remotes is `-m/--remote`; it's definitely
unfortunate that `-r` is already taken for `--reboot`.

One thing I'm a little bit unhappy about is how we're doing logic
on the client side here.  Changing the DBus API for this would
also be awkward though.

Closes: https://github.com/projectatomic/rpm-ostree/issues/886

Closes: #890
Approved by: jlebon
2017-08-08 16:02:15 +00:00
Colin Walters
9b22c2c516 scripts: Journal execution of %post/%posttrans, and times for all scripts
The script delay is annoying; some of them take over half a second here. This
helps with debugging. Another enhancement we could make after this is aborting
scripts that appear to be hung after e.g. 30 seconds, and logging that.

Closes: #905
Approved by: jlebon
2017-08-03 16:58:52 +00:00
Jonathan Lebon
dc24dd3105 rollback: allow users to undo a rollback
The new API to find pending and rollback deployments do so relative to
the booted deployment. This caused an interesting behaviour: the first
time a user uses "rpm-ostree rollback", it would (as expected) move the
previous deployment first. but the second call to "rpm-ostree rollback"
would fail since there were now no more rollback deployments.

We fine tune the logic here to allow this, as well as the more general
case of putting the booted deployment back on top.

This fixes a subtle regression from b7cf58e
(https://github.com/projectatomic/rpm-ostree/pull/767).

Closes: https://github.com/projectatomic/rpm-ostree/issues/906

Closes: #907
Approved by: cgwalters
2017-08-03 14:43:16 +00:00
Jonathan Lebon
d9c1e4a5d3 daemon: use upstreamed function to find rollback
Now that the query_deployment() function was upstreamed in ostree (see
https://github.com/ostreedev/ostree/pull/897), let's just use it from
there and drop our copy here.

Closes: #907
Approved by: cgwalters
2017-08-03 14:43:16 +00:00
Colin Walters
0515f59d70 bin/compose: Use autocleanups for context structure
Prep for more code cleanup here and porting to new style.  We
had a mix of owner pointers.  Fix this by consistently having
the `self` struct own the data.

Closes: #903
Approved by: jlebon
2017-08-02 17:41:43 +00:00
Colin Walters
08e3f5de7f lib: Log task output for pre/post scripts
Some of the scripts can be expensive (`shared-mime-info` for example), and we
appear to be hanging for at least a few seconds even on fast hardware. I'd like
to have a lot more logging here...potentially something like showing
individual package names live in the terminal, but this is a start.

Closes: #902
Approved by: jlebon
2017-08-02 17:16:28 +00:00
Ruixin
53c39632d4 Deployment: add endoflife
When commit metadata contains ostree.endoflife attribute,
its information will be added to the deployment Variant,
which will later be shown as a red & bold message when
'rpm-ostree status' command is called.

A test is added for future regression

Closes: #889
Approved by: cgwalters
2017-08-02 13:53:10 +00:00
Colin Walters
0d4d6be94f Implement file triggers (%transfiletriggerin) for layered pkgs
File triggers are a post-RHEL7 thing; more information at
http://rpm.org/user_doc/file_triggers.html

There are two notable users I've been testing this with;
`glib2` and `vagrant`.  The `vagrant` one is more immediately urgent,
since it makes `vagrant-libvirt` work, which I currently rely on
for my workstation dev.

I've tested things successfully with `vagrant`, and I did verify that we run the
`glib2` ones when doing `rpm-ostree ex container`.

Long term, more transaction file triggers are likely to live in
"base" packages like `glib2`.  We don't implement those yet, but
extending this to do that shouldn't be too hard.

There was *significant* what I'd call reverse engineering of the
implementation in librpm.  The file triggers code there is spread out
and abstracted in a few different places in the code.  I found
trying to understand what header values were involved to be quite
tricky.

There are some corner cases like multiple patterns that I *think*
this does correctly, but could use more validation.  The main
question I had was - is it required that the patterns for e.g.
`%transfiletriggerin` and `%transfiletriggerun` be identical?

Closes: https://github.com/projectatomic/rpm-ostree/issues/648

Closes: #869
Approved by: jlebon
2017-07-27 20:58:09 +00:00
Jonathan Lebon
d4effe8f47 dbus: don't register if not active
Follow-up tweak to #894. Make the client smarter so we only register
when we know we can. We could be more sophisticated here and e.g.
introduce the concept of "read-only" clients in the daemon to only allow
access to non-mutating methods, though let's delay that discussion at
least until the daemon learns to auto-exit.

Closes: #898

Closes: #900
Approved by: cgwalters
2017-07-27 20:34:22 +00:00
Colin Walters
34b5a004a8 daemon: Add a sanitycheck(/bin/true) before we deploy a tree
This is a followup to https://github.com/projectatomic/rpm-ostree/pull/888
but more comprehensive; in the layering case, the sanitycheck runs
after all the `%posttrans` scripts, so we'll get a consistent error message
for the `rm -rf /` test.

We also do the sanitycheck for the "pure ostree" case, as well as cases
where we didn't actually layer packages (including `ex override remove` as
well as simply regenerating an initrd).

There's obviously a lot more we could do in a sanitycheck; as I say in the
comment it's tempting to consider trying to boot systemd (in a fully volatile
config), but for now let's do this. In the end of course the admin has rollback
too.

Closes: #892
Approved by: jlebon
2017-07-27 17:58:58 +00:00
Jonathan Lebon
577aef98e2 app: spawn polkit authentication agent
Spawn pkttyagent when trying to call a method that may require
authentication to give users a chance to provide auth right from the
terminal.

Since we're now relying on polkit for authorizing most of the OS
interface methods, let's drop the root check on those.

Closes: #894
Approved by: cgwalters
2017-07-27 17:10:41 +00:00
Jonathan Lebon
21109e18ae dbus: drop root check on RegisterClient()
Drop the root check for RegisterClient() so that any UID can use it to
then safely invoke methods. UIDs which already have an active session do
not need to authenticate for RegisterClient().

In order to implement this, we move the polkit authority setup into the
RpmostreedSysroot object and enable polkit on the interface.

Closes: #894
Approved by: cgwalters
2017-07-27 17:10:41 +00:00
Jonathan Lebon
3ade73dedd daemon: factor out uid fetching
Make a method specialized in fetching the UID of a D-Bus client.

Prep for polkit tty auth agent.

Closes: #894
Approved by: cgwalters
2017-07-27 17:10:41 +00:00
Colin Walters
5763027b5f Update libglnx, do some porting to new APIs
In particular I wanted to start using `GLNX_AUTO_PREFIX_ERROR`.

Update submodule: libglnx

Closes: #893
Approved by: jlebon
2017-07-21 22:37:17 +00:00
Colin Walters
2082b3f8fb lib: Add version macros and version checking function
The version checking function in particular is really useful for people doing
`from gi.repository import RpmOstree`, which we'd like at least some things like
Anaconda and Pungi to do.

Closes: #891
Approved by: jlebon
2017-07-21 20:35:26 +00:00
Colin Walters
fee6d06bf4 lib: Expose new API around basearch
For https://pagure.io/atomic-wg/issue/299 we need to make it
more convenient to substitute the architecture in an installation
context.  I plan to use this API inside `rpmostreepayload` in Anaconda,
so we can substitute the same value of `${basearch}` we use in treefiles
since https://github.com/projectatomic/rpm-ostree/pull/305

Now, you might wonder - why do we need an API wrapping libdnf? It's because
libdnf is not API stable yet. We're just exposing a tiny subset. In theory we
could use the Python dnf bindings in Anaconda, but things get slightly weird if
rpmostreepayload depends on dnf. Perhaps we'll do that down the road, but for
now this a small API surface to maintain (forever).

This change reworks the internal `varsubst` bits to take a pure `DnfContext`,
since we don't want to spin up a whole `RpmOstreeContext` just to do some
string substitutions.

Closes: #877
Approved by: jlebon
2017-07-21 16:02:41 +00:00
Colin Walters
b46fc35901 Add releasever opt, avoid opening up host's rpmdb in treecompose
Closes: https://github.com/projectatomic/rpm-ostree/issues/546

Previously, we'd open up the host's rpmdb for both `compose tree`
and `ex container`.  In the first case, because we require root, we'd
succeed.  For `ex container`, we'd spew an error.

Fixing this was trickier than I thought.  First because there was
*also* a libdnf bug here: https://github.com/rpm-software-management/libdnf/pull/307

Second, there's a compatibility hazard here for anyone using `.repo` files that
reference `$releasever`. This actually happened to me with `ex container` as I'd
just done a `ln -s /etc/yum.repos.d/fedora.repo rpmmd.repos.d`.  I fixed
that first by doing a `sed -i -e 's,$releasever,26,' rpmmd.repos.d/*.repo`.

As far as I can see today, none of Fedora Atomic or CentOS AH rely on this. But
in order to enhance compatibility, let's add a "releasever" option. This makes
it easier again to reuse stock `.repo` files if we wanted to do so.

(Also, I realized we can just use `/usr/share/empty` as *the* canonical immutable
 empty directory)

Closes: #875
Approved by: jlebon
2017-07-21 15:02:59 +00:00
Colin Walters
1f3ebba982 scripts: Honor the -e flag for scripts
This is required for glibc-all-langpacks at least:
https://bugzilla.redhat.com/show_bug.cgi?id=1367585

Otherwise, its usage is...extraordinarily rare. In fact looking at a snapshot of
`rpm-specs-20170518.tar.xz` from Fedora, the only other use is in
`postfix.spec`, and it appears bogus (the value is already expanded at build
time).

But the glibc case is special, as the value of `install_langs` is indeed
potentially dynamic per system.

Closes: #873
Approved by: jlebon
2017-07-18 19:21:15 +00:00
Colin Walters
4222407657 core/scripts: Cleanup refactor
No functional changes; the main thing is to change the "ignore" case to an early
return, and also introduce a "medium level" function that does argument parsing.

Prep for file trigger work.

Closes: #873
Approved by: jlebon
2017-07-18 19:21:15 +00:00
Colin Walters
325ee354e9 core/scripts: Drop support for ignore-scripts
This was a transient hack that I don't think we need any longer.
Since then we've now committed to e.g. ignoring `%pretrans` etc.,
and we also have the hardcoded blacklist.

It never really worked in a complete sense since one would have to re-specify
the ignore on every operation, which was not sustainable.

Closes: #873
Approved by: jlebon
2017-07-18 19:21:15 +00:00
Colin Walters
f38bb61f91 Update libglnx
And port the passwd util.

Update submodule: libglnx

Closes: #867
Approved by: jlebon
2017-07-18 16:43:40 +00:00
Matthew Barnes
c7024d69ae daemon: Avoid "Updating from: (null)" message
Check for a NULL refspec before emitting message in
package_diff_transaction_execute().

Closes: #876
Approved by: cgwalters
2017-07-13 20:14:31 +00:00
Jonathan Lebon
50ad253ebe codebase: partial porting to new style
Just some minor porting of the less glamorous parts of the codebase.

Closes: #865
Approved by: cgwalters
2017-07-07 20:03:28 +00:00
Jonathan Lebon
f1437028cf core: only update repos enabled for packages
We don't care about repos enabled only for METADATA. This works around
an interesting libdnf behaviour in which all repos in redhat.repo are
enabled for metadata, even if disabled.

Downstream RHBZ: #1468302

Closes: #863
Approved by: cgwalters
2017-07-06 18:59:16 +00:00
Colin Walters
f599f4bc7c libpriv: Some style porting
Scattered bits, just keeping up some momentum.

Closes: #861
Approved by: jlebon
2017-07-06 14:29:38 +00:00
Jonathan Lebon
5b541f4859 app: support ex override replace for local RPMs
Add experimental support for replacing packages from the base layer with
local RPMs. This is useful for example, to cherry pick a fixed package,
or to roll back to a previous package version. Like with pkg removals,
only files in /usr are actually replaced.

This patch also contains a few usability improvements as well, e.g.
showing the full NEVRA of removed packages rather than just their names,
and support for resetting overrides using either the pkgname or NEVRA.

Closes: #852
Approved by: cgwalters
2017-07-05 20:59:35 +00:00
Jonathan Lebon
7b4134c8e6 core: make cachebranch finder function public
Prep for replacement overrides.

Closes: #859
Approved by: cgwalters
2017-07-05 14:02:21 +00:00
Jonathan Lebon
63405d655b core: plug leak from ignore_scripts hash table
Closes: #859
Approved by: cgwalters
2017-07-05 14:02:21 +00:00
Jonathan Lebon
2da68cb510 sysroot-core: minor style updates
This function was already mostly in the new style. Just moving the
declarations closer to where they are used. No functional changes. The
logic will be tweaked in an upcoming commit.

Closes: #859
Approved by: cgwalters
2017-07-05 14:02:21 +00:00
Colin Walters
14431f7f09 lib/scripts: Handle script interpreters
Seen in the wild with `vagrant`'s use of `%post -p /usr/bin/ruby`. This was a
very easy fix, and actually makes the code a little bit nicer, as we no longer
need to explicitly make the script executable, since we now pass it as
`argv[1]`, the same way librpm does. That in turn would make it possible to fix
the TODO and use `bwrap --file`, but that can come later.

Closes: https://github.com/projectatomic/rpm-ostree/issues/856

Closes: #858
Approved by: jlebon
2017-07-04 15:51:20 +00:00
Colin Walters
1f33f42c7a scripts: Port some to new style, minor cleanup
Prep for further work.

Closes: #858
Approved by: jlebon
2017-07-04 15:51:20 +00:00
Colin Walters
137271efee libpriv/passwd: Port to new style
All straightforward. Just chipping away at the porting.

Closes: #851
Approved by: jlebon
2017-06-26 18:03:12 +00:00
Colin Walters
c7c89e8735 status: Use more concise GPGSignature without --verbose
Since it takes up a lot of room and should be something that's just always
working.

Closes: https://github.com/projectatomic/rpm-ostree/issues/842

Closes: #848
Approved by: jlebon
2017-06-26 15:51:46 +00:00
Colin Walters
4d72f8d787 cmdline: Stop printing GPG results during pulls
It's really verbose for deploy, and in general, let's follow
the Unix philosophy of silence = success.

Closes: https://github.com/projectatomic/rpm-ostree/issues/843

Closes: #850
Approved by: jlebon
2017-06-26 14:36:41 +00:00
Jonathan Lebon
453e9ca570 rpm-util: factor out get_by_pkgname
This will be needed multiple times in the future.

Closes: #847
Approved by: cgwalters
2017-06-23 17:47:22 +00:00
Jonathan Lebon
3ae90ce5fc upgrader: make metadata tmp dir part of upgrader
I initially planned to use the metadata tmp dir for another reason than
just in finalize_overlays(), but I will not anymore. Regardless, this
seems like a nice patch which also allows us to complete the style
conversion in this file.

Closes: #847
Approved by: cgwalters
2017-06-23 17:47:22 +00:00
Jonathan Lebon
853737f667 unpacker: encode NEVRA info in commit metadata
It seems silly that to find out more detailed information about the
NEVRA of a cached pkg, we have to resort to write out the header to
disk, then reading it back in with librpm in order to tease out the info
we want. Let's just encode that information directly in the commit
metadata and provide a helper to fetch it.

Closes: #847
Approved by: cgwalters
2017-06-23 17:47:22 +00:00
Jonathan Lebon
4507c581cf core: factor out pkgcache nevra to branch lookup
This will be useful in the future for another function.

Closes: #847
Approved by: cgwalters
2017-06-23 17:47:22 +00:00
Jonathan Lebon
7b6237c14f postprocess: prefix more errors
This is a follow-up to #845. Judging from the output of the erroring
compose[1], the error seems to happen after committing all the objects.
Add more detailed prefixes there.

[1] https://lists.fedoraproject.org/archives/list/cloud@lists.fedoraproject.org/thread/2MZ5KFEVITKWJZYOTSAYCZ7XYAJCWZCT/

Closes: #846
Approved by: cgwalters
2017-06-23 15:48:05 +00:00
Colin Walters
64b049b8eb postprocess: Style porting
Prep for debugging: https://lists.fedoraproject.org/archives/list/cloud@lists.fedoraproject.org/thread/2MZ5KFEVITKWJZYOTSAYCZ7XYAJCWZCT/
Almost everything is converted in this file now.

Closes: #845
Approved by: jlebon
2017-06-23 13:50:57 +00:00
Colin Walters
675066a9c7 daemon: Log caller uid
This is an extension to the previous change to distingush between
"caller" and "client".  Now for clients we log the uid (both
in the message and structured).

This is a natural followon from the polkit work, since now different
uids can invoke us.

Closes: #838
Approved by: jlebon
2017-06-22 21:17:10 +00:00
Colin Walters
7d3b72c814 Remove all tabs ⭾ in *.[ch] and add a CI check for them
There weren't many left, and I happened to have one of these files open and it
was distracting.

Closes: #839
Approved by: jlebon
2017-06-22 01:20:55 +00:00
Colin Walters
46f4b62f3b daemon: Differentiate in logs between "client" and "caller"
A "caller" is a bus address that hasn't called `RegisterClient`.

Prep for things like unifying the bus name tracking between the transaction and
the daemon; right now it's a bit silly that the txn code also monitors the
caller's bus name. So down the line we could change that code to call into the
daemon and use its tracking for registered clients.

Closes: #837
Approved by: jlebon
2017-06-20 21:50:39 +00:00
Colin Walters
009e1f78d6 daemon: Render txn data a bit more nicely
Separate the different fields. Prep for adding more metadata like the caller's
uid.

Closes: #837
Approved by: jlebon
2017-06-20 21:50:39 +00:00
Jonathan Lebon
0b1c5eda17 override remove: allow inactive removals
The property of removal overrides dropping out if the package was
removed from the base layer felt a bit too magical and hacky. We really
should remember that wish and re-apply it if the pkg comes back. This is
similar to package layering: requests can become inactive (seems like a
better word than "dormant") if the package is already part of the base
layer, but they don't really go away.

This patch reworks the logic so that removal overrides work the same
way. In the status output, we now have both "RemovedBasePackages" and
"InactiveBaseRemovals" (which is only printed in verbose mode),
similarly to how we have "LayeredPackages" and "InactiveRequests". And
similarly, we also print out in the upgrader during a transaction all
the inactive base removals.

Another cool thing is that we now allow any pattern to be specified at
the CLI. E.g. `ex override remove /usr/bin/strace` will resolve to
strace.

Closes: #836
Approved by: cgwalters
2017-06-20 21:24:05 +00:00
Jonathan Lebon
61560e0686 status: rename RequestedPackages to InactiveRequests
In the JSON output, the "requested-packages" holds *all* the requests
for package layering, whereas the "packages" key holds only those
requests which actually caused a package to be layered.

When outputting RequestedPackages, we try to be nice and print only the
"dormant" packages, i.e. those requests which did not require any
packages to be layered since the base layer already fulfilled them. This
is the subset of "requested-packages" not also in "packages". But then,
we could call this subset something much more appropriate than
"RequestedPackages" when outputting.

This patch renames it to "InactiveRequests" to reflect the "dormant"
aspect of them. We also make it only be output in verbose mode, since
it's not as interesting as what was *actually* layered when trying to
understand what the host is currently running. But we do adapt the
upgrader so that it prints out inactive requests during transactions.

Closes: #836
Approved by: cgwalters
2017-06-20 21:24:05 +00:00
Jonathan Lebon
4ffe12a6af libglnx: bump for GLNX_HASH_TABLE_FOREACH macros
Example of what the new macros look like when applied on a whole
codebase. It definitely feels much nicer to work with!

Update submodule: libglnx

Requires: https://github.com/GNOME/libglnx/pull/55

Closes: #834
Approved by: cgwalters
2017-06-20 14:09:24 +00:00
Kalev Lember
368b1c36f6 Don't use polkit when running on the session bus
This is the case when we're running self tests.

Closes: #825
Approved by: cgwalters
2017-06-19 21:19:42 +00:00
Kalev Lember
84f6bcb4f0 Add polkit support
This allows non-root users access to the rpm-ostree daemon, which is
a pre-requirement for gnome-software rpm-ostree support.

Closes: #745

Closes: #825
Approved by: cgwalters
2017-06-19 21:19:42 +00:00
Jonathan Lebon
c1e6685767 upgrader: fix missing goto out
Closes: #833
Approved by: cgwalters
2017-06-19 15:19:59 +00:00
Jonathan Lebon
782edff91a deploy transaction: factor out local RPM importing
This will be useful in the future for local replacement overrides.

Closes: #833
Approved by: cgwalters
2017-06-19 15:19:59 +00:00
Jonathan Lebon
f0ed8cdb88 rpm-utils: fix pkglist printout
Noticed this while doing composes recently.

Closes: #833
Approved by: cgwalters
2017-06-19 15:19:59 +00:00
Jonathan Lebon
6b8f0f6b23 core: fix error message construction
In the error path when trying to remove a base package, we would try to
print a DnfPackage as char*, which of course didn't result in any
coherent output.

Closes: #833
Approved by: cgwalters
2017-06-19 15:19:59 +00:00
Jonathan Lebon
f5227c8d51 postprocess: add explanatory comment re. /var/run
Include the findings from
https://github.com/projectatomic/rpm-ostree/pull/831 as a comment for
future investigations.

Closes: #832
Approved by: cgwalters
2017-06-16 13:33:49 +00:00
Jonathan Lebon
57cf8d9bc0 postprocess: always nuke /var/run
If `/var/run` exists, it will be a dir, so we'll fail the `unlinkat`
with `EISDIR`. Let's just explicitly nuke it.

Closes: #831
Approved by: cgwalters
2017-06-15 19:27:14 +00:00
Jonathan Lebon
943138b132 postprocess: stronger handling for sepolicy in /var
We shouldn't just check that the "targeted" dir exists, but rather that
the actual directory where the modules are stored exists. This fixes a
regression on RHEL in which the new selinux-policy-targeted lists some
%ghost files under /var/lib/selinux and as a result think that the
policy is in /var.

Closes: #831
Approved by: cgwalters
2017-06-15 19:27:14 +00:00
Jonathan Lebon
4a5e9c3086 postprocess: use glnx_throw helpers to add details
Closes: #831
Approved by: cgwalters
2017-06-15 19:27:14 +00:00
Colin Walters
9f671efc60 treecompose: Add various g_prefix_error()
To help debug a problem which turned out to be in SELinux postprocessing for
RHELAH.

Closes: #830
Approved by: jlebon
2017-06-15 17:40:33 +00:00
Jonathan Lebon
4a61e55663 deploy: use consistent argument names
This is just a cosmetic patch that ensures we use the same names for the
same things everywhere to make it easier to follow along.

Closes: #829
Approved by: cgwalters
2017-06-13 13:25:24 +00:00
Jonathan Lebon
4ee57a6dbd rpmostree-dbus-helpers: generalize pkg sorting
Minor prep for replace overrides.

Let rpmostree_sort_pkgs_strv work on an existing fd list rather than
creating its own, since it may be called multiple times on different
pkgs arrays.

Factor out the logic that calls to sort and inserts the values in the
final modifiers variant dict to prepare for being able to do this
operation multiple times.

Closes: #829
Approved by: cgwalters
2017-06-13 13:25:24 +00:00
Jonathan Lebon
1331ac837d deploy transaction: append to txn title in piecemeal
Only add information to it re. installing/uninstall/local installs after
we check that the corresponding arrays are not `NULL`.

Closes: #826

Closes: #827
Approved by: cgwalters
2017-06-09 20:12:36 +00:00
Jonathan Lebon
afcd99c1bf status: don't use autoptr() on generated objects
This would make a hard dependency on glib > 2.50, which we're not ready
for yet.

Closes: #824
Approved by: cgwalters
2017-06-08 21:14:58 +00:00
Jonathan Lebon
e6a86c1c8e util.h: add helper macro for proper English pluralization
This is to assuage my pet peeve of bad grammar output. It's of course
English-centric, and would require some tweaking if/when we support
internalionalization systems like gettext. Though I don't think it
makes it more difficult to do so in the future.

Closes: #824
Approved by: cgwalters
2017-06-08 21:14:58 +00:00
Jonathan Lebon
cba24435b0 core: don't use rpmfiles if missing
Starting from v4.12, rpmteFI has been deprecated in favour of
rpmteFiles. Make use of it if we can, otherwise fall back to the older
API.

Closes: #824
Approved by: cgwalters
2017-06-08 21:14:58 +00:00
Colin Walters
1977e3cfba scripts: Unlink our temporary post scripts
I just happened to do an `ls /usr` on my workstation. Sigh 😣

Closes: #822
Approved by: jlebon
2017-06-08 15:55:57 +00:00
Colin Walters
5da409fcad upgrader: Add user-inaccessible private dir for rootfs checkouts
This is part of the saga of permissions and checkouts that
came about thinking about flatpak, but suid and world-writable dirs
are also an issue for us.

There's no reason to make suid binaries accessible temporarily
to users while we're computing a new root.  Similarly, we don't
want anyone to actually *write* to our temporary `/tmp`.  The
simple fix is to make an intermediate dir that's `0700`.

See: https://github.com/ostreedev/ostree/pull/909
See: https://github.com/flatpak/flatpak/pull/843

Closes: #821
Approved by: jlebon
2017-06-08 15:24:02 +00:00
Colin Walters
69cc3a13a2 upgrader: Remove duplicate #defines
These were moved to `sysroot-core.h`, but the originals weren't
deleted.  Do so now.  Prep for more work here.

Closes: #821
Approved by: jlebon
2017-06-08 15:24:02 +00:00
Jonathan Lebon
4e2936f085 origin: avoid double lookup on hash table removals
More efficient *and* prettier! So much win!

Closes: #797
Approved by: cgwalters
2017-06-05 20:48:50 +00:00
Jonathan Lebon
cde3295e26 app: add experimental support for pkg removals
This is one more step towards making rpm-ostree more powerful in its
quest to be the ultimate *hybrid* image/package system. Package layering
allows us to add packages on top of the base package set received from
the content provider. However, we're not able to remove or replace
packages in the base set itself.

This patch introduces a new `override` command, which is for now nested
under the experimental `ex` command. The `override` command will allow
users to modify the base package set itself. The first implemented
subcommands are `remove` and `reset`.

A stub has been provided for the more useful `replace` subcommand,
though much of the needed logic for that operation are implemented in
this patch as part of the `remove` subcommand.

Part of: https://github.com/projectatomic/rpm-ostree/issues/485

Closes: #797
Approved by: cgwalters
2017-06-05 20:48:50 +00:00
Colin Walters
7d1424e0c7 compose: Error out early if treecompose-post isn't executable
Closes: https://github.com/projectatomic/rpm-ostree/issues/817

Closes: #818
Approved by: jlebon
2017-06-05 19:18:20 +00:00
Jonathan Lebon
a6c9b6213c origin: drop GCancellable arg and rename function
1. There's no point in passing a GCancellable in those cases. All the
   manipulations should be short-lived.
2. Rename delete_packages to remove_packages, since "remove" is the
   proper antonym of "add".

Closes: #819
Approved by: cgwalters
2017-06-05 18:47:14 +00:00
Colin Walters
02f1fa678e daemon: Plug leak of AddMatch rules for RegisterClient
I noticed this when I set up a `while true; do rpm-ostree status; done` loop
to test: https://github.com/projectatomic/rpm-ostree/pull/814
This is a local, authenticated DoS of sorts, but there are honestly a lot of
those, IMO not worth a CVE.

Closes: https://github.com/projectatomic/rpm-ostree/issues/815

Closes: #816
Approved by: jlebon
2017-06-02 17:57:14 +00:00
Colin Walters
e5294829b8 Add human-readable Title to transaction, render in status
There's a lot that could be done to improve this; we're not setting a title for
`rollback` etc. But I think in practice right now the "deploy" path (which
includes upgrade/install) etc. is most important.

Re-synthesizing a human readable string here is definitely a bit fragile and
going to be a maintenance pain. One thing I debated is having the client send
its commandline as a string. But that would only work for `/usr/bin/rpm-ostree`,
not e.g. Cockpit.

Anyways for now, this is useful and we can always improve it later.

Closes: https://github.com/projectatomic/rpm-ostree/issues/454

Closes: #814
Approved by: jlebon
2017-06-02 17:27:10 +00:00
Colin Walters
d5a493f8b1 Update libglnx
This adapts us to the new dfd API.

Update submodule: libglnx

Closes: #813
Approved by: jlebon
2017-05-31 20:56:27 +00:00
Jonathan Lebon
cdd4b4148a core: drop unused argument to assemble_tmprootfs
Closes: #808
Approved by: cgwalters
2017-05-31 15:19:09 +00:00
Jonathan Lebon
af982ff156 livefs: fix nested continue bug in optimization
There's a subtle but classic issue in this code: calling `continue`
really just continued the inner loop, whereas we meant continuing the
outer loop.

Fix this by making the prefix lookup check a proper predicate function.
Place that function somewhere public, because we'll make use of it in
base overrides as well.

Closes: #807
Approved by: cgwalters
2017-05-31 14:47:54 +00:00
Jonathan Lebon
b800fae0cc upgrader: refactor to improve legibility
At this point, there are many helper functions that really should just
be made upgrader-aware to make it easier to follow. For example, now
both find_missing_pkgs_in_rpmdb() and generate_treespec() are passed the
Upgrader object directly, allowing us to avoid having to thread through
multiple arguments everywhere. Another example is that the Upgrader now
carries the list of final packages that need to be overlaid rather than
passing it around.

We also rename the functions to better reflect what they actually do.

Closes: #804
Approved by: cgwalters
2017-05-30 16:42:59 +00:00
Jonathan Lebon
33935173fa upgrader: drop unnecessary malloc for tmprootfs
Since we now use a predictable directory for the rootfs checkout and
assembly operation, there's no need for a tmprootfs variable anymore.

Closes: #804
Approved by: cgwalters
2017-05-30 16:42:59 +00:00
Jonathan Lebon
5735447f2a origin: add helper to check if local assembly needed
It's less cumbersome to check for this in the origin. Factor it out
there so that it's easier to modify it in the future.

Closes: #804
Approved by: cgwalters
2017-05-30 16:42:59 +00:00
Jonathan Lebon
3fea05d35f upgrader: factor out sack_has_subject
In preparation for using it outside the upgrader.

Closes: #804
Approved by: cgwalters
2017-05-30 16:42:59 +00:00
Jonathan Lebon
c491114720 core: auto-call download_metadata()
In all cases, we always do download_metadata() followed by prepare().
Let's just make life easier for callers by inlining this in prepare(),
much like what libdnf does. The function is still public in case some
use case calls for making them separate.

Closes: #805
Approved by: cgwalters
2017-05-30 15:17:07 +00:00
Jonathan Lebon
b804ae8ae3 core: absorb RpmOstreeInstall into RpmOstreeContext
There's not much use in having RpmOstreeInstall be separate now that
it's completely private. Let's just make it part of the main context
object rather than making callers allocate space for it and pass it to
the various context methods.

We also rename `prepare_install` to `prepare` since it will (soon) do
more than just installs (and sometimes only pure uninstalls).

Closes: #805
Approved by: cgwalters
2017-05-30 15:17:07 +00:00
Jonathan Lebon
d1608ba066 app: more conversion to new style
No big surprises there. A few goto cleanups remain in rpm-util.c
functions which use tmpdirs.

Closes: #803
Approved by: cgwalters
2017-05-30 14:47:31 +00:00
Jonathan Lebon
83aeb018c1 main: deduplicate subcommand handling
We had a lot of duplicate code that handled subcommand handling. Though
now that we have proper structs to represent commands and command
invocations, we can easily unify these.

Closes: #803
Approved by: cgwalters
2017-05-30 14:47:31 +00:00
Jonathan Lebon
fa62981693 main: delete duplicate GPG sig printing function
We already have a `rpmostree_print_signatures` function that the
`status` command uses to print GPG signatures.

Closes: #803
Approved by: cgwalters
2017-05-30 14:47:31 +00:00
Jonathan Lebon
e852bf33d6 main: make rpm subcommand a proper alias
We were manually aliasing `rpm` to `db`, but we now have a nicer way to
define legacy aliases. Use it.

Closes: #803
Approved by: cgwalters
2017-05-30 14:47:31 +00:00
Colin Walters
51ae1e080e postprocess: Some porting to new style
Not all of it, but I did a few things since the GLnxTmpfile bit
let us port one of the functions.

Closes: #800
Approved by: jlebon
2017-05-29 14:24:43 +00:00
Colin Walters
0ea649d80b Bump libglnx, port to new tmpfile API
Update submodule: libglnx

Closes: #800
Approved by: jlebon
2017-05-29 14:24:43 +00:00
Colin Walters
7aba1b91dc Move rpm-md repo status display into core
Part of: https://github.com/projectatomic/rpm-ostree/issues/774

Basically, for `rpm-ostree status` to accurately help people
understand whether or not their system is up to date, we need
to be showing repository timestamps.

Ideally, we'd change the libdnf API to support what we're doing
here better.  But, this works for now.

Closes: #791
Approved by: jlebon
2017-05-26 19:11:17 +00:00
Colin Walters
2c509a768f core: Enable repo caching (one day)
This is prep for a rework of rpm-md downloads (visualizing state better + prep
for parallelization). libdnf defaults to a week which is just too long
(particularly for async security updates).

See also the linked https://github.com/rpm-software-management/libdnf/issues/291

Closes: #791
Approved by: jlebon
2017-05-26 19:11:17 +00:00
Colin Walters
ec5f95b0e3 lib/core: Define a helper to get enabled rpm-md repos
We do this in a few places. Prep for a future patch around metadata downloads.

Closes: #791
Approved by: jlebon
2017-05-26 19:11:17 +00:00
Colin Walters
15b8dd2b7c postprocess: A few more builtin /var suppressions
And tweak the comment; I'm not blindly adding everything from
e.g. a Fedora compose here, since while in practice we omit them,
the ugliness serves as a reminder to fix the packages.

(For example, pam should use tmpfiles.d snippets for `/var/log/tallylog`,
 or %ghost it)

Closes: #795
Approved by: jlebon
2017-05-26 14:26:25 +00:00
Colin Walters
9980448464 lib/util: Add a DECLARE_RPMSIGHANDLER_RESET to pacify clang
We need to add an `__attribute((used))` to the autocleanup variable in order to
pacify its set-but-unused, so make a macro to simplify callers. This is a bit
like systemd's `PRESERVE_ERRNO` cleanup.

Closes: #794
Approved by: jlebon
2017-05-25 20:53:08 +00:00
Colin Walters
a56a98152a core: Use a single tmpdir
This way we only have one directory to `rm_rf` at cleanup time.
A next steps might be teaching libdnf to use this.  Futher, we could
consider inheriting a tmpdir from the transaction.

Closes: #792
Approved by: jlebon
2017-05-25 19:18:38 +00:00
Colin Walters
6efa2de279 core: Pass self object instead of tmpdir dfd
In various places we thread down the tmpdir dfd. But since its lifecycle is
bound to the context, we might as well pass the context itself. This just ends
up being cleaner, and is also prep for changing how we do the tmpdir.

Closes: #792
Approved by: jlebon
2017-05-25 19:18:38 +00:00
Colin Walters
6d78f3504f core: Minor refactoring prep in local pkg install
Make a single place where we generate filenames, as prep for a future patch to
change it.

Closes: #792
Approved by: jlebon
2017-05-25 19:18:38 +00:00
Colin Walters
53d259b3c3 lib: Define an autocleanup for RPM signal handling
Allows us to convert the metadata download func to new code style, and is
generally in line with our cleanup-focused philosophy on code, life,
and the meaning of the universe.

Closes: #789
Approved by: jlebon
2017-05-25 14:41:01 +00:00
Colin Walters
6210f34096 lib/core: Use autoptr to port tmprootfs_assemble() to new code style
I was going to make other changes here, and noticed the only
blocker was removed in https://github.com/projectatomic/rpm-ostree/pull/771

Closes: #787
Approved by: jlebon
2017-05-24 21:49:40 +00:00
Jonathan Lebon
86f82cf648 upgrader: switch to new code style
Splitting this out before I keep hacking on this file. Pretty
straightforward stuff. There is one legitimate use of the `goto out`
pattern left in which we clean up a tmpdir.

Closes: #788
Approved by: cgwalters
2017-05-24 21:19:49 +00:00
Colin Walters
f62c7665f7 livefs: Optimize etc merge by avoiding duplicate checkouts
This came up in review of https://github.com/projectatomic/rpm-ostree/pull/783

The implementation isn't the most beautiful thing in the world,
but we can revisit later.

Closes: #786
Approved by: jlebon
2017-05-24 18:49:29 +00:00
Colin Walters
d2bd8500da compose: Add tmp-is-dir option to make /tmp a directory
There are a few reasons to do this. First, systemd changed to refuse mounts on
symlinks, and hence if one *wants* "/tmp-on-tmpfs", one would need to write a
different `sysroot-tmp.mount` unit.

Second, the original rationale for having this symlink was that if you had
multiple ostree stateroots ("osnames"), it's nicer if they had the same `/tmp`
to avoid duplication. But in practice today that's already an issue due to
`/var/tmp`, and further the multiple-stateroot case is pretty unusual. And that
case is *further* broken by SELinux (if one wanted to have e.g. an Ubuntu and
Fedora) stateroots.  So let's fully decouple this and make `/tmp` a plain
old directory by default, so systemd's `tmp.mount` can become useful.

Now, things get interesting for the case where someone wants a physical `/tmp`
that *does* persist across reboots. Right now, if one just did a `systemctl mask
tmp.mount` as we do in Fedora Atomic Host's cloud images, you'd get a semantic
where `/tmp` stays per-deployment, which is weird.  Our recommendation for
that should likely be to set up a bind mount for `/tmp` → `/var/tmp`.

For now, this stays an option to ensure compatibility; if FAH Cloud images
want to stay with "physical /tmp", then we'd have to change the kickstart.

Closes: https://github.com/projectatomic/rpm-ostree/issues/669

Closes: #778
Approved by: jlebon
2017-05-24 17:49:36 +00:00
Colin Walters
2adc1cf246 core: Ignore overrides for nonexistent %ghost files in /etc
As seen in e.g. `ipa-client-common`.  We expect ghosts 👻 to not
exist.

Closes: https://github.com/projectatomic/rpm-ostree/issues/784

Closes: #785
Approved by: jlebon
2017-05-24 15:53:07 +00:00
Colin Walters
a18c2ecbf7 livefs: Fix etc merge with subdirectories
This was a kind of last-minute bug introduced when I tweaked the
checkout to use `.` to avoid a `mkdir()` for files.  But there were
multiple bugs with that; for files that are in subdirectories of `/etc`
we obviously need to get the right subdir and not use `/etc`.

Second, we need to handle the case where we're adding new subdirectories.

This change fixes `rpm-ostree install firewalld + rpm-ostree ex livefs`.

Closes: #783
Approved by: jlebon
2017-05-23 20:34:47 +00:00
Jonathan Lebon
174510fc5d core: allow no enabled repos for local pkgs
This is a valid case when layering local RPMs. Otherwise (e.g. if
specific non-local packages are requested), give the nicer error rather
than letting libdnf throw something less useful.

Closes: #780

Closes: #781
Approved by: cgwalters
2017-05-19 16:08:18 +00:00
Colin Walters
82fbb5342f postprocess: Some porting to new code style
Prep for future work.  No surprises here.

Closes: #777
Approved by: jlebon
2017-05-18 13:43:15 +00:00
Colin Walters
024f953124 core: Log to journal rpm-md repo timestamps
This is part of: https://github.com/projectatomic/rpm-ostree/issues/774

Basically, it's very useful for debugging since one could get an out-of-date
mirror or the like.

Down the line we may more formally store this data in a permanently-persistent
way, but this is a simple extension of the journaling we do now.

Closes: #775
Approved by: jlebon
2017-05-12 18:09:02 +00:00
Jonathan Lebon
ab1176f682 transaction-types.c: convert to new style
Pretty straightforward stuff.

Closes: #773
Approved by: cgwalters
2017-05-12 16:32:49 +00:00
Jonathan Lebon
1105ef872d pkg-builtins: rename internal functions
The pkg-add/remove names are legacy now.

s/pkg_add/install/
s/pkg_remove/uninstall/

This is mostly for cosmetics.

Closes: #773
Approved by: cgwalters
2017-05-12 16:32:49 +00:00
Jonathan Lebon
da4c25fea1 libglnx: bump and use new helpers
Update submodule: libglnx

Closes: #773
Approved by: cgwalters
2017-05-12 16:32:49 +00:00
Colin Walters
95e9aa4284 Introduce ex livefs
There are a few different use cases here. First, for layering new packages,
there's no good reason for us to force a reboot. Second, we want some support
for cherry-picking security updates and allowing admins to restart services.  Finally,
at some point we should offer support for entirely replacing the running tree
if that's what the user wants.

Until now we've been very conservative, but there's a spectrum here. In
particular, this patch changes things so we push a rollback before we start
doing anything live. I think in practice, many use cases would be totally fine
with doing most changes live, and falling back to the rollback if something went
wrong.

This initial code drop *only* supports live layering of new packages.  However,
a lot of the base infrastructure is laid for future work.

For now, this will be classified as an experimental feature, hence `ex livefs`.

Part of: https://github.com/projectatomic/rpm-ostree/issues/639

Closes: #652
Approved by: jlebon
2017-05-12 15:00:59 +00:00
Colin Walters
3fae2eaf89 daemon/core: Fix leaks in metadata cleanup
I noticed I had `/tmp/rpmostree-metadata*` directories, and there
were two cases where we created those dirs.  Astonishingly,
*both* had bugs that prevented cleaning up.

Rename one of them so in the future it'll be clearer which is buggy (or both).

Closes: #772
Approved by: jlebon
2017-05-12 14:05:58 +00:00
Jonathan Lebon
96f75519f3 core: partial switch to new style
Switch a couple of core functions to the new style in preparation for
some other work there. This doesn't tackle the larger assemble()
function.

Another function which escaped for now is one that uses a tmpdir. Makes
me wonder if we should add a "GlnxTmpDir" type thing which simplifies
the mkdtempat/opendirat pattern and has a shutil_rmrf cleanup.

Closes: #771
Approved by: cgwalters
2017-05-10 20:46:43 +00:00
Jonathan Lebon
143b1a5bd5 rpm-util: use glib auto cleanups macros
Rather than defining our own cleanup functions. And it's easier on the
eyes!

Closes: #771
Approved by: cgwalters
2017-05-10 20:46:43 +00:00
Jonathan Lebon
8c3e8b24ad core: invalidate pkgcache based on RPM checksum
Now that the unpacker actually tracks what the RPM checksum was at
import time, we can make use of that to determine whether we should
download the newer RPM, even if it has the same NEVRA.

Closes: #769
Approved by: cgwalters
2017-05-09 18:53:49 +00:00
Jonathan Lebon
eff00053ef unpacker: embed RPM checksum in metadata
In addition to the header checksum, we also want a checksum of the RPM
file itself. This will allow us to know right away whether an RPM with
the same NEVRA in the repos is actually the same one we already
imported.

Closes: #769
Approved by: cgwalters
2017-05-09 18:53:49 +00:00
Jonathan Lebon
fa10f36fb6 core: write number of imported packages to journal
The actual number of imported packages is not printed right now on the
terminal. But it's useful information to have, so stick it in the
journal.

Also make both the ENABLED_REPOS and ENABLED_REPOS_SOLVABLES
comma-separated lists. This essentially makes them valid YAML/JSON,
which is a nice property to have for e.g. test/shell interactions.

Closes: #769
Approved by: cgwalters
2017-05-09 18:53:49 +00:00
Jonathan Lebon
04adff5d75 rpmostreed-os.c: remove unused variable
Not sure why the clang tester didn't pick this up.

Closes: #768
Approved by: cgwalters
2017-05-08 21:11:46 +00:00
Colin Walters
b7cf58efc1 daemon: Rework API for rollback deployment lookup
Before this commit, in the case where we have 3 deployments, the rollback code
would pick the merge/pending deployment. This is understandable since that logic
predates us potentially creating 3 deployments.

For livefs, I want rollback to actually go to the rollback, not the pending.

Add an API to find the pending/rollback, and put it in syscore, since we have
other similar functions to this there. (Perhaps in the future we'll figure out a
way to dedup the deployment walking/filtering logic a bit).

Port the two callers to it.

Closes: #767
Approved by: jlebon
2017-05-08 14:33:11 +00:00
Colin Walters
3f3090ee7e daemon: Reimplement ClearRollbackTarget in terms of cleanup txn
I didn't realize we had this dbus method.  It was added in the initial
drop of the DBus API, and AFAICS nothing uses it; it's not exposed
via the cmdline, and a quick `git grep` in Cockpit shows it's
not used there either.

It's tempting to delete it.

However, before we take that step, let's reimplement it in terms of the new,
shiny, more powerful "cleanup" txn.

The particular reason I'm doing this is I want to change how we handle
rollbacks.

Closes: #767
Approved by: jlebon
2017-05-08 14:33:11 +00:00
Colin Walters
e7a16c561b os: Use correct completion for cleanup txn
Spotted while doing further work.

Closes: #767
Approved by: jlebon
2017-05-08 14:33:11 +00:00
Colin Walters
670b134cb2 postprocess: Convert a few funcs to new code style
Prep for more work here.

Closes: #766
Approved by: jlebon
2017-05-08 13:34:29 +00:00
Jonathan Lebon
752368eb5b rebase: allow rebasing to a local branch
This is a follow-up to commit 77acf62. There, we added support for
rebasing from a local branch to another local branch. But in testing,
it's also really useful to be able to rebase from a remote-based refspec
to a local branch. We allow this here by slightly expanding the syntax
of allowed refspecs.

Now, we can use rpm-ostree all the time rather than fallback to `ostree
admin deploy`, which isn't pkg-aware.

Closes: #764
Approved by: cgwalters
2017-05-05 21:01:26 +00:00
Jonathan Lebon
a54efdff8a rpmostreed-utils.c: switch to new style
Since we're going to do some work there. Also fix not always translating
the error from ostree_parse_refspec.

Closes: #764
Approved by: cgwalters
2017-05-05 21:01:26 +00:00
Colin Walters
11309cab97 core: Ignore %pretrans
This was argued on list a while ago: http://lists.rpm.org/pipermail/rpm-ecosystem/2016-August/000391.html
Basically, every use of `%pretrans` is a workaround for some in-place
upgrade problem.  But we never do inplace updates, we always assemble
a new tree.  Hence, there is no point for us to ever execute these.

Let's stop erroring out on them. If there does turn out to be some problem with
a particular package (e.g. the `openjdk-copy-configs` or whatever), we would
likely end up needing to fix that package's `%post`, not start executing its
`%pretrans`.

Closes: #763
Approved by: jlebon
2017-05-01 18:07:06 +00:00
Colin Walters
081c9dc65b core: Journal selinux relabeling stats
An updated version of: https://github.com/projectatomic/rpm-ostree/pull/316
using the journal (and structured logging) instead.

I was just curious.  And yeah, in some quick testing via deploying an old
FAH `25.67`, there are zero relabels.

We should likely have a test that actually forces a relabel...would require
custom SELinux policy build?  Or hm, maybe we could override a file context.

Closes: #760
Approved by: jlebon
2017-04-28 21:42:39 +00:00
Jonathan Lebon
f58600a348 util: fix potential overflow in var substitution
When appending the trailing bytes, we were passing (p - s), but p by
definition is always NULL at that point. Chaos ensues.

The really evil part about this is that the len is passed signed and
glib treats negative values to mean it should lookup the length itself,
so this worked *most of the time*. Though I'm guessing if the address at
s is large enough, (p - s) can wrap around and become positive again,
thus causing a massive allocation. Anyway, I didn't actually check this
(esp. since the report was for ARM), but the patch is clearly right.

I think this may be the cause for
https://bugzilla.redhat.com/show_bug.cgi?id=1381357.

Closes: #756
Approved by: cgwalters
2017-04-27 20:55:52 +00:00
Colin Walters
6f3f20a900 utils: Mostly convert to new code style
I was looking at the varsubst code, doing a style conversion first.

Closes: #755
Approved by: jlebon
2017-04-27 18:57:10 +00:00
Colin Walters
7d98e3efc8 libpriv: Add a helper function to print pkg diff
I want to use this in livefs, where I'll end up doing some diff
computations on the server and am currently rendering text there.

It might also be a step towards using this in `db diff`.

Closes: #709
Approved by: jlebon
2017-04-26 14:26:00 +00:00
Colin Walters
999e0034ef daemon/cleanup: Make use of new libostree API to fix TODO
We now avoid doing cleanup twice.

Closes: #709
Approved by: jlebon
2017-04-26 14:26:00 +00:00