Commit Graph

1643 Commits

Author SHA1 Message Date
Jonathan Lebon
47cc5f60ed tests/check: remove test-compose.sh
Nowadays, we have a much more in-depth and realistic compose test suite
that obsoletes this test.

Closes: #854
Approved by: cgwalters
2017-06-29 16:16:54 +00:00
Jonathan Lebon
4445df2c01 tests: add libtest.c for binary tests
Import libostreetest.c from ostreedev/ostree as libtest.c. This is just
a really useful and outrageous way of using libtest.sh from C.

Closes: #854
Approved by: cgwalters
2017-06-29 16:16:54 +00:00
Jonathan Lebon
4c831e619c check/test-utils.c: assert no error first
Minor tweak; use g_assert_no_error() before using g_assert(ret) so that
we actually get a printout of the error the test fails.

Closes: #854
Approved by: cgwalters
2017-06-29 16:16:54 +00:00
Jonathan Lebon
1c17e93029 tap-test: create tmpdir in /var/tmp
So that we can use xattrs.

Closes: #854
Approved by: cgwalters
2017-06-29 16:16:54 +00:00
Jonathan Lebon
0fafd8ea18 tap-test: fix typo and actually create .test marker
We have this chunk in tap-test:

    if test -f ${test_tmpdir}/.test; then
      rm "${tempdir}" -rf
    fi

But (1) we were never actually touching `.test` and (2), we were
checking in `test_tmpdir` instead of `tmpdir`. This meant that the test
dirs were never actually cleaned up.

Create the marker file and make sure we rm the right dir. Also re-indent
to remove tabs.

Closes: #854
Approved by: cgwalters
2017-06-29 16:16:54 +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
Kalev Lember
417a3d8d4e daemon: Install dbus introspection files
This makes it possible to use the dbus introspection files in other apps
without having to bundle them.

Closes: #841
Approved by: cgwalters
2017-06-23 19:15:42 +00:00
Jonathan Lebon
478b22db10 libdnf: bump for stale cache fix
As mentioned in

  https://github.com/rpm-software-management/libdnf/pull/297,

this affects our compose path.

Update submodule: libdnf

Closes: #840
Approved by: cgwalters
2017-06-23 18:33:51 +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
44bcb9d60a tests: merge cache_branch_to_nevra into test-utils
I didn't realize at the time I wrote the cache_branch_to_nevra test that
the already existing test-utils.c would be the perfect place to add this
test. Merge the two together now.

Closes: #847
Approved by: cgwalters
2017-06-23 17:47:21 +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
184c017b36 libbuild.sh: Install polkit-devel
We need this until the updated package with the polkit support added
makes it into a repo.

Closes: #825
Approved by: cgwalters
2017-06-19 21:19:42 +00:00
Kalev Lember
41a8c7a02e ci: Install polkit-devel for c7-build
We need this until the updated package with the polkit support added
makes it into a repo and yum-builddep picks up the new dep.

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
5803fbc807 vmcheck: also clear repo metadata between tests
Closes: #833
Approved by: cgwalters
2017-06-19 15:19:59 +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
9907f9b283 vmoverlay: overlay on default checksum, not booted
This allows us to save one reboot if we want the overlay to happen on
the pending base checksum.

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
Colin Walters
6b74f440dc tests: Use G_DEBUG=fatal-warnings for daemon
To catch things like https://github.com/projectatomic/rpm-ostree/issues/826
during testing.

(Really IMO this should be the system-wide default except GNOME and
 lots of apps would start dumping core all over the place... 😢)

Closes: #828
Approved by: jlebon
2017-06-09 20:42:44 +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
5d8783b62d ci: add centos build checker
We should make sure that we can build on CentOS 7, so that we don't
inadvertently break the rdgo c7 stream. This will be enforced even more
explicitly when we were integrate RPM building in PAPR.

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