From 837927e89f65a6a40c546ea416addab36dcf9b84 Mon Sep 17 00:00:00 2001 From: Martin Kutlak Date: Jan 21 2020 11:37:45 +0000 Subject: New release 1.20.0 Plus updated spec and extra patches fixing few issues in 1.20.0 Signed-off-by: Martin Kutlak --- diff --git a/.gitignore b/.gitignore index a463b74..9bc0c25 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /retrace-server-1.17.0.tar.gz /retrace-server-1.18.0.tar.gz /retrace-server-1.19.0.tar.gz +/retrace-server-1.20.0.tar.gz diff --git a/0001-retrace-server-worker-Correct-import-of-ArgumentPars.patch b/0001-retrace-server-worker-Correct-import-of-ArgumentPars.patch new file mode 100644 index 0000000..6953005 --- /dev/null +++ b/0001-retrace-server-worker-Correct-import-of-ArgumentPars.patch @@ -0,0 +1,29 @@ +From 3762f8ce5b36db9748d96f8f77144a006a9f4d22 Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Wed, 30 Oct 2019 16:12:44 +0100 +Subject: [PATCH] retrace-server-worker: Correct import of ArgumentParser + +The custom ArgumentParser has a `_log` attribute. + +Signed-off-by: Martin Kutlak +--- + src/retrace-server-worker | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/retrace-server-worker b/src/retrace-server-worker +index 97f7939..a77d8ff 100755 +--- a/src/retrace-server-worker ++++ b/src/retrace-server-worker +@@ -1,8 +1,7 @@ + #!/usr/bin/python3 + import sys + import os +-from argparse import ArgumentParser +- ++from retrace.argparser import ArgumentParser + from retrace.retrace import (log_debug, + log_error, + log_warn, +-- +2.24.1 + diff --git a/0002-retrace_worker-Fix-file-mode-to-write-to-file.patch b/0002-retrace_worker-Fix-file-mode-to-write-to-file.patch new file mode 100644 index 0000000..f06b5e1 --- /dev/null +++ b/0002-retrace_worker-Fix-file-mode-to-write-to-file.patch @@ -0,0 +1,30 @@ +From 9c37cd5cf52d2124e45e09c800170b36dd241872 Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Wed, 30 Oct 2019 16:06:43 +0100 +Subject: [PATCH] retrace_worker: Fix file mode to write to file + +Introduced in 9e79d410d9b5a882fa3770f24b78f930def9ab29 + +The default file mode used to be "write" but it was changed to write raw bytes. + +Signed-off-by: Martin Kutlak +--- + src/retrace/retrace_worker.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/retrace/retrace_worker.py b/src/retrace/retrace_worker.py +index cc98138..2ac8f6e 100644 +--- a/src/retrace/retrace_worker.py ++++ b/src/retrace/retrace_worker.py +@@ -563,7 +563,7 @@ class RetraceWorker(object): + + task.set_backtrace(backtrace) + if exploitable is not None: +- task.add_results("exploitable", exploitable) ++ task.add_results("exploitable", exploitable, mode="w") + + self.hook_post_retrace() + +-- +2.24.1 + diff --git a/0003-retrace_worker-Remove-distro-hack-from-mock-config.patch b/0003-retrace_worker-Remove-distro-hack-from-mock-config.patch new file mode 100644 index 0000000..50c5b9d --- /dev/null +++ b/0003-retrace_worker-Remove-distro-hack-from-mock-config.patch @@ -0,0 +1,85 @@ +From aba277baf04346ea21d22adbeb97ab62d9a49c65 Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Fri, 1 Nov 2019 15:04:59 +0100 +Subject: [PATCH] retrace_worker: Remove distro hack from mock config + +Introduced in 5a1e21a0f6ca8174a88f4eaf37887100e0ec311b + +As `dnf` is now available on both RHEL(7,8) and Fedora (and with the `--skip-broken` switch support), +we can remove the `distro` "hack". + +Signed-off-by: Martin Kutlak +--- + retrace-server.spec.in | 1 - + src/retrace/retrace_worker.py | 19 +++++-------------- + 2 files changed, 5 insertions(+), 15 deletions(-) + +diff --git a/retrace-server.spec.in b/retrace-server.spec.in +index 5f5bbea..3b8d033 100644 +--- a/retrace-server.spec.in ++++ b/retrace-server.spec.in +@@ -40,7 +40,6 @@ Requires: python3-webob + Requires: python3-magic + Requires: python3-requests + Requires: python3-requests-gssapi +-Requires: python3-distro + Requires: python3-bugzilla + Requires: python3-six + Requires: python3-dnf +diff --git a/src/retrace/retrace_worker.py b/src/retrace/retrace_worker.py +index 2ac8f6e..82748ac 100644 +--- a/src/retrace/retrace_worker.py ++++ b/src/retrace/retrace_worker.py +@@ -9,7 +9,6 @@ import shutil + import stat + from subprocess import Popen, PIPE, STDOUT + +-import distro + from .retrace import (ALLOWED_FILES, INPUT_PACKAGE_PARSER, REPO_PREFIX, REQUIRED_FILES, + STATUS, STATUS_ANALYZE, STATUS_BACKTRACE, STATUS_CLEANUP, + STATUS_FAIL, STATUS_INIT, STATUS_STATS, STATUS_SUCCESS, +@@ -473,20 +472,14 @@ class RetraceWorker(object): + # create mock config file + try: + repopath = os.path.join(CONFIG["RepoDir"], releaseid) +- linux_dist = distro.linux_distribution(full_distribution_name=False) + with open(os.path.join(task.get_savedir(), RetraceTask.MOCK_DEFAULT_CFG), "w") as mockcfg: + mockcfg.write("config_opts['root'] = '%d'\n" % task.get_taskid()) + mockcfg.write("config_opts['target_arch'] = '%s'\n" % arch) +- mockcfg.write("config_opts['chroot_setup_cmd'] = '") +- if linux_dist[0] == "fedora": +- mockcfg.write("--setopt=strict=0") +- else: +- mockcfg.write("--skip-broken") ++ mockcfg.write("config_opts['chroot_setup_cmd'] = '--skip-broken") + mockcfg.write(" install %s abrt-addon-ccpp shadow-utils %s rpm'\n" % (" ".join(packages), + self.plugin.gdb_package)) +- mockcfg.write("config_opts['releasever'] = '%s'\n" % linux_dist[1]) +- if linux_dist[0] == "fedora": +- mockcfg.write("config_opts['package_manager'] = 'dnf'\n") ++ mockcfg.write("config_opts['releasever'] = '%s'\n" % version) ++ mockcfg.write("config_opts['package_manager'] = 'dnf'\n") + mockcfg.write("config_opts['plugin_conf']['ccache_enable'] = False\n") + mockcfg.write("config_opts['plugin_conf']['yum_cache_enable'] = False\n") + mockcfg.write("config_opts['plugin_conf']['root_cache_enable'] = False\n") +@@ -725,15 +718,13 @@ class RetraceWorker(object): + + try: + cfgfile = os.path.join(cfgdir, RetraceTask.MOCK_DEFAULT_CFG) +- linux_dist = distro.linux_distribution(full_distribution_name=False) + with open(cfgfile, "w") as mockcfg: + mockcfg.write("config_opts['root'] = '%d-kernel'\n" % task.get_taskid()) + mockcfg.write("config_opts['target_arch'] = '%s'\n" % kernelver.arch) + mockcfg.write("config_opts['chroot_setup_cmd'] = 'install bash coreutils cpio " + "crash findutils rpm shadow-utils'\n") +- mockcfg.write("config_opts['releasever'] = '%s'\n" % linux_dist[1]) +- if linux_dist[0] == "fedora": +- mockcfg.write("config_opts['package_manager'] = 'dnf'\n") ++ mockcfg.write("config_opts['releasever'] = '%s'\n" % kernelver_str) ++ mockcfg.write("config_opts['package_manager'] = 'dnf'\n") + mockcfg.write("config_opts['plugin_conf']['ccache_enable'] = False\n") + mockcfg.write("config_opts['plugin_conf']['yum_cache_enable'] = False\n") + mockcfg.write("config_opts['plugin_conf']['root_cache_enable'] = False\n") +-- +2.24.1 + diff --git a/0004-r-s-reposync-Replace-old-way-of-cmp-with-key.patch b/0004-r-s-reposync-Replace-old-way-of-cmp-with-key.patch new file mode 100644 index 0000000..5dd488a --- /dev/null +++ b/0004-r-s-reposync-Replace-old-way-of-cmp-with-key.patch @@ -0,0 +1,37 @@ +From 4e1a2f749b560e09a07328f013ba07bc68707df8 Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Mon, 6 Jan 2020 14:00:36 +0100 +Subject: [PATCH] r-s-reposync: Replace old way of cmp with key + +See: +https://docs.python.org/3/library/functools.html#functools.cmp_to_key + +Signed-off-by: Martin Kutlak +--- + src/retrace-server-reposync | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/retrace-server-reposync b/src/retrace-server-reposync +index 457a4e1..22761cd 100755 +--- a/src/retrace-server-reposync ++++ b/src/retrace-server-reposync +@@ -11,6 +11,7 @@ import tempfile + import rpm + import dnf + ++from functools import cmp_to_key + from subprocess import Popen, PIPE, call + + from retrace.retrace import (get_canon_arch, +@@ -173,7 +174,7 @@ def clean_rawhide_repo(release): + for package in packages: + pkgcnt = len(packages[package]) + if pkgcnt > CONFIG["KeepRawhideLatest"]: +- vers = sorted(packages[package].keys(), cmp=vercmp) ++ vers = sorted(packages[package].keys(), key=cmp_to_key(vercmp)) + i = 0 + for ver in vers: + for filename in packages[package][ver]: +-- +2.24.1 + diff --git a/retrace-server.spec b/retrace-server.spec index 2e381af..8c08002 100644 --- a/retrace-server.spec +++ b/retrace-server.spec @@ -1,23 +1,32 @@ Summary: Application for remote coredump analysis Name: retrace-server -Version: 1.19.0 -Release: 5%{?dist} +Version: 1.20.0 +Release: 1%{?dist} License: GPLv2+ URL: https://github.com/abrt/retrace-server Source0: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz -%if 0%{fedora} >= 29 +%if 0%{?fedora} >= 29 # There are Python plugins in /usr/share/retrace-server/plugins %global _python_bytecompile_extra 0 %endif +# Patches to be applied: +Patch0001: 0001-retrace-server-worker-Correct-import-of-ArgumentPars.patch +Patch0002: 0002-retrace_worker-Fix-file-mode-to-write-to-file.patch +Patch0003: 0003-retrace_worker-Remove-distro-hack-from-mock-config.patch +Patch0004: 0004-r-s-reposync-Replace-old-way-of-cmp-with-key.patch + BuildArch: noarch +BuildRequires: git-core + BuildRequires: intltool BuildRequires: libtool BuildRequires: texinfo BuildRequires: asciidoc BuildRequires: xmlto +BuildRequires: lsof BuildRequires: python3-six BuildRequires: python3-devel @@ -30,14 +39,14 @@ Requires: tar Requires: p7zip Requires: unzip Requires: lzop +Requires: lsof Requires: elfutils Requires: createrepo_c Requires: python3-mod_wsgi Requires: python3-webob Requires: python3-magic Requires: python3-requests -Requires: python3-requests-kerberos -Requires: python3-distro +Requires: python3-requests-gssapi Requires: python3-bugzilla Requires: python3-six Requires: python3-dnf @@ -61,35 +70,35 @@ The retrace server provides a coredump analysis and backtrace generation service over a network using HTTP protocol. %prep -%setup -q +%autosetup -S git %build autoconf %configure -make %{?_smp_mflags} +%make_build %install -make install DESTDIR=${RPM_BUILD_ROOT} mandir=%{_mandir} +%make_install # Remove byte-compiled python files generated by automake. # automake uses system's python for all *.py files, even # for those which needs to be byte-compiled with different # version (python2/python3). # rpm can do this work and use the appropriate python version. -find $RPM_BUILD_ROOT -name "*.py[co]" -delete +find %{buildroot} -name "*.py[co]" -delete -mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/cache/%{name} -mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/cache/%{name}/kernel -mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/cache/%{name}/download -mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/log/%{name} -mkdir -p ${RPM_BUILD_ROOT}/%{_localstatedir}/spool/%{name} -mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}/%{name} +mkdir -p %{buildroot}%{_localstatedir}/cache/%{name} +mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}/kernel +mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}/download +mkdir -p %{buildroot}%{_localstatedir}/log/%{name} +mkdir -p %{buildroot}%{_localstatedir}/spool/%{name} +mkdir -p %{buildroot}%{_datadir}/%{name} -%if 0%{fedora} >= 29 -%py_byte_compile %{__python3} ${RPM_BUILD_ROOT}%{_datadir}/%{name}/plugins +%if 0%{?fedora} >= 29 +%py_byte_compile %{__python3} %{buildroot}%{_datadir}/%{name}/plugins %endif -rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir +rm -f %{buildroot}%{_infodir}/dir %{find_lang} %{name} @@ -151,7 +160,6 @@ fi %{_bindir}/%{name}-task %{_bindir}/%{name}-bugzilla-refresh %{_bindir}/%{name}-bugzilla-query -%{_bindir}/bt_filter %{_bindir}/coredump2packages %{python3_sitelib}/retrace/ %{_datadir}/%{name}/ @@ -165,6 +173,66 @@ fi %license COPYING %changelog +* Tue Jan 21 2020 Martin Kutlak 1.20.0-1 +- Update spec +- Add patches +- Bump Fedora Release in Dockerfile +- retrace_worker: Use kernelver_str var +- retrace_worker: Remove unused variables +- retrace: Remove unused variable +- retrace: Use converted integer value +- retrace: Remove unsused variable +- pylint: Fix wrong indentations +- pylint W0702: Fix-up bare exceptions +- pylint: Fix spacing issues +- Remove Python2/Python3 compatibility code +- pylint E713: Test for membership should be ‘not in’ +- retrace: Refactor asterisk imports of retrace +- Translation updates +- Add new translation languages - tr +- Add transtalations from Fedora Zanata +- Remove workdir functionality +- retrace-server-interact: Fix undefined self var +- retrace: Fix undefined vmcore variable +- Fix typos +- Fix typos and minor grammar issues +- Switch to requests-gssapi +- create: Fix strip_extra_pages() invocation +- plugins: Add el8 to versionlist +- plugins: Add plugin for CentOS +- plugins: Update fedora versionlist +- plugins: Update devtoolset version +- stats: Display whole release version +- Use sys.exit instead of exit for retrace-server commands +- Move makedumpfile logic from download_remote into start_vmcore +- Move prepare_debuginfo to KernelVMcore +- Remove call to prepare_debuginfo from retrace-server-interact +- Move get_kernel_release to KernelVMcore +- Move strip_vmcore to KernelVMcore.strip_extra_pages +- Add KernelVMcore.has_extra_pages method +- Move get_vmcore_dump_level to KernelVMcore.get_dump_level +- Handle 'flattened' vmcore format by converting with makedumpfile +- Pass 'results' directory to hook script rather than task_dir. +- Rename 'misc' methods and subdirectory to 'results'. +- delete: Fix typo in function name +- Clean up handling of mock with x86 vmcores in x86_64 environments +- Remove bt_filter from retrace-server +- Remove excess post-retrace crash commands +- Make retrace-server-cleanup more resilient to non-existent tasks +- retrace: Allow tilde in package names +- spec: Use macros instead of environment variables +- Fix module extraction from kernel-debuginfo +- Move ProcessCommunicateTimeout inside run_crash_cmdline +- Move run_crash_cmdline from RetraceWorker to RetraceTask +- Fix backtrace of bt_filter on Python3 +- Remove 'utf-8' encoding for run_crash_cmd and change related functions. +- Refactor crash commands run after prepare_debuginfo into run_crash_cmdline helper +- worker: Add string formatting for provided arguments +- worker: Remove unused function +- worker: Use log_error function to log errors +- Fix runaway crash processes due to either corrupted vmcore memory or files. +- Fix backtrace when updating bugzillano from web UI due to use of basestring + * Thu Oct 03 2019 Miro Hrončok - 1.19.0-5 - Rebuilt for Python 3.8.0rc1 (#1748018) diff --git a/sources b/sources index 5bfe366..2eb1921 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (retrace-server-1.19.0.tar.gz) = a225e78f9ee39fa5445bc6293131747341305bb4ab908291e369b83e1e519bad79e2f7c0faa2fb48752201f2f31934ede7697f4c7abc6eb89ea09a48df13529c +SHA512 (retrace-server-1.20.0.tar.gz) = 50f5d1557edda838717c046c476e7f0271d6802f17dd851c3d51585b8b3d7601df3fb90f27c1c6cbe9a6c748ef75a40edaeb4271b06b3c72b766ac41640f7f43