aboutsummaryrefslogtreecommitdiffstats
path: root/testing/openscap-daemon
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-04-16 14:38:43 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-04-17 11:45:52 +0000
commit5b8f886a190bab016cbe9d717a65895b070fc2ff (patch)
treeb7d3bef9b2509bf3491f36f489522742a8e2ed28 /testing/openscap-daemon
parent48f62c326f62cbacbb7a7402f4522362e0d3f396 (diff)
downloadaports-5b8f886a190bab016cbe9d717a65895b070fc2ff.tar.bz2
aports-5b8f886a190bab016cbe9d717a65895b070fc2ff.tar.xz
testing/openscap-daemon: rebuild against python 3.7
Diffstat (limited to 'testing/openscap-daemon')
-rw-r--r--testing/openscap-daemon/APKBUILD8
-rw-r--r--testing/openscap-daemon/python-3.7.patch122
2 files changed, 127 insertions, 3 deletions
diff --git a/testing/openscap-daemon/APKBUILD b/testing/openscap-daemon/APKBUILD
index cdd7cac404..35cd697f3b 100644
--- a/testing/openscap-daemon/APKBUILD
+++ b/testing/openscap-daemon/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=openscap-daemon
pkgver=0.1.10
-pkgrel=0
+pkgrel=1
pkgdesc="Manages continuous scans of your infrastructure"
url="https://www.open-scap.org/tools/openscap-daemon/"
arch="noarch"
@@ -10,7 +10,8 @@ license="LGPL-2.1-only"
depends="py3-gobject3"
makedepends="python3-dev"
subpackages="$pkgname-doc"
-source="$pkgname-$pkgver.tar.gz::https://github.com/OpenSCAP/$pkgname/archive/$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/OpenSCAP/$pkgname/archive/$pkgver.tar.gz
+ python-3.7.patch"
builddir="$srcdir/$pkgname-$pkgver"
build() {
@@ -28,4 +29,5 @@ package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
}
-sha512sums="93946b390cc95281b606967df783b8be6beb83da9fbca1951f2095dc24abe518440b6f967b29ae2b093536abe9af4effc3776e8d30f0ab2193b923c1bcf54e17 openscap-daemon-0.1.10.tar.gz"
+sha512sums="93946b390cc95281b606967df783b8be6beb83da9fbca1951f2095dc24abe518440b6f967b29ae2b093536abe9af4effc3776e8d30f0ab2193b923c1bcf54e17 openscap-daemon-0.1.10.tar.gz
+2363d46102ea0a25e3eeab36c292b3f70202ba7b19c6b89936c547eb829247adff578391641e5cd540021fb699b4a6ba5206db11cb8132c839d5e10379326d49 python-3.7.patch"
diff --git a/testing/openscap-daemon/python-3.7.patch b/testing/openscap-daemon/python-3.7.patch
new file mode 100644
index 0000000000..f64dc1af3d
--- /dev/null
+++ b/testing/openscap-daemon/python-3.7.patch
@@ -0,0 +1,122 @@
+From c34349720a57997d30946286756e2ba9dbab6ace Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20T=C3=BD=C4=8D?= <matyc@redhat.com>
+Date: Mon, 2 Jul 2018 11:21:19 +0200
+Subject: [PATCH] Renamed module and variables to get rid of async.
+
+async is a reserved word in Python 3.7.
+---
+ openscap_daemon/{async.py => async_tools.py} | 0
+ openscap_daemon/dbus_daemon.py | 2 +-
+ openscap_daemon/system.py | 16 ++++++++--------
+ tests/unit/test_basic_update.py | 3 ++-
+ 4 files changed, 11 insertions(+), 10 deletions(-)
+ rename openscap_daemon/{async.py => async_tools.py} (100%)
+
+diff --git a/openscap_daemon/async.py b/openscap_daemon/async_tools.py
+similarity index 100%
+rename from openscap_daemon/async.py
+rename to openscap_daemon/async_tools.py
+diff --git a/openscap_daemon/dbus_daemon.py b/openscap_daemon/dbus_daemon.py
+index e6eadf9..cb6a8b6 100644
+--- a/openscap_daemon/dbus_daemon.py
++++ b/openscap_daemon/dbus_daemon.py
+@@ -81,7 +81,7 @@ def GetProfileChoicesForInput(self, input_file, tailoring_file):
+ @dbus.service.method(dbus_interface=dbus_utils.DBUS_INTERFACE,
+ in_signature="", out_signature="a(xsi)")
+ def GetAsyncActionsStatus(self):
+- return self.system.async.get_status()
++ return self.system.async_manager.get_status()
+
+ @dbus.service.method(dbus_interface=dbus_utils.DBUS_INTERFACE,
+ in_signature="s", out_signature="(sssn)")
+diff --git a/openscap_daemon/system.py b/openscap_daemon/system.py
+index 2012f6e..85c2680 100644
+--- a/openscap_daemon/system.py
++++ b/openscap_daemon/system.py
+@@ -26,7 +26,7 @@
+ from openscap_daemon.task import Task
+ from openscap_daemon.config import Configuration
+ from openscap_daemon import oscap_helpers
+-from openscap_daemon import async
++from openscap_daemon import async_tools
+
+
+ class ResultsNotAvailable(Exception):
+@@ -40,7 +40,7 @@ def __init__(self):
+
+ class System(object):
+ def __init__(self, config_file):
+- self.async = async.AsyncManager()
++ self.async_manager = async_tools.AsyncManager()
+
+ logging.info("Loading configuration from '%s'.", config_file)
+ self.config = Configuration()
+@@ -90,7 +90,7 @@ def get_profile_choices_for_input(self, input_file, tailoring_file):
+ input_file, tailoring_file, None
+ )
+
+- class AsyncEvaluateSpecAction(async.AsyncAction):
++ class AsyncEvaluateSpecAction(async_tools.AsyncAction):
+ def __init__(self, system, spec):
+ super(System.AsyncEvaluateSpecAction, self).__init__()
+
+@@ -113,7 +113,7 @@ def __str__(self):
+ return "Evaluate Spec '%s'" % (self.spec)
+
+ def evaluate_spec_async(self, spec):
+- return self.async.enqueue(
++ return self.async_manager.enqueue(
+ System.AsyncEvaluateSpecAction(
+ self,
+ spec
+@@ -488,7 +488,7 @@ def get_closest_datetime(self, reference_datetime):
+
+ return ret
+
+- class AsyncUpdateTaskAction(async.AsyncAction):
++ class AsyncUpdateTaskAction(async_tools.AsyncAction):
+ def __init__(self, system, task_id, reference_datetime):
+ super(System.AsyncUpdateTaskAction, self).__init__()
+
+@@ -536,7 +536,7 @@ def schedule_tasks(self, reference_datetime=None):
+
+ if task.should_be_updated(reference_datetime):
+ self.tasks_scheduled.add(task.id_)
+- self.async.enqueue(
++ self.async_manager.enqueue(
+ System.AsyncUpdateTaskAction(
+ self,
+ task.id_,
+@@ -662,7 +662,7 @@ def generate_fix_for_task_result(self, task_id, result_id, fix_type):
+ fix_type
+ )
+
+- class AsyncEvaluateCVEScannerWorkerAction(async.AsyncAction):
++ class AsyncEvaluateCVEScannerWorkerAction(async_tools.AsyncAction):
+ def __init__(self, system, worker):
+ super(System.AsyncEvaluateCVEScannerWorkerAction, self).__init__()
+
+@@ -680,7 +680,7 @@ def __str__(self):
+ return "Evaluate CVE Scanner Worker '%s'" % (self.worker)
+
+ def evaluate_cve_scanner_worker_async(self, worker):
+- return self.async.enqueue(
++ return self.async_manager.enqueue(
+ System.AsyncEvaluateCVEScannerWorkerAction(
+ self,
+ worker
+diff --git a/tests/unit/test_basic_update.py b/tests/unit/test_basic_update.py
+index 6f683e6..7f953f7 100755
+--- a/tests/unit/test_basic_update.py
++++ b/tests/unit/test_basic_update.py
+@@ -37,8 +37,9 @@ def test(self):
+ print(self.system.tasks)
+ self.system.schedule_tasks()
+
+- while len(self.system.async.actions) > 0:
++ while len(self.system.async_manager.actions) > 0:
+ time.sleep(1)
+
++
+ if __name__ == "__main__":
+ BasicUpdateTest.run()