Copy ostree-installer without preserving owner

This commit is contained in:
Lubomír Sedlář 2018-05-04 14:25:53 +02:00
parent 5985c66b52
commit 15b48d3905
6 changed files with 57 additions and 5 deletions

View File

@ -1,7 +1,7 @@
From fa0ed11ee0c733e9c3e4785f6526ef889109111c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Wed, 11 Apr 2018 09:18:59 +0200
Subject: [PATCH 1/4] Revert "Move ostree phase and pipelines for running
Subject: [PATCH 1/5] Revert "Move ostree phase and pipelines for running
phases"
This reverts commit 660c04368ba1abed310f121d01f0fa029eea5f11.

View File

@ -1,7 +1,7 @@
From c62eb8dd27bc17406649e3560223f20b690de63f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Wed, 11 Apr 2018 09:19:53 +0200
Subject: [PATCH 2/4] Revert "Other repo for OstreeInstaller"
Subject: [PATCH 2/5] Revert "Other repo for OstreeInstaller"
This reverts commit 5c081cb545715c2a912ff50fa57554e89d905868.
---

View File

@ -1,7 +1,7 @@
From f51543a24a35145ecbc60e86951accf5369df364 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Wed, 11 Apr 2018 09:20:51 +0200
Subject: [PATCH 3/4] Revert "Ostree can use pkgset repos"
Subject: [PATCH 3/5] Revert "Ostree can use pkgset repos"
This reverts commit c7cc200246300c6a3946b2e3a9f5f7693896a7d6.
---

View File

@ -1,7 +1,7 @@
From c2fb790652ab9b6f1b03ebd61e70838c0695d1fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Wed, 2 May 2018 15:36:52 +0200
Subject: [PATCH 4/4] Update tests for libmodulemd 1.4.0
Subject: [PATCH 4/5] Update tests for libmodulemd 1.4.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

View File

@ -0,0 +1,48 @@
From 52a3c87c71522db59191f1f7e4e66cee72e67bf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Fri, 4 May 2018 08:58:34 +0200
Subject: [PATCH 5/5] ostree-installer: Copy files without owner
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The files created in koji runroot will be owned by root. If the compose
is done under different user, there could be a problem with copying the
files preserving the owner. Let's just copy them without that.
Fixes: https://pagure.io/pungi/issue/932
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
---
pungi/phases/ostree_installer.py | 2 +-
tests/test_ostree_installer_phase.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pungi/phases/ostree_installer.py b/pungi/phases/ostree_installer.py
index 9bf5e255..58eede96 100644
--- a/pungi/phases/ostree_installer.py
+++ b/pungi/phases/ostree_installer.py
@@ -98,7 +98,7 @@ class OstreeInstallerThread(WorkerThread):
os_path = compose.paths.compose.os_tree(arch, variant)
boot_iso = os.path.join(output_dir, 'images', 'boot.iso')
- shortcuts.run('cp -av %s/* %s/' %
+ shortcuts.run('cp -rv %s/* %s/' %
(shlex_quote(output_dir), shlex_quote(os_path)))
try:
os.link(boot_iso, iso_path)
diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py
index ba56d8c7..62598315 100644
--- a/tests/test_ostree_installer_phase.py
+++ b/tests/test_ostree_installer_phase.py
@@ -123,7 +123,7 @@ class OstreeThreadTest(helpers.PungiTestCase):
self.assertTrue(os.path.isdir(self.topdir + '/work/x86_64/Everything/'))
self.assertFalse(os.path.isdir(self.topdir + '/work/x86_64/Everything/ostree_installer'))
self.assertEqual(run.call_args_list,
- [mock.call('cp -av {0}/work/x86_64/Everything/ostree_installer/* {0}/compose/Everything/x86_64/os/'.format(self.topdir))])
+ [mock.call('cp -rv {0}/work/x86_64/Everything/ostree_installer/* {0}/compose/Everything/x86_64/os/'.format(self.topdir))])
@mock.patch('kobo.shortcuts.run')
@mock.patch('productmd.images.Image')
--
2.14.3

View File

@ -1,6 +1,6 @@
Name: pungi
Version: 4.1.24
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Distribution compose tool
Group: Development/Tools
@ -11,6 +11,7 @@ Patch0: 0001-Revert-Move-ostree-phase-and-pipelines-for-running-p.patch
Patch1: 0002-Revert-Other-repo-for-OstreeInstaller.patch
Patch2: 0003-Revert-Ostree-can-use-pkgset-repos.patch
Patch3: 0004-Update-tests-for-libmodulemd-1.4.0.patch
Patch4: 0005-ostree-installer-Copy-files-without-owner.patch
BuildRequires: python3-nose
BuildRequires: python3-mock
@ -177,6 +178,9 @@ nosetests-3 --exe
%{_bindir}/%{name}-wait-for-signed-ostree-handler
%changelog
* Fri May 04 2018 Lubomír Sedlář <lsedlar@redhat.com> - 4.1.24-2
- Copy ostree-installer without preserving owner
* Wed May 02 2018 Lubomír Sedlář <lsedlar@redhat.com> - 4.1.24-1
- koji-wrapper: Log failed subtasks (lsedlar)
- Update compose status when config validation fails (lsedlar)