From 50e168c632546fe52d642c458763d1cc052569ac Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 19 2017 17:42:52 +0000 Subject: import rpm-ostree-2017.9-2.atomic.el7 --- diff --git a/.gitignore b/.gitignore index 62e048e..c05e4bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/bubblewrap-0.1.8.tar.xz -SOURCES/rpm-ostree-2017.6.tar.xz +SOURCES/rpm-ostree-2017.9.tar.xz diff --git a/.rpm-ostree.metadata b/.rpm-ostree.metadata index 7f14a5f..fba65fa 100644 --- a/.rpm-ostree.metadata +++ b/.rpm-ostree.metadata @@ -1,2 +1,2 @@ dbb597b75848aa28daeaa7d4c933aadcb1a110dc SOURCES/bubblewrap-0.1.8.tar.xz -ec83827de0ed0ffc0d2c0de0f1e63f967e9371e5 SOURCES/rpm-ostree-2017.6.tar.xz +07a9dcea4daee23536a4d8ddf85ee5cac2db7bd8 SOURCES/rpm-ostree-2017.9.tar.xz diff --git a/SOURCES/0001-core-only-update-repos-enabled-for-packages.patch b/SOURCES/0001-core-only-update-repos-enabled-for-packages.patch deleted file mode 100644 index e8c77de..0000000 --- a/SOURCES/0001-core-only-update-repos-enabled-for-packages.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f1437028cfdba73c09daf49cf41ab7e5e665dbea Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Thu, 6 Jul 2017 11:21:18 -0700 -Subject: [PATCH] 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 ---- - src/libpriv/rpmostree-core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c -index 22160884..8aef6617 100644 ---- a/src/libpriv/rpmostree-core.c -+++ b/src/libpriv/rpmostree-core.c -@@ -925,7 +925,7 @@ rpmostree_context_download_metadata (RpmOstreeContext *self, - { - g_assert (!self->empty); - -- g_autoptr(GPtrArray) rpmmd_repos = get_enabled_rpmmd_repos (self->hifctx, DNF_REPO_ENABLED_METADATA); -+ g_autoptr(GPtrArray) rpmmd_repos = get_enabled_rpmmd_repos (self->hifctx, DNF_REPO_ENABLED_PACKAGES); - - g_print ("Enabled rpm-md repositories:"); - for (guint i = 0; i < rpmmd_repos->len; i++) --- -2.13.2 - diff --git a/SOURCES/0001-rollback-allow-users-to-undo-a-rollback.patch b/SOURCES/0001-rollback-allow-users-to-undo-a-rollback.patch deleted file mode 100644 index af07d7f..0000000 --- a/SOURCES/0001-rollback-allow-users-to-undo-a-rollback.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 6ca072af941cd6f1fd2a094b2daa17219c9adc96 Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Thu, 3 Aug 2017 06:41:18 -0700 -Subject: [PATCH] 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 ---- - src/daemon/rpmostreed-transaction-types.c | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - -diff --git a/src/daemon/rpmostreed-transaction-types.c b/src/daemon/rpmostreed-transaction-types.c -index 9f614e4..067adbf 100644 ---- a/src/daemon/rpmostreed-transaction-types.c -+++ b/src/daemon/rpmostreed-transaction-types.c -@@ -322,11 +322,22 @@ rollback_transaction_execute (RpmostreedTransaction *transaction, - { - RollbackTransaction *self = (RollbackTransaction *) transaction; - OstreeSysroot *sysroot = rpmostreed_transaction_get_sysroot (transaction); -+ OstreeDeployment *booted_deployment = ostree_sysroot_get_booted_deployment (sysroot); - -+ g_autoptr(OstreeDeployment) pending_deployment = NULL; - g_autoptr(OstreeDeployment) rollback_deployment = NULL; -- rpmostree_syscore_query_deployments (sysroot, self->osname, NULL, &rollback_deployment); -- if (!rollback_deployment) -+ rpmostree_syscore_query_deployments (sysroot, self->osname, -+ &pending_deployment, &rollback_deployment); -+ -+ if (!rollback_deployment && !pending_deployment) /* i.e. do we just have 1 deployment? */ - return glnx_throw (error, "No rollback deployment found"); -+ else if (!rollback_deployment) -+ { -+ /* If there isn't a rollback deployment, but there *is* a pending deployment, then we -+ * want "rpm-ostree rollback" to put the currently booted deployment back on top. This -+ * also allows users to effectively undo a rollback operation. */ -+ rollback_deployment = g_object_ref (booted_deployment); -+ } - - g_autoptr(GPtrArray) old_deployments = - ostree_sysroot_get_deployments (sysroot); -@@ -344,7 +355,7 @@ rollback_transaction_execute (RpmostreedTransaction *transaction, - for (guint i = 0; i < old_deployments->len; i++) - { - OstreeDeployment *deployment = old_deployments->pdata[i]; -- if (deployment != rollback_deployment) -+ if (!ostree_deployment_equal (deployment, rollback_deployment)) - g_ptr_array_add (new_deployments, g_object_ref (deployment)); - } - --- -2.14.0 - diff --git a/SOURCES/0001-treecompose-Add-various-g_prefix_error.patch b/SOURCES/0001-treecompose-Add-various-g_prefix_error.patch deleted file mode 100644 index 9c36ef4..0000000 --- a/SOURCES/0001-treecompose-Add-various-g_prefix_error.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 9f671efc60e8cb84ad2c73718c686692c92585fa Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Thu, 15 Jun 2017 13:29:06 -0400 -Subject: [PATCH 1/4] 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 ---- - src/app/rpmostree-compose-builtin-tree.c | 20 ++++++++++++++++---- - src/libpriv/rpmostree-postprocess.c | 28 +++++++++++++--------------- - 2 files changed, 29 insertions(+), 19 deletions(-) - -diff --git a/src/app/rpmostree-compose-builtin-tree.c b/src/app/rpmostree-compose-builtin-tree.c -index 15b2862..4cbe503 100644 ---- a/src/app/rpmostree-compose-builtin-tree.c -+++ b/src/app/rpmostree-compose-builtin-tree.c -@@ -1008,12 +1008,18 @@ rpmostree_compose_builtin_tree (int argc, - if (!rpmostree_treefile_postprocessing (rootfs_fd, self->treefile_context_dirs->pdata[0], - self->serialized_treefile, treefile, - next_version, cancellable, error)) -- goto out; -+ { -+ g_prefix_error (error, "Postprocessing: "); -+ goto out; -+ } - - if (!rpmostree_prepare_rootfs_for_commit (self->workdir_dfd, &rootfs_fd, rootfs_name, - treefile, - cancellable, error)) -- goto out; -+ { -+ g_prefix_error (error, "Preparing rootfs for commit: "); -+ goto out; -+ } - - if (!rpmostree_copy_additional_files (yumroot, self->treefile_context_dirs->pdata[0], treefile, cancellable, error)) - goto out; -@@ -1021,12 +1027,18 @@ rpmostree_compose_builtin_tree (int argc, - if (!rpmostree_check_passwd (repo, yumroot, treefile_dirpath, treefile, - previous_checksum, - cancellable, error)) -- goto out; -+ { -+ g_prefix_error (error, "Handling passwd db: "); -+ goto out; -+ } - - if (!rpmostree_check_groups (repo, yumroot, treefile_dirpath, treefile, - previous_checksum, - cancellable, error)) -- goto out; -+ { -+ g_prefix_error (error, "Handling group db: "); -+ goto out; -+ } - - /* Insert our input hash */ - g_hash_table_replace (metadata_hash, g_strdup ("rpmostree.inputhash"), -diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c -index 46fb636..db24c70 100644 ---- a/src/libpriv/rpmostree-postprocess.c -+++ b/src/libpriv/rpmostree-postprocess.c -@@ -654,10 +654,7 @@ postprocess_selinux_policy_store_location (int rootfs_dfd, - - name = dent->d_name; - if (renameat (dfd_iter.fd, name, etc_selinux_dfd, name) != 0) -- { -- glnx_set_error_from_errno (error); -- return FALSE; -- } -+ return glnx_throw_errno_prefix (error, "rename(%s)", name); - } - - return TRUE; -@@ -794,12 +791,18 @@ create_rootfs_from_yumroot_content (int target_root_dfd, - - /* NSS configuration to look at the new files */ - if (!replace_nsswitch (src_rootfs_fd, cancellable, error)) -- goto out; -+ { -+ g_prefix_error (error, "nsswitch replacement: "); -+ goto out; -+ } - - if (selinux) - { - if (!postprocess_selinux_policy_store_location (src_rootfs_fd, cancellable, error)) -- goto out; -+ { -+ g_prefix_error (error, "SELinux postprocess: "); -+ goto out; -+ } - } - - /* We take /usr from the yum content */ -@@ -1615,17 +1618,15 @@ rpmostree_prepare_rootfs_for_commit (int workdir_dfd, - glnx_fd_close int target_root_dfd = -1; - - if (mkdirat (workdir_dfd, temp_new_root, 0755) < 0) -- { -- glnx_set_error_from_errno (error); -- return FALSE; -- } -+ return glnx_throw_errno_prefix (error, "creating %s", temp_new_root); -+ - if (!glnx_opendirat (workdir_dfd, temp_new_root, TRUE, - &target_root_dfd, error)) - return FALSE; - - if (!create_rootfs_from_yumroot_content (target_root_dfd, *inout_rootfs_fd, treefile, - cancellable, error)) -- return FALSE; -+ return glnx_prefix_error (error, "Finalizing rootfs"); - - (void) close (*inout_rootfs_fd); - -@@ -1634,10 +1635,7 @@ rpmostree_prepare_rootfs_for_commit (int workdir_dfd, - - if (TEMP_FAILURE_RETRY (renameat (workdir_dfd, temp_new_root, - workdir_dfd, rootfs_name)) != 0) -- { -- glnx_set_error_from_errno (error); -- return FALSE; -- } -+ return glnx_throw_errno_prefix (error, "rename(%s, %s)", temp_new_root, rootfs_name); - - *inout_rootfs_fd = target_root_dfd; - target_root_dfd = -1; /* Transfer ownership */ --- -2.13.0 - diff --git a/SOURCES/0002-postprocess-use-glnx_throw-helpers-to-add-details.patch b/SOURCES/0002-postprocess-use-glnx_throw-helpers-to-add-details.patch deleted file mode 100644 index 8c25193..0000000 --- a/SOURCES/0002-postprocess-use-glnx_throw-helpers-to-add-details.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 4a5e9c3086da507f7be9bdf84b17aaaca4d18ad7 Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Thu, 15 Jun 2017 13:20:34 -0400 -Subject: [PATCH 2/4] postprocess: use glnx_throw helpers to add details - -Closes: #831 -Approved by: cgwalters ---- - src/libpriv/rpmostree-postprocess.c | 20 ++++---------------- - 1 file changed, 4 insertions(+), 16 deletions(-) - -diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c -index db24c70..77ad66a 100644 ---- a/src/libpriv/rpmostree-postprocess.c -+++ b/src/libpriv/rpmostree-postprocess.c -@@ -595,10 +595,7 @@ postprocess_selinux_policy_store_location (int rootfs_dfd, - if (fstatat (rootfs_dfd, var_policy_location, &stbuf, 0) != 0) - { - if (errno != ENOENT) -- { -- glnx_set_error_from_errno (error); -- return FALSE; -- } -+ return glnx_throw_errno_prefix (error, "fstat(%s)", modules_location); - - /* Okay, this is probably CentOS 7, or maybe we have a build of - * selinux-policy with the path moved back into /etc (or maybe it's -@@ -615,28 +612,19 @@ postprocess_selinux_policy_store_location (int rootfs_dfd, - orig_contents = glnx_file_get_contents_utf8_at (rootfs_dfd, semanage_path, NULL, - cancellable, error); - if (orig_contents == NULL) -- { -- g_prefix_error (error, "Opening %s: ", semanage_path); -- return FALSE; -- } -+ return glnx_prefix_error (error, "Opening %s:", semanage_path); - - contents = g_strconcat (orig_contents, "\nstore-root=/etc/selinux\n", NULL); - - if (!glnx_file_replace_contents_at (rootfs_dfd, semanage_path, - (guint8*)contents, -1, 0, - cancellable, error)) -- { -- g_prefix_error (error, "Replacing %s: ", semanage_path); -- return FALSE; -- } -+ return glnx_prefix_error (error, "Replacing %s:", semanage_path); - } - - etc_policy_location = glnx_strjoina ("etc/selinux/", name); - if (!glnx_opendirat (rootfs_dfd, etc_policy_location, TRUE, &etc_selinux_dfd, error)) -- { -- g_prefix_error (error, "Opening %s: ", etc_policy_location); -- return FALSE; -- } -+ return glnx_prefix_error (error, "Opening %s:", etc_policy_location); - - if (!glnx_dirfd_iterator_init_at (rootfs_dfd, var_policy_location, TRUE, &dfd_iter, error)) - return FALSE; --- -2.13.0 - diff --git a/SOURCES/0003-postprocess-stronger-handling-for-sepolicy-in-var.patch b/SOURCES/0003-postprocess-stronger-handling-for-sepolicy-in-var.patch deleted file mode 100644 index 4254ced..0000000 --- a/SOURCES/0003-postprocess-stronger-handling-for-sepolicy-in-var.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 943138b13254eae339afe47eeccfef5c5f01e2de Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Thu, 15 Jun 2017 13:21:01 -0400 -Subject: [PATCH 3/4] 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 ---- - src/libpriv/rpmostree-postprocess.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c -index 77ad66a..8252f41 100644 ---- a/src/libpriv/rpmostree-postprocess.c -+++ b/src/libpriv/rpmostree-postprocess.c -@@ -592,7 +592,8 @@ postprocess_selinux_policy_store_location (int rootfs_dfd, - return TRUE; - - var_policy_location = glnx_strjoina ("var/lib/selinux/", name); -- if (fstatat (rootfs_dfd, var_policy_location, &stbuf, 0) != 0) -+ const char *modules_location = glnx_strjoina (var_policy_location, "/active/modules"); -+ if (fstatat (rootfs_dfd, modules_location, &stbuf, 0) != 0) - { - if (errno != ENOENT) - return glnx_throw_errno_prefix (error, "fstat(%s)", modules_location); --- -2.13.0 - diff --git a/SOURCES/0004-postprocess-always-nuke-var-run.patch b/SOURCES/0004-postprocess-always-nuke-var-run.patch deleted file mode 100644 index 50fb8dc..0000000 --- a/SOURCES/0004-postprocess-always-nuke-var-run.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 57cf8d9bc0448abcb7f395d2a175be6b6373a569 Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Thu, 15 Jun 2017 13:35:36 -0400 -Subject: [PATCH 4/4] 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 ---- - src/libpriv/rpmostree-postprocess.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c -index 8252f41..094e7b8 100644 ---- a/src/libpriv/rpmostree-postprocess.c -+++ b/src/libpriv/rpmostree-postprocess.c -@@ -329,7 +329,6 @@ convert_var_to_tmpfiles_d (int src_rootfs_dfd, - * runtime. (And really both in CentOS and Fedora) - */ - const char *known_state_files[] = { -- "run", /* We never want to traverse into /run when making tmpfiles since it's a tmpfs */ - "lib/systemd/random-seed", /* https://bugzilla.redhat.com/show_bug.cgi?id=789407 */ - "lib/systemd/catalog/database", - "lib/plymouth/boot-duration", -@@ -340,6 +339,10 @@ convert_var_to_tmpfiles_d (int src_rootfs_dfd, - if (!glnx_opendirat (src_rootfs_dfd, "var", TRUE, &var_dfd, error)) - return FALSE; - -+ /* We never want to traverse into /run when making tmpfiles since it's a tmpfs */ -+ if (!glnx_shutil_rm_rf_at (var_dfd, "run", cancellable, error)) -+ return FALSE; -+ - /* Here, delete some files ahead of time to avoid emitting warnings - * for things that are known to be harmless. - */ -@@ -349,7 +352,7 @@ convert_var_to_tmpfiles_d (int src_rootfs_dfd, - if (unlinkat (var_dfd, path, 0) < 0) - { - if (errno != ENOENT) -- return glnx_throw_errno_prefix (error, "unlinkat"); -+ return glnx_throw_errno_prefix (error, "unlinkat(%s)", path); - } - } - --- -2.13.0 - diff --git a/SPECS/rpm-ostree.spec b/SPECS/rpm-ostree.spec index 3146d1d..5f5018b 100644 --- a/SPECS/rpm-ostree.spec +++ b/SPECS/rpm-ostree.spec @@ -1,8 +1,8 @@ %global bubblewrap_version 0.1.8 Summary: Client side upgrade program and server side compose tool Name: rpm-ostree -Version: 2017.6 -Release: 4.atomic%{?dist} +Version: 2017.9 +Release: 2.atomic%{?dist} #VCS: https://github.com/cgwalters/rpm-ostree # This tarball is generated via "make -f Makefile.dist-packaging dist-snapshot" # because github doesn't support placing submodules in tarballs and RPM @@ -12,13 +12,6 @@ License: LGPLv2+ URL: https://github.com/projectatomic/rpm-ostree Source1: https://github.com/projectatomic/bubblewrap/releases/download/v%{bubblewrap_version}/bubblewrap-%{bubblewrap_version}.tar.xz -Patch0: 0001-treecompose-Add-various-g_prefix_error.patch -Patch1: 0002-postprocess-use-glnx_throw-helpers-to-add-details.patch -Patch2: 0003-postprocess-stronger-handling-for-sepolicy-in-var.patch -Patch3: 0004-postprocess-always-nuke-var-run.patch -Patch4: 0001-core-only-update-repos-enabled-for-packages.patch -Patch5: 0001-rollback-allow-users-to-undo-a-rollback.patch - Requires: ostree-fuse # We always run autogen.sh @@ -27,9 +20,10 @@ BuildRequires: autoconf automake libtool git BuildRequires: chrpath BuildRequires: gtk-doc BuildRequires: gnome-common -BuildRequires: gobject-introspection-devel +BuildRequires: /usr/bin/g-ir-scanner # Core requirements -BuildRequires: pkgconfig(ostree-1) >= 2017.6 +BuildRequires: pkgconfig(ostree-1) >= 2017.11 +BuildRequires: pkgconfig(polkit-gobject-1) BuildRequires: pkgconfig(json-glib-1.0) BuildRequires: pkgconfig(rpm) BuildRequires: pkgconfig(libarchive) @@ -58,18 +52,28 @@ BuildRequires: libsolv-devel BuildRequires: pkgconfig(libsolv) %endif +# explicit requires since we don't version symbols +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + %description This tool binds together the world of RPM packages with the OSTree model of bootable filesystem trees. It provides commands usable both on client systems as well as server-side composes. +%package libs +Summary: Shared library for rpm-ostree +Group: Development/Libraries + +%description libs +The %{name}-libs package includes the shared library for %{name}. + %package devel Summary: Development headers for %{name} Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel -The %{name}-devel package includes the header files for the %{name} library. +The %{name}-devel package includes the header files for %{name}-libs. %prep %autosetup -Sgit -n %{name}-%{version} @@ -119,16 +123,19 @@ EOF python autofiles.py > files \ '%{_bindir}/*' \ '%{_libdir}/%{name}' \ - '%{_libdir}/*.so.*' \ '%{_mandir}/man*/*' \ - '%{_libdir}/girepository-1.0/*.typelib' \ '%{_sysconfdir}/dbus-1/system.d/*' \ '%{_prefix}/lib/systemd/system/*' \ '%{_libexecdir}/rpm-ostree*' \ + '%{_datadir}/polkit-1/actions/*.policy' \ '%{_datadir}/dbus-1/system-services' +python autofiles.py > files.lib \ + '%{_libdir}/*.so.*' \ + '%{_libdir}/girepository-1.0/*.typelib' python autofiles.py > files.devel \ '%{_libdir}/lib*.so' \ '%{_includedir}/*' \ + '%{_datadir}/dbus-1/interfaces/org.projectatomic.rpmostree1.xml' \ '%{_libdir}/pkgconfig/*' \ '%{_datadir}/gtk-doc/html/*' \ '%{_datadir}/gir-1.0/*-1.0.gir' @@ -136,9 +143,18 @@ python autofiles.py > files.devel \ %files -f files %doc COPYING README.md +%files libs -f files.lib + %files devel -f files.devel %changelog +* Tue Sep 26 2017 Jonathan Lebon - 2017.9-2.atomic +- Add explicit req on -libs subpackage + +* Mon Sep 25 2017 Jonathan Lebon - 2017.9-1.atomic +- New upstream release +- Resolves: #1494120 + * Tue Aug 08 2017 Jonathan Lebon - 2017.6-4.atomic - Backport fix to allow rollback more than once - Resolves: #1478083