import oscap-anaconda-addon-1.2.1-1.el8

This commit is contained in:
CentOS Sources 2021-08-09 18:24:51 +00:00 committed by Andrew Lukoshko
parent d3baaab07b
commit 1bbea3e845
6 changed files with 8 additions and 8102 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/oscap-anaconda-addon-1.2.0.tar.gz
SOURCES/oscap-anaconda-addon-1.2.1.tar.gz

View File

@ -1 +1 @@
3c1e0b7194fae2d1ba496a005f2322dbb25ff5fc SOURCES/oscap-anaconda-addon-1.2.0.tar.gz
9ddad97065dcdcaa475051ad576cd9f2e9a5a2cc SOURCES/oscap-anaconda-addon-1.2.1.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +0,0 @@
From 56ee09bf171e0311e970b6bbd8c4c6d1114aca60 Mon Sep 17 00:00:00 2001
From: Matej Tyc <matyc@redhat.com>
Date: Tue, 29 Jun 2021 23:44:28 +0200
Subject: [PATCH] Dont use the tmp_path fixture.
The rhel8 pytest doesn't know it yet,
so it shouldn't be in the RHEL8 branch.
---
tests/test_data_fetch.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/tests/test_data_fetch.py b/tests/test_data_fetch.py
index cfc56b9..3b18e1e 100644
--- a/tests/test_data_fetch.py
+++ b/tests/test_data_fetch.py
@@ -61,9 +61,10 @@ def test_unsupported_url():
assert not data_fetch.can_fetch_from("aaaaa")
-def test_fetch_local(tmp_path):
- source_path = pathlib.Path(__file__).absolute()
- dest_path = tmp_path / "dest"
- data_fetch.fetch_data("file://" + str(source_path), dest_path)
- with open(dest_path, "r") as copied_file:
- assert "This line is here and in the copied file as well" in copied_file.read()
+def test_fetch_local():
+ with tempfile.NamedTemporaryFile() as f:
+ dest_path = pathlib.Path(f.name)
+ source_path = pathlib.Path(__file__).absolute()
+ data_fetch.fetch_data("file://" + str(source_path), dest_path)
+ with open(dest_path, "r") as copied_file:
+ assert "This line is here and in the copied file as well" in copied_file.read()

View File

@ -1,101 +0,0 @@
From 9d268437f092167f5afeb93e970eb197c696a866 Mon Sep 17 00:00:00 2001
From: Matej Tyc <matyc@redhat.com>
Date: Wed, 30 Jun 2021 21:29:24 +0200
Subject: [PATCH 1/4] Fix shadowing of _
_, the established symbol for dummy return values,
conflicted with _, the establish symbol for gettext translations.
---
org_fedora_oscap/ks/oscap.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/org_fedora_oscap/ks/oscap.py b/org_fedora_oscap/ks/oscap.py
index 2172293..b96b93b 100644
--- a/org_fedora_oscap/ks/oscap.py
+++ b/org_fedora_oscap/ks/oscap.py
@@ -445,7 +445,7 @@ def setup(self, storage, ksdata, payload):
try:
# just check that preferred content exists
- _ = self.content_bringer.get_preferred_content(content)
+ self.content_bringer.get_preferred_content(content)
except Exception as exc:
self._terminate(str(exc))
return
From 2e38bc81e925818b8985dc80a0004b94c1f9278e Mon Sep 17 00:00:00 2001
From: Matej Tyc <matyc@redhat.com>
Date: Wed, 30 Jun 2021 21:29:41 +0200
Subject: [PATCH 2/4] Fix conversion of fatal messages to strings
---
org_fedora_oscap/ks/oscap.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/org_fedora_oscap/ks/oscap.py b/org_fedora_oscap/ks/oscap.py
index b96b93b..90e8dd4 100644
--- a/org_fedora_oscap/ks/oscap.py
+++ b/org_fedora_oscap/ks/oscap.py
@@ -460,7 +460,7 @@ def setup(self, storage, ksdata, payload):
if message.type == common.MESSAGE_TYPE_FATAL]
if any(fatal_messages):
msg_lines = [_("Wrong configuration detected!")]
- msg_lines.extend(fatal_messages)
+ msg_lines.extend([m.text for m in fatal_messages])
self._terminate("\n".join(msg_lines))
return
From fc467d9699a3ede83a2117ca48fae8edb589f35b Mon Sep 17 00:00:00 2001
From: Matej Tyc <matyc@redhat.com>
Date: Wed, 30 Jun 2021 20:45:22 +0200
Subject: [PATCH 3/4] Streamline the code
Make get_preinst_content_path and get_raw_preinst_content_path
easier to compare.
---
org_fedora_oscap/ks/oscap.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/org_fedora_oscap/ks/oscap.py b/org_fedora_oscap/ks/oscap.py
index 90e8dd4..d1b8c9e 100644
--- a/org_fedora_oscap/ks/oscap.py
+++ b/org_fedora_oscap/ks/oscap.py
@@ -325,8 +325,7 @@ def preinst_content_path(self):
"""Path to the pre-installation content file"""
if self.content_type == "datastream":
- return utils.join_paths(common.INSTALLATION_CONTENT_DIR,
- self.content_name)
+ return self.raw_preinst_content_path
elif self.content_type == "scap-security-guide":
# SSG is not copied to the standard place
return self.content_path
From ea8fc0ab6307a6b8381b18b26cb0c7ce3ff7f8b0 Mon Sep 17 00:00:00 2001
From: Matej Tyc <matyc@redhat.com>
Date: Wed, 30 Jun 2021 20:49:07 +0200
Subject: [PATCH 4/4] Fix an f-string that references incorrect variable
---
org_fedora_oscap/content_discovery.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/org_fedora_oscap/content_discovery.py b/org_fedora_oscap/content_discovery.py
index 6393086..f6b4d27 100644
--- a/org_fedora_oscap/content_discovery.py
+++ b/org_fedora_oscap/content_discovery.py
@@ -243,9 +243,10 @@ def get_preferred_content(self, content):
return preferred_content
def get_preferred_tailoring(self, content):
- if self._addon_data.tailoring_path:
- if self._addon_data.tailoring_path != str(content.tailoring.relative_to(content.root)):
- msg = f"Expected a tailoring {self.tailoring_path}, but it couldn't be found"
+ tailoring_path = self._addon_data.tailoring_path
+ if tailoring_path:
+ if tailoring_path != str(content.tailoring.relative_to(content.root)):
+ msg = f"Expected a tailoring {tailoring_path}, but it couldn't be found"
raise content_handling.ContentHandlingError(msg)
return content.tailoring

View File

@ -2,8 +2,8 @@
%global _default_patch_flags --no-backup-if-mismatch
Name: oscap-anaconda-addon
Version: 1.2.0
Release: 2%{?dist}
Version: 1.2.1
Release: 1%{?dist}
Summary: Anaconda addon integrating OpenSCAP to the installation process
License: GPLv2+
@ -19,8 +19,6 @@ Source0: %{name}-%{version}.tar.gz
# Let the Patch1 be reserved for translations patches
Patch1: lang.patch
Patch2: oscap-anaconda-addon-1.2.1-no_tmp_path-PR_161.patch
Patch3: oscap-anaconda-addon-1.2.1-various_fixes-PR_162.patch
BuildArch: noarch
BuildRequires: make
@ -44,9 +42,6 @@ content.
%prep
%setup -q -n %{name}-%{version}
%patch2 -p1
%patch3 -p1
# As patches may translates the strings that are updated by later patches,
# Patch1 needs to be aplied last.
%patch1 -p1
@ -71,6 +66,10 @@ make install DESTDIR=%{buildroot}
%doc COPYING ChangeLog README.md
%changelog
* Fri Jul 30 2021 Matej Tyc <matyc@redhat.com> - 1.2.1-1
- Rebase to the new upstream version.
- Resolves: rhbz#1691305
* Fri Jul 16 2021 Matej Tyc <matyc@redhat.com> - 1.2.0-2
- Updated translations
- Resolves: rhbz#1938623