From 3bdc0e8e73f4d8408aaf76f48e375fdbf94269d8 Mon Sep 17 00:00:00 2001 From: Matej Habrnal Date: Thu, 1 Mar 2018 11:08:59 +0100 Subject: [PATCH 1/9] Add report and reportclient directories to rpm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Ralf Corsépius Signed-off-by: Matej Habrnal --- libreport.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libreport.spec b/libreport.spec index dce5863..cc2cbba 100644 --- a/libreport.spec +++ b/libreport.spec @@ -4,7 +4,7 @@ Summary: Generic library for reporting various problems Name: libreport Version: 2.9.3 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz @@ -500,12 +500,12 @@ make check|| { %{_libdir}/pkgconfig/libreport-web.pc %files -n python2-libreport -%{python_sitearch}/report/* -%{python_sitearch}/reportclient/* +%{python_sitearch}/report +%{python_sitearch}/reportclient %files -n python3-libreport -%{python3_sitearch}/report/* -%{python3_sitearch}/reportclient/* +%{python3_sitearch}/report +%{python3_sitearch}/reportclient %files cli %{_bindir}/report-cli @@ -738,6 +738,9 @@ make check|| { %changelog +* Thu Mar 01 2018 Matej Habrnal 2.9.3-7 +- Add report and reportclient directories to rpm + * Wed Feb 07 2018 Fedora Release Engineering - 2.9.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 642cad783f02257332dfc3c799ce0ba8e196f1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Tue, 6 Mar 2018 15:15:39 +0100 Subject: [PATCH 2/9] Rebuilt for libjson-c.so.4 (json-c v0.13.1) --- libreport.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libreport.spec b/libreport.spec index cc2cbba..813ab12 100644 --- a/libreport.spec +++ b/libreport.spec @@ -4,7 +4,7 @@ Summary: Generic library for reporting various problems Name: libreport Version: 2.9.3 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz @@ -738,6 +738,9 @@ make check|| { %changelog +* Tue Mar 06 2018 Björn Esser - 2.9.3-8 +- Rebuilt for libjson-c.so.4 (json-c v0.13.1) + * Thu Mar 01 2018 Matej Habrnal 2.9.3-7 - Add report and reportclient directories to rpm From edb863a1e9170adcfdd09cf95b6e68ce29e8bd8a Mon Sep 17 00:00:00 2001 From: Martin Kutlak Date: Tue, 27 Mar 2018 18:54:57 +0200 Subject: [PATCH 3/9] New upstream release 2.9.4 Signed-off-by: Martin Kutlak --- libreport-2.9.3_fix_json-c_013.patch | 25 ---------------- libreport.spec | 44 ++++++++++++++++++---------- sources | 2 +- 3 files changed, 29 insertions(+), 42 deletions(-) delete mode 100644 libreport-2.9.3_fix_json-c_013.patch diff --git a/libreport-2.9.3_fix_json-c_013.patch b/libreport-2.9.3_fix_json-c_013.patch deleted file mode 100644 index a343bb8..0000000 --- a/libreport-2.9.3_fix_json-c_013.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ad6b52edd4c36b413d3bac6cb03f35369dae1d28 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= -Date: Sun, 10 Dec 2017 20:20:21 +0100 -Subject: [PATCH 2/2] Fix build against libjson-c.so.3 - ---- - src/lib/ureport.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lib/ureport.c b/src/lib/ureport.c -index 9e8bbd6..81f0791 100644 ---- a/src/lib/ureport.c -+++ b/src/lib/ureport.c -@@ -609,7 +609,7 @@ ureport_server_response_from_reply(post_state_t *post_state, - - json_object *const json = json_tokener_parse(post_state->body); - -- if (is_error(json)) -+ if (json == NULL) - { - error_msg(_("Unable to parse response from ureport server at '%s'"), config->ur_url); - log_notice("%s", post_state->body); --- -2.15.1 - diff --git a/libreport.spec b/libreport.spec index 813ab12..63905a8 100644 --- a/libreport.spec +++ b/libreport.spec @@ -3,16 +3,13 @@ Summary: Generic library for reporting various problems Name: libreport -Version: 2.9.3 -Release: 8%{?dist} +Version: 2.9.4 +Release: 1%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source1: autogen.sh -# Needed for libjson-c.so.3*. -# See: https://github.com/json-c/json-c/issues/304 -Patch0: libreport-2.9.3_fix_json-c_013.patch # git format-patch %%{Version} -N -M --topo-order # i=0; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done @@ -96,11 +93,6 @@ Development headers for libreport-web Summary: Python bindings for report-libs Requires: libreport = %{version}-%{release} Requires: python2-dnf -# in report the rhtsupport is in the main package, so we need to install it too -# report is only in RHEL6, we do not need to carry the dependency to newer RHELs -%if 0%{?rhel} == 6 -Requires: libreport-plugin-rhtsupport = %{version}-%{release} -%endif %{?python_provide:%python_provide python2-libreport} # Remove before F30 Provides: %{name}-python = %{version}-%{release} @@ -340,7 +332,11 @@ cp %SOURCE1 %_builddir/%{name}-%{version} %build # Commented because of deprecated GTK API #CFLAGS="%%{optflags} -Werror" %%configure --disable-silent-rules -CFLAGS="%{optflags}" %configure --enable-doxygen-docs --disable-silent-rules +CFLAGS="%{optflags}" %configure --enable-doxygen-docs \ +%if 0%{?rhel} + --enable-import-rhtsupport-cert \ +%endif + --disable-silent-rules make %{?_smp_mflags} %install @@ -435,7 +431,6 @@ make check|| { %ldconfig_scriptlets web %files -f %{name}.lang -%defattr(-,root,root,-) %doc README.md %license COPYING %config(noreplace) %{_sysconfdir}/%{name}/libreport.conf @@ -457,6 +452,9 @@ make check|| { %dir %{_sysconfdir}/%{name}/events.d/ %dir %{_sysconfdir}/%{name}/events/ %dir %{_sysconfdir}/%{name}/workflows.d/ +%dir %{_datadir}/%{name}/ +%dir %{_datadir}/%{name}/conf.d/ +%dir %{_datadir}/%{name}/conf.d/plugins/ %dir %{_datadir}/%{name}/events/ %dir %{_datadir}/%{name}/workflows/ %dir %{_sysconfdir}/%{name}/plugins/ @@ -500,12 +498,12 @@ make check|| { %{_libdir}/pkgconfig/libreport-web.pc %files -n python2-libreport -%{python_sitearch}/report -%{python_sitearch}/reportclient +%{python_sitearch}/report/ +%{python_sitearch}/reportclient/ %files -n python3-libreport -%{python3_sitearch}/report -%{python3_sitearch}/reportclient +%{python3_sitearch}/report/ +%{python3_sitearch}/reportclient/ %files cli %{_bindir}/report-cli @@ -637,6 +635,9 @@ make check|| { %{_datadir}/%{name}/events/report_RHTSupport.xml %{_datadir}/%{name}/events/report_RHTSupport_AddData.xml %{_datadir}/dbus-1/interfaces/com.redhat.problems.configuration.rhtsupport.xml +%if 0%{?rhel} +%attr(600,root,root)%{_sysconfdir}/%{name}/cert-api.access.redhat.com.pem +%endif %config(noreplace) %{_sysconfdir}/libreport/events.d/rhtsupport_event.conf %{_mandir}/man1/reporter-rhtsupport.1.gz %{_mandir}/man5/rhtsupport.conf.5.* @@ -738,6 +739,17 @@ make check|| { %changelog +* Tue Mar 27 2018 Martin Kutlak - 2.9.4-1 +- Translation updates +- ureport: remove json-c is_error() usage +- reporter-rhtsupport: Remove dependency on redhat-access-insights +- reporter-mailx: rely on configured email +- Modernize spec file +- augeas: include local config path +- doc: update to contain newly added user's local config +- reporter-{mantisbt,rhtsupport,bugzilla}: read configuration from user's home +- reporter-bugzilla: ask concrete bz when requiring login + * Tue Mar 06 2018 Björn Esser - 2.9.3-8 - Rebuilt for libjson-c.so.4 (json-c v0.13.1) diff --git a/sources b/sources index be9654e..7bb1428 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libreport-2.9.3.tar.gz) = f4cdf6a0ffb18db224f47391e0e8ac26491ac105051ec511e575b10a1ffbbbaa2290827ad27cc622ece5d5291141cf1083dce0d3b778657d309aa8d5d8799473 +SHA512 (libreport-2.9.4.tar.gz) = 060e8d2929397a48f8c213758eff06583afbdc77cdfa186999b35dc545076890f0112b190df635c9681565c4ccbee1be7653a31a702dc612e15703d273d9039f From 7bcb28662de553520750872bb99ce79ac25d3f5e Mon Sep 17 00:00:00 2001 From: Matej Habrnal Date: Wed, 25 Apr 2018 12:56:58 +0200 Subject: [PATCH 4/9] New upstream release 2.9.5 Signed-off-by: Matej Habrnal --- .gitignore | 4 +- libreport.spec | 363 ++++++++++++++++++++++++++++--------------------- sources | 2 +- 3 files changed, 210 insertions(+), 159 deletions(-) diff --git a/.gitignore b/.gitignore index bbf2a56..0465349 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -/libreport-2.*.tar.gz +/libreport-2.9.3.tar.gz +/libreport-2.9.4.tar.gz +/libreport-2.9.5.tar.gz diff --git a/libreport.spec b/libreport.spec index 63905a8..dd198a6 100644 --- a/libreport.spec +++ b/libreport.spec @@ -1,30 +1,48 @@ -%global satyr_ver 0.24 -%global glib_ver 2.43 +%if 0%{?suse_version} + %bcond_with bugzilla + + %define dbus_devel dbus-1-devel + %define libjson_devel libjson-devel +%else + %bcond_without bugzilla + + %define dbus_devel dbus-devel + %define libjson_devel json-c-devel +%endif + +%define glib_ver 2.43 + +%if 0%{?fedora} || 0%{?rhel} > 7 +# Enable python3 build by default +%bcond_without python3 +%else +%bcond_with python3 +%endif + +%if 0%{?rhel} > 7 || 0%{?fedora} > 28 +# Disable python2 build by default +%bcond_with python2 +%else +%bcond_without python2 +%endif Summary: Generic library for reporting various problems Name: libreport -Version: 2.9.4 +Version: 2.9.5 Release: 1%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz -Source1: autogen.sh - - -# git format-patch %%{Version} -N -M --topo-order -# i=0; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done - -# git is need for '%%autosetup -S git' which automatically applies all the -# patches above. Please, be aware that the patches must be generated -# by 'git format-patch' -BuildRequires: git - -BuildRequires: dbus-devel +BuildRequires: %{dbus_devel} BuildRequires: gtk3-devel BuildRequires: curl-devel BuildRequires: desktop-file-utils +%if %{with python2} BuildRequires: python2-devel +%endif # with python2 +%if %{with python3} BuildRequires: python3-devel +%endif # with python3 BuildRequires: gettext BuildRequires: libxml2-devel BuildRequires: libtar-devel @@ -35,29 +53,34 @@ BuildRequires: asciidoc BuildRequires: xmlto BuildRequires: newt-devel BuildRequires: libproxy-devel -BuildRequires: satyr-devel >= %{satyr_ver} +BuildRequires: satyr-devel >= 0.24 BuildRequires: glib2-devel >= %{glib_ver} +%if 0%{?fedora} >= 24 || 0%{?rhel} > 7 +# A test case uses zh_CN locale to verify XML event translations BuildRequires: glibc-all-langpacks +%endif + +%if %{with bugzilla} BuildRequires: xmlrpc-c-devel +%endif BuildRequires: doxygen BuildRequires: systemd-devel BuildRequires: augeas-devel BuildRequires: augeas BuildRequires: xz BuildRequires: lz4 +Requires: libreport-filesystem = %{version}-%{release} +Requires: satyr >= 0.24 +Requires: glib2 >= %{glib_ver} +Requires: xz +Requires: lz4 # Required for the temporary modularity hack, see below %if 0%{?_module_build} BuildRequires: sed %endif -Requires: libreport-filesystem = %{version}-%{release} -Requires: satyr >= %{satyr_ver} -Requires: glib2 >= %{glib_ver} -Requires: xz -Requires: lz4 - %description Libraries providing API for reporting different problems in applications to different bug targets like Bugzilla, ftp, trac, etc... @@ -89,6 +112,7 @@ Requires: libreport-web = %{version}-%{release} %description web-devel Development headers for libreport-web +%if %{with python2} %package -n python2-libreport Summary: Python bindings for report-libs Requires: libreport = %{version}-%{release} @@ -101,7 +125,9 @@ Obsoletes: %{name}-python < %{version}-%{release} %description -n python2-libreport Python bindings for report-libs. +%endif # with python2 +%if %{with python3} %package -n python3-libreport Summary: Python 3 bindings for report-libs %if 0%{?_module_build} @@ -124,6 +150,7 @@ Obsoletes: %{name}-python3 < %{version}-%{release} %description -n python3-libreport Python 3 bindings for report-libs. +%endif # with python3 %package cli Summary: %{name}'s command line interface @@ -147,7 +174,7 @@ bugs Summary: GTK front-end for libreport Requires: libreport = %{version}-%{release} Requires: libreport-plugin-reportuploader = %{version}-%{release} -Requires: fros >= 1.1-2 +Requires: fros >= 1.0 Provides: report-gtk = 0:0.23-1 Obsoletes: report-gtk < 0:0.23-1 @@ -194,6 +221,7 @@ Requires: mailx The simple reporter plugin which sends a report via mailx to a specified email address. +%if %{with bugzilla} %package plugin-bugzilla Summary: %{name}'s bugzilla plugin Requires: %{name} = %{version}-%{release} @@ -201,6 +229,7 @@ Requires: libreport-web = %{version}-%{release} %description plugin-bugzilla Plugin to report bugs into the bugzilla. +%endif %package plugin-mantisbt Summary: %{name}'s mantisbt plugin @@ -221,7 +250,7 @@ Workflows to report issues into the CentOS Bug Tracker. %package plugin-ureport Summary: %{name}'s micro report plugin -BuildRequires: json-c-devel +BuildRequires: %{libjson_devel} Requires: %{name} = %{version}-%{release} Requires: libreport-web = %{version}-%{release} %if 0%{?rhel} @@ -235,13 +264,11 @@ Uploads micro-report to abrt server Summary: %{name}'s RHTSupport plugin Requires: %{name} = %{version}-%{release} Requires: libreport-web = %{version}-%{release} -%if 0%{?rhel} -Requires: redhat-access-insights -%endif %description plugin-rhtsupport Plugin to report bugs into RH support system. +%if %{with bugzilla} %package compat Summary: %{name}'s compat layer for obsoleted 'report' package Requires: libreport = %{version}-%{release} @@ -250,6 +277,7 @@ Requires: %{name}-plugin-rhtsupport = %{version}-%{release} %description compat Provides 'report' command-line tool. +%endif %package plugin-reportuploader Summary: %{name}'s reportuploader plugin @@ -302,6 +330,7 @@ to easily configure the reporting process for Red Hat systems. Just install this package and you're done. %endif +%if %{with bugzilla} %package anaconda Summary: Default configuration for reporting anaconda bugs Requires: %{name} = %{version}-%{release} @@ -315,28 +344,30 @@ Requires: libreport-plugin-bugzilla = %{version}-%{release} %description anaconda Default configuration for reporting Anaconda problems or uploading the gathered data over ftp/scp... +%endif %prep -# http://www.rpm.org/wiki/PackagerDocs/Autosetup -# Default '__scm_apply_git' is 'git apply && git commit' but this workflow -# doesn't allow us to create a new file within a patch, so we have to use -# 'git am' (see /usr/lib/rpm/macros for more details) -%global __scm_apply_git(qp:m:) %{__git} am --exclude src/report-python/libreport-meh-test.py -#%%global __scm_apply_git(qp:m:) %%{__git} am --exclude libreport.spec.in --exclude .gitignore -%autosetup -S git -p 1 - -# koji in f19 has new autotools, so we need to regenerate everything -cp %SOURCE1 %_builddir/%{name}-%{version} -./autogen.sh +%setup -q %build -# Commented because of deprecated GTK API -#CFLAGS="%%{optflags} -Werror" %%configure --disable-silent-rules -CFLAGS="%{optflags}" %configure --enable-doxygen-docs \ -%if 0%{?rhel} - --enable-import-rhtsupport-cert \ +autoconf + +CFLAGS="%{optflags} -Werror" %configure \ +%if %{without python2} + --without-python2 \ +%endif # with python2 +%if %{without python3} + --without-python3 \ +%endif # with python3 +%if %{without bugzilla} + --without-bugzilla \ %endif - --disable-silent-rules +%if 0%{?rhel} + --enable-import-rhtsupport-cert \ +%endif + --enable-doxygen-docs \ + --disable-silent-rules + make %{?_smp_mflags} %install @@ -416,8 +447,6 @@ rm -f %{buildroot}%{_mandir}/man5/report_uReport.conf.5 rm -f %{buildroot}%{_mandir}/man5/report_rhel_bugzilla.conf.5 %endif -%clean - %check make check|| { # find and print the logs of failed test @@ -426,9 +455,34 @@ make check|| { exit 1 } -%ldconfig_scriptlets -%ldconfig_scriptlets gtk -%ldconfig_scriptlets web +%if 0%{?fedora} > 27 || 0%{?rhel} > 7 +# ldconfig and gtk-update-icon-cache is not needed +%else +%post gtk +/sbin/ldconfig +# update icon cache +touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%postun gtk +/sbin/ldconfig +if [ $1 -eq 0 ] ; then + touch --no-create %{_datadir}/icons/hicolor &>/dev/null + gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi + +%posttrans gtk +gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + + +%post web -p /sbin/ldconfig + + +%postun web -p /sbin/ldconfig +%endif %files -f %{name}.lang %doc README.md @@ -497,13 +551,17 @@ make check|| { %{_includedir}/libreport/libreport_curl.h %{_libdir}/pkgconfig/libreport-web.pc +%if %{with python2} %files -n python2-libreport %{python_sitearch}/report/ %{python_sitearch}/reportclient/ +%endif # with python2 +%if %{with python3} %files -n python3-libreport %{python3_sitearch}/report/ %{python3_sitearch}/reportclient/ +%endif # with python3 %files cli %{_bindir}/report-cli @@ -572,6 +630,7 @@ make check|| { %{_datadir}/%{name}/events/report_uReport.xml %{_datadir}/dbus-1/interfaces/com.redhat.problems.configuration.ureport.xml +%if %{with bugzilla} %files plugin-bugzilla %config(noreplace) %{_sysconfdir}/libreport/plugins/bugzilla.conf %{_datadir}/%{name}/conf.d/plugins/bugzilla.conf @@ -594,6 +653,7 @@ make check|| { %{_mandir}/man5/bugzilla_format_analyzer_libreport.conf.5.* %{_mandir}/man5/bugzilla_format_kernel.conf.5.* %{_bindir}/reporter-bugzilla +%endif %files plugin-mantisbt %config(noreplace) %{_sysconfdir}/libreport/plugins/mantisbt.conf @@ -627,7 +687,7 @@ make check|| { %{_mandir}/man5/report_CentOSBugTracker.conf.5.* # report_CentOSBugTracker events are shipped by libreport package %config(noreplace) %{_sysconfdir}/libreport/events.d/centos_report_event.conf -%{_mandir}/man5/centos_report_event.conf.5.* +%{_mandir}/man5/centos_report_event.conf.5.gz %files plugin-rhtsupport %config(noreplace) %{_sysconfdir}/libreport/plugins/rhtsupport.conf @@ -644,9 +704,11 @@ make check|| { %{_mandir}/man5/rhtsupport_event.conf.5.* %{_bindir}/reporter-rhtsupport +%if %{with bugzilla} %files compat %{_bindir}/report %{_mandir}/man1/report.1.gz +%endif %files plugin-reportuploader %{_mandir}/man*/reporter-upload.* @@ -657,9 +719,9 @@ make check|| { %{_datadir}/%{name}/workflows/workflow_Upload.xml %{_datadir}/%{name}/workflows/workflow_UploadCCpp.xml %config(noreplace) %{_sysconfdir}/libreport/plugins/upload.conf +%{_datadir}/%{name}/conf.d/plugins/upload.conf %{_mandir}/man5/upload.conf.5.* %config(noreplace) %{_sysconfdir}/libreport/workflows.d/report_uploader.conf -%{_datadir}/%{name}/conf.d/plugins/upload.conf %{_mandir}/man5/report_uploader.conf.5.* %config(noreplace) %{_sysconfdir}/libreport/events/report_Uploader.conf %{_mandir}/man5/report_Uploader.conf.5.* @@ -720,6 +782,7 @@ make check|| { %{_datadir}/%{name}/workflows/workflow_AnacondaRHELBugzilla.xml %endif +%if %{with bugzilla} %files anaconda %if 0%{?fedora} %{_datadir}/%{name}/workflows/workflow_AnacondaFedora.xml @@ -736,42 +799,37 @@ make check|| { %{_mandir}/man5/bugzilla_anaconda_event.conf.5.* %{_mandir}/man5/bugzilla_format_anaconda.conf.5.* %{_mandir}/man5/bugzilla_formatdup_anaconda.conf.5.* - +%endif %changelog -* Tue Mar 27 2018 Martin Kutlak - 2.9.4-1 +* Tue Apr 24 2018 Matej Habrnal 2.9.5-1 +- spec: actualize according to downstream +- spec: Conditionalize the Python2 and Python3 +- report-python: fix tests if configure --without-python2 +- autogen: correctly parse buildrequires from spec file + +* Tue Mar 27 2018 Martin Kutlak 2.9.4-1 - Translation updates +- Revert "use /usr/sbin/" - ureport: remove json-c is_error() usage +- ldconfig and gtk-update-icon-cache is not needed in rawhide - reporter-rhtsupport: Remove dependency on redhat-access-insights +- do not expand macro in changelog +- move defattr which match the defaults +- use /usr/sbin/ +- macro python_sitearch is always defined on rhel7+ +- remove rhel6 specific items and accomodate to rhel7+ +- This package uses names with ambiguous `python-` prefix in requirements. +- reporter-{bugzilla,mantisbt,rhtsupport}: fix free - reporter-mailx: rely on configured email -- Modernize spec file +- spec: fix unowned directories - augeas: include local config path - doc: update to contain newly added user's local config -- reporter-{mantisbt,rhtsupport,bugzilla}: read configuration from user's home +- reporter-mantisbt: read configuration from user's home +- reporter-rhtsupport: read configuration from user's home +- reporter-bugzilla: read configuration from user's home - reporter-bugzilla: ask concrete bz when requiring login - -* Tue Mar 06 2018 Björn Esser - 2.9.3-8 -- Rebuilt for libjson-c.so.4 (json-c v0.13.1) - -* Thu Mar 01 2018 Matej Habrnal 2.9.3-7 -- Add report and reportclient directories to rpm - -* Wed Feb 07 2018 Fedora Release Engineering - 2.9.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Feb 03 2018 Igor Gnatenko - 2.9.3-5 -- Switch to %%ldconfig_scriptlets - -* Tue Jan 09 2018 Iryna Shcherbina - 2.9.3-4 -- Update Python 2 dependency declarations to new packaging standards - (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) - -* Fri Jan 05 2018 Igor Gnatenko - 2.9.3-3 -- Remove obsolete scriptlets - -* Sun Dec 10 2017 Björn Esser - 2.9.3-2 -- Rebuilt for libjson-c.so.3 -- Use %%global instead of %%define +- makefile: fix make release * Thu Nov 02 2017 Julius Milan 2.9.3-1 - Translation updates @@ -792,45 +850,11 @@ make check|| { - client-python: Do not try to unlink None - spec: rename Python binary packages -* Wed Sep 13 2017 Matej Habrnal 2.9.2-2 -- Introduce pid_for_children element from ns -- Resolves: #1489611 - -* Fri Aug 25 2017 Matej Habrnal 2.9.2-1 -- Translation updates -- logging: rename log() to log_warning() -- reporter-mantisbt: Fix typo in help -- bugzilla: add check if option -d was entered -- dd: extend create_dump_dir to allow set pid in dumpdir name -- wizard: replace deprecated gtk3 functions -- lib: replace hash table with list -- fix newline issue with ask_password -- lib: make cpuinfo files user editable -- reporter-s-journal: add count to default logs -- augeas: trim spaces on eol, around value separator -- reporter-s-journal: add journal default entries -- Resolves: #1481205 - -* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 2.9.1-6 -- Python 3 binary package renamed to python3-libreport -- Missing Provides wihtout %%_isa added in python 2 binary package - -* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 2.9.1-5 -- Python 2 binary package renamed to python2-libreport - See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 - -* Thu Aug 03 2017 Fedora Release Engineering - 2.9.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 2.9.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Thu Apr 13 2017 Matej Habrnal 2.9.1-2 -- add journal default entries to reporter-systemd-journal -- augeas: trim spaces on eol, around value separator -- Resolves: #1434414 - -* Wed Mar 15 2017 Matej Habrnal 2.9.1-1 +* Thu Mar 16 2017 Matej Habrnal 2.9.1-1 +- build: create tarball in release-* target +- problem_data: fix double const +- wizard: fix error found by -Werror=format-security +- run_event: fix cmp between pointer and zero character - build: do not upload tarball to fedorahosted.org - spec: do not use fedorahosted.org as source - build: fix generating list of dependences in autogen.sh @@ -850,34 +874,38 @@ make check|| { - build: fix bug in changelog generating in release target - changelog: fix typos -* Fri Feb 10 2017 Fedora Release Engineering - 2.9.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Sat Jan 21 2017 Igor Gnatenko - 2.9.0-4 -- Rebuild for xmlrpc-c - -* Mon Jan 02 2017 Matej Habrnal 2.9.0-3 -- fix minimal satyr version - -* Thu Dec 15 2016 Charalampos Stratakis - 2.9.0-2 -- Rebuild for Python 3.6 - -* Thu Dec 15 2016 Matej Habrnal 2.9.0-1 +* Fri Dec 02 2016 Jakub Filak 2.9.0-1 - Translation updates - build: make the release-* targets smarter - add CHANGELOG.md - reporter-s-journal: enable SYSLOG_IDENTIFIER from env - report-python: add method run_event_on_problem_dir - lib: use lz4 instead of lz4cat +- reportclient: honor ABRT_VERBOSE - tree-wide: introduce 'stop_on_not_reportable' option - client: add support for $releasever to debuginfo +- lib: correct test for own root - workflows: run analyze_BodhiUpdates event on Fedora +- man: fix formating - reporter-systemd-journal: introduce reporter-systemd-journal - problem_data: add function which returns all problem data keys +- include: add exception_type element constant +- spec: changes related to reporter-systemd-journal - problem_report: add normalization of crashed thread - problem_report: make generate report configurable - problem_report: use core_backtrace if there is no backtrace - lib: refuse to parse negative number as unsigned int +- spec: simplify and remove old conditional +- build: add gettext-devel to sysdeps +- dd: add check for validity of new file FD +- build: configure tree for debugging by default +- spec: use %%buildroot macro +- spec: remove defattr which match the defaults +- spec: do not clean buildroot +- spec: remove Groups +- spec: code cleanup +- lib: fix a bug in dealing with errno +- lib: add convenient wrappers for uint in map_string_t - problem_report: ensure C-string null terminator - lib: fix invalid cgroup namespace ID - lib: make die function configurable @@ -887,22 +915,25 @@ make check|| { - problem data: search for sensitive words in more files - dd: add dd_copy_file_at - ignored words: add "systemd-logind" and "hawkey" +- build: reset the default version with each release +- doc: make README more verbose +- tree-wide: produce less messages in NOTICE log lvl - ureport: less confusing logging +- spec: install JavaScript workflows - workflow: add JavaScript workflows - bugzilla: stop including package details * Fri Sep 09 2016 Jakub Filak 2.8.0-1 - lib: fix a memory leak in create_dump_dir fn - rhtsupport: fix a double free of config at exit +- autogen: fix typo in usage help string - debuginfo: dnf API logging workarounds list - lib: don't warn when user word file doesn't exist +- testuite: add test for forbidden_words - lib: be able to define base conf dir at runtime - wizard: use dnf instead of yum in add a screencast note - problem_report: document resevered elements -* Tue Jul 19 2016 Fedora Release Engineering - 2.7.2-2 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - * Mon Jul 18 2016 Matej Habrnal 2.7.2-1 - Translation updates - wizard: do not create reproducible if complex_detail == no @@ -913,6 +944,7 @@ make check|| { - build: update searched pkg names for systemd * Wed May 18 2016 Matej Habrnal 2.7.1-1 +- spec: compression updates - lib: add lz4 decompression - lib: avoid the need to link against lzma - all: format security @@ -926,12 +958,20 @@ make check|| { * Fri Apr 08 2016 Matej Habrnal 2.7.0-1 - ignored words: update ignored words +- mailx: introduce debug parameter -D +- mailx: mail formatting: add comment right after %%oneline - mailx: use problem report api to define an emais' content +- lib: remove unused function make_description_bz - augeas: trim spaces before key value +- Revert "xml parser: be more verbose in case xml file cannot be opened" +- xml parser: be more verbose in case xml file cannot be opened - spec: add workflows.d to filesystem package +- makefile: define LANG in release target - mailx: stop creating dead.letter on mailx failures - workflows: add comments to ambiguous functions +- workflows: NULL for the default configuration dir - workflows: publish the function loading configuration +- build: fix build on Fedora24 - augeas: exclude mantisbt format configurations - reporter-mantisbt: add missing '=' to conf file - curl: fix typo Ingoring -> Ignoring @@ -953,54 +993,63 @@ make check|| { - wizard: fix the broken "Show log" widget - wizard: remove the code correcting Bugzilla groups -* Thu Feb 18 2016 Matej Habrnal 2.6.4-3 -- Translation updates -- wizard: fix the broken widget expansion - -* Wed Feb 10 2016 Matej Habrnal 2.6.4-2 -- wizard: fix the broken "Show log" widget -- Resolves: #1303326 - * Tue Feb 02 2016 Matej Habrnal 2.6.4-1 - doc: add option -o and -O into reporter-ureport man page - rhtsupport: use problme report API to create description - bugzilla: make the event configurable - report-gtk: offer users to create private ticket - bugzilla|centos: declare 'restricted access' support +- event config: add support for 'restricted access' +- lib: move CREATE_PRIVATE_TICKET to the global configuration +- dd: dd_delete_item does not die +- dd: add function getting stat of item +- dd: correct handling of TYPE when creating dump directory +- dd: add function computing dump dir file system size +- dd: add function counting number of dd items +- dd: add function copying file descriptor to element - dd: allow 1 and 2 letter long element names +- problem_data: factor out function reading single problem element - formatdup: more universal comment +- dd: make function uid_in_group() public - Refactoring conditional directives that break parts of statements. - bugzilla: actualize man pages - bugzilla: don't report private problem as comment - uploader: move username and password to the advanced options - uploader: allow empty username and password +- spec: add uploader config files and related man page - uploader: add possibility to set SSH keyfiles +- curl: add possibility to configure SSH keys - desktop-utils: deal with Destkop files without command line - ureport: enable attaching of arbitrary values +- update .gitignore - uploader: save remote name in reported_to - curl: return URLs without userinfo - -* Wed Nov 04 2015 Robert Kuska - 2.6.3-2 -- Rebuilt for Python3.5 rebuild +- lib: add function for removing userinfo from URIs +- plugins: port reporters to add_reported_to_entry +- reported_to: add a function formatting reported_to lines +- lib: introduce parser of ISO date strings +- uploader: use shared dd_create_archive function +- dd: add a function for compressing dumpdirs +- problem_report: add examples to the documentation +- client: document environment variables * Thu Oct 15 2015 Matej Habrnal 2.6.3-1 +- wizard: correct comments in save_text_if_changed() +- events: improve example - reporter-bugzilla: add parameter -p -- fix save users changes after reviewing dump dir files +- wizard: fix save users changes after reviewing dump dir files +- dd: make function load_text_file non-static - bugzilla: don't attach build_ids -- rewrite event rule parser +- run_event: rewrite event rule parser +- dd: add convenience wrappers fro loading numbers - ureport: improve curl's error messages +- ureport: use Red Hat Certificate Authority to make rhsm cert trusted - curl: add posibility to use own Certificate Authority cert - -* Tue Sep 15 2015 Matej Habrnal 2.6.2-5 +- spec: add redhat-access-insights to Requires of l-p-rhtsupport - bugzilla: put VARIANT_ID= to Whiteboard - -* Wed Aug 26 2015 Matej Habrnal 2.6.2-4 -- add a helper for HTTP GET +- autogen: use dnf instead of yum to install dependencies - configure: use hex value for dump dir mode - -* Fri Aug 14 2015 Matej Habrnal 2.6.2-3 -- don't warn about missing 'type' if the locking fails -- stop warning about corrupted mandatory files - -* Wed Jul 22 2015 Matej Habrnal 2.6.2-2 +- curl: add a helper for HTTP GET +- dd: don't warn about missing 'type' if the locking fails +- dd: stop warning about corrupted mandatory files - Use a dgettext function returning strings instead of bytes diff --git a/sources b/sources index 7bb1428..182b3ff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libreport-2.9.4.tar.gz) = 060e8d2929397a48f8c213758eff06583afbdc77cdfa186999b35dc545076890f0112b190df635c9681565c4ccbee1be7653a31a702dc612e15703d273d9039f +SHA512 (libreport-2.9.5.tar.gz) = 160dcbd9dd1653dde4f2a0dd6ab8c07b7e8ae0bc906b5c586df4e9c3b99a392959f6cac9218632587eb077e6d294a43fb2f221f0845e927728970db2fe323a54 From 9e8ca547a66fff355504e4ccf80903fc973ba9aa Mon Sep 17 00:00:00 2001 From: Martin Kutlak Date: Mon, 7 Jan 2019 10:37:06 +0100 Subject: [PATCH 5/9] Replace nomail flag with minor_update Send Bugzilla updates as minor_update. Signed-off-by: Martin Kutlak --- ...lib-Seek-beginning-of-mountinfo-file.patch | 33 +++ ...eplace-nomail-flag-with-minor_update.patch | 232 ++++++++++++++++++ libreport.spec | 21 +- 3 files changed, 284 insertions(+), 2 deletions(-) create mode 100644 0001-lib-Seek-beginning-of-mountinfo-file.patch create mode 100644 0002-rhbz-Replace-nomail-flag-with-minor_update.patch diff --git a/0001-lib-Seek-beginning-of-mountinfo-file.patch b/0001-lib-Seek-beginning-of-mountinfo-file.patch new file mode 100644 index 0000000..fcb4bcb --- /dev/null +++ b/0001-lib-Seek-beginning-of-mountinfo-file.patch @@ -0,0 +1,33 @@ +From c8afd2847f59278faac8d12c150db1d29f7ad622 Mon Sep 17 00:00:00 2001 +From: Matej Marusak +Date: Tue, 4 Dec 2018 09:38:32 +0100 +Subject: [PATCH] lib: Seek beginning of mountinfo file + +Signed-off-by: Matej Marusak +--- + src/lib/get_cmdline.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/lib/get_cmdline.c b/src/lib/get_cmdline.c +index 83c2fb45..49d419d5 100644 +--- a/src/lib/get_cmdline.c ++++ b/src/lib/get_cmdline.c +@@ -905,6 +905,7 @@ int process_has_own_root_at(int pid_proc_fd) + close(mnt_fd); + return r; + } ++ fseek(fin, 0, SEEK_SET); + + r = get_mountinfo_for_mount_point(fin, &pid_root, "/"); + fclose(fin); +@@ -925,6 +926,7 @@ int process_has_own_root_at(int pid_proc_fd) + return r; + } + ++ fseek(fin, 0, SEEK_SET); + r = get_mountinfo_for_mount_point(fin, &system_root, "/"); + fclose(fin); + if (r) +-- +2.17.2 + diff --git a/0002-rhbz-Replace-nomail-flag-with-minor_update.patch b/0002-rhbz-Replace-nomail-flag-with-minor_update.patch new file mode 100644 index 0000000..6ab8dce --- /dev/null +++ b/0002-rhbz-Replace-nomail-flag-with-minor_update.patch @@ -0,0 +1,232 @@ +From 569bf0e3fed698e93b8e098bf6a0bb2f773aed6a Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Fri, 4 Jan 2019 12:26:28 +0100 +Subject: [PATCH] rhbz: Replace nomail flag with minor_update + +In Bugzilla v5.0 nomail flag is replaced with minor_update. [1] +Because we still use the old nomail flag emails are being sent for every added attachment/comment. + +Related: rhbz#1660157 +Closes: abrt/abrt#1346 + +See also: +- https://partner-bugzilla.redhat.com/docs/en/html/integrating/api/Bugzilla/WebService/Bug.html?highlight=minor_update + +[1] https://bugzilla.redhat.com/show_bug.cgi?id=1655829 + +Signed-off-by: Martin Kutlak +--- + src/plugins/reporter-bugzilla.c | 12 +++++----- + src/plugins/rhbz.c | 41 ++++++++++++++++++--------------- + src/plugins/rhbz.h | 4 ++-- + 3 files changed, 30 insertions(+), 27 deletions(-) + +diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c +index d4d03f8e..c12e00d1 100644 +--- a/src/plugins/reporter-bugzilla.c ++++ b/src/plugins/reporter-bugzilla.c +@@ -35,7 +35,7 @@ int attach_text_item(struct abrt_xmlrpc *ax, const char *bug_id, + log_debug("attaching '%s' as text", item_name); + int r = rhbz_attach_blob(ax, bug_id, + item_name, item->content, strlen(item->content), +- RHBZ_NOMAIL_NOTIFY ++ RHBZ_MINOR_UPDATE + ); + return (r == 0); + } +@@ -63,7 +63,7 @@ int attach_file_item(struct abrt_xmlrpc *ax, const char *bug_id, + return 0; + } + log_debug("attaching '%s' as file", item_name); +- int flag = RHBZ_NOMAIL_NOTIFY; ++ int flag = RHBZ_MINOR_UPDATE; + if (!(item->flags & CD_FLAG_BIGTXT)) + flag |= RHBZ_BINARY_ATTACHMENT; + int r = rhbz_attach_fd(ax, bug_id, item_name, fd, flag); +@@ -793,7 +793,7 @@ int main(int argc, char **argv) + if (reported_to && reported_to->url) + { + log_warning(_("Adding External URL to bug %i"), new_id); +- rhbz_set_url(client, new_id, reported_to->url, RHBZ_NOMAIL_NOTIFY); ++ rhbz_set_url(client, new_id, reported_to->url, RHBZ_MINOR_UPDATE); + free_report_result(reported_to); + } + } +@@ -821,7 +821,7 @@ int main(int argc, char **argv) + if (existing_id >= 0) + { + log_warning(_("Closing bug %i as duplicate of bug %i"), new_id, existing_id); +- rhbz_close_as_duplicate(client, new_id, existing_id, RHBZ_NOMAIL_NOTIFY); ++ rhbz_close_as_duplicate(client, new_id, existing_id, RHBZ_MINOR_UPDATE); + } + + goto log_out; +@@ -876,7 +876,7 @@ int main(int argc, char **argv) + && !g_list_find_custom(bz->bi_cc_list, rhbz.b_login, (GCompareFunc)g_strcmp0) + ) { + log_warning(_("Adding %s to CC list"), rhbz.b_login); +- rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_NOMAIL_NOTIFY); ++ rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_MINOR_UPDATE); + } + + /* Add comment and bt */ +@@ -911,7 +911,7 @@ int main(int argc, char **argv) + sprintf(bug_id_str, "%i", bz->bi_id); + log_warning(_("Attaching better backtrace")); + rhbz_attach_blob(client, bug_id_str, FILENAME_BACKTRACE, bt, strlen(bt), +- RHBZ_NOMAIL_NOTIFY); ++ RHBZ_MINOR_UPDATE); + } + } + else +diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c +index 680527d7..cb6505ea 100644 +--- a/src/plugins/rhbz.c ++++ b/src/plugins/rhbz.c +@@ -605,7 +605,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, + return new_bug_id; + } + +-/* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ ++/* suppress mail notify by {s:i} (minor_update:1) (driven by flag) */ + int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + const char *filename, const char *data, int data_len, int flags) + { +@@ -620,7 +620,7 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + + char *fn = xasprintf("File: %s", filename); + xmlrpc_value* result; +- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ int minor_update = !!IS_MINOR_UPDATE(flags); + + /* http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/WebService/Bug.html#add_attachment + * +@@ -640,10 +640,11 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + */ + "data", data, (size_t)data_len, + +- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 +- * and version 4.4.rc1.b02 ++ /* If set to true, this is considered a minor update and no mail is sent to users who do not want ++ * minor update emails. If current user is not in the minor_update_group, this parameter is simply ++ * ignored. + */ +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + + free(fn); +@@ -737,25 +738,25 @@ struct bug_info *rhbz_find_origin_bug_closed_duplicate(struct abrt_xmlrpc *ax, + return bi_tmp; + } + +-/* suppress mail notify by {s:i} (nomail:1) */ ++/* suppress mail notify by {s:i} (minor_update:1) */ + void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int flags) + { + func_entry(); + + xmlrpc_value *result; +- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ int minor_update = !!IS_MINOR_UPDATE(flags); + #if 0 /* Obsolete API */ + result = abrt_xmlrpc_call(ax, "Bug.update", "({s:i,s:{s:(s),s:i}})", + "ids", bug_id, + "updates", "add_cc", mail, +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + #endif + /* Bugzilla 4.0+ uses this API: */ + result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:{s:(s),s:i}}", + "ids", bug_id, + "cc", "add", mail, +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + if (result) + xmlrpc_DECREF(result); +@@ -786,12 +787,12 @@ void rhbz_add_comment(struct abrt_xmlrpc *ax, int bug_id, const char *comment, + func_entry(); + + int private = !!IS_PRIVATE(flags); +- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ int minor_update = !!IS_MINOR_UPDATE(flags); + + xmlrpc_value *result; + result = abrt_xmlrpc_call(ax, "Bug.add_comment", "{s:i,s:s,s:b,s:i}", + "id", bug_id, "comment", comment, +- "private", private, "nomail", nomail_notify); ++ "private", private, "minor_update", minor_update); + + if (result) + xmlrpc_DECREF(result); +@@ -801,15 +802,16 @@ void rhbz_set_url(struct abrt_xmlrpc *ax, int bug_id, const char *url, int flags + { + func_entry(); + +- const int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ const int minor_update = !!IS_MINOR_UPDATE(flags); + xmlrpc_value *result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:s,s:i}", + "ids", bug_id, + "url", url, + +- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 +- * and version 4.4.rc1.b02 ++ /* If set to true, this is considered a minor update and no mail is sent to users who do not want ++ * minor update emails. If current user is not in the minor_update_group, this parameter is simply ++ * ignored. + */ +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + + if (result) +@@ -822,17 +824,18 @@ void rhbz_close_as_duplicate(struct abrt_xmlrpc *ax, int bug_id, + { + func_entry(); + +- const int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ const int minor_update = !!IS_MINOR_UPDATE(flags); + xmlrpc_value *result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:s,s:s,s:i,s:i}", + "ids", bug_id, + "status", "CLOSED", + "resolution", "DUPLICATE", + "dupe_of", duplicate_bug, + +- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 +- * and version 4.4.rc1.b02 ++ /* If set to true, this is considered a minor update and no mail is sent to users who do not want ++ * minor update emails. If current user is not in the minor_update_group, this parameter is simply ++ * ignored. + */ +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + + if (result) +diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h +index 86632a35..3990eda0 100644 +--- a/src/plugins/rhbz.h ++++ b/src/plugins/rhbz.h +@@ -36,7 +36,7 @@ enum { + RHBZ_MANDATORY_MEMB = (1 << 0), + RHBZ_READ_STR = (1 << 1), + RHBZ_READ_INT = (1 << 2), +- RHBZ_NOMAIL_NOTIFY = (1 << 3), ++ RHBZ_MINOR_UPDATE = (1 << 3), + RHBZ_PRIVATE = (1 << 4), + RHBZ_BINARY_ATTACHMENT = (1 << 5), + }; +@@ -44,7 +44,7 @@ enum { + #define IS_MANDATORY(flags) ((flags) & RHBZ_MANDATORY_MEMB) + #define IS_READ_STR(flags) ((flags) & RHBZ_READ_STR) + #define IS_READ_INT(flags) ((flags) & RHBZ_READ_INT) +-#define IS_NOMAIL_NOTIFY(flags) ((flags) & RHBZ_NOMAIL_NOTIFY) ++#define IS_MINOR_UPDATE(flags) ((flags) & RHBZ_MINOR_UPDATE) + #define IS_PRIVATE(flags) ((flags) & RHBZ_PRIVATE) + + struct bug_info { +-- +2.17.2 + diff --git a/libreport.spec b/libreport.spec index dd198a6..37be338 100644 --- a/libreport.spec +++ b/libreport.spec @@ -29,10 +29,16 @@ Summary: Generic library for reporting various problems Name: libreport Version: 2.9.5 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz + + +Patch0001: 0001-lib-Seek-beginning-of-mountinfo-file.patch +Patch0002: 0002-rhbz-Replace-nomail-flag-with-minor_update.patch + + BuildRequires: %{dbus_devel} BuildRequires: gtk3-devel BuildRequires: curl-devel @@ -347,7 +353,14 @@ data over ftp/scp... %endif %prep -%setup -q +# http://www.rpm.org/wiki/PackagerDocs/Autosetup +# Default '__scm_apply_git' is 'git apply && git commit' but this workflow +# doesn't allow us to create a new file within a patch, so we have to use +# 'git am' (see /usr/lib/rpm/macros for more details) +#%%define __scm_apply_git(qp:m:) %{__git} am --exclude doc/design --exclude doc/project/abrt.tex +%define __scm_apply_git(qp:m:) %{__git} am +%autosetup -S git + %build autoconf @@ -802,6 +815,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Mon Jan 07 2019 Martin Kutlak 2.9.5-2 +- lib: Seek beginning of mountinfo file +- rhbz: Replace nomail flag with minor_update + * Tue Apr 24 2018 Matej Habrnal 2.9.5-1 - spec: actualize according to downstream - spec: Conditionalize the Python2 and Python3 From c2a379f5fca7facf98a9ff6fa7d3a9f88bba6390 Mon Sep 17 00:00:00 2001 From: Martin Kutlak Date: Mon, 7 Jan 2019 12:01:24 +0100 Subject: [PATCH 6/9] Add BuildReq for git Needed to apply patches Signed-off-by: Martin Kutlak --- libreport.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libreport.spec b/libreport.spec index 37be338..477ac6a 100644 --- a/libreport.spec +++ b/libreport.spec @@ -29,7 +29,7 @@ Summary: Generic library for reporting various problems Name: libreport Version: 2.9.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz @@ -61,6 +61,8 @@ BuildRequires: newt-devel BuildRequires: libproxy-devel BuildRequires: satyr-devel >= 0.24 BuildRequires: glib2-devel >= %{glib_ver} +BuildRequires: git + %if 0%{?fedora} >= 24 || 0%{?rhel} > 7 # A test case uses zh_CN locale to verify XML event translations @@ -815,6 +817,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Mon Jan 07 2019 Martin Kutlak 2.9.5-3 +- Add BuildRequires for git to apply the patches + * Mon Jan 07 2019 Martin Kutlak 2.9.5-2 - lib: Seek beginning of mountinfo file - rhbz: Replace nomail flag with minor_update From 42c841fe79c0e4a3af54e710582d24ad08a57634 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 4 Feb 2019 13:24:58 +0100 Subject: [PATCH 7/9] Update to 2.10.0 Signed-off-by: Ernestas Kulik --- ...lib-Seek-beginning-of-mountinfo-file.patch | 33 --- ...eplace-nomail-flag-with-minor_update.patch | 232 ------------------ autogen.sh | 70 ------ libreport.spec | 22 +- 4 files changed, 13 insertions(+), 344 deletions(-) delete mode 100644 0001-lib-Seek-beginning-of-mountinfo-file.patch delete mode 100644 0002-rhbz-Replace-nomail-flag-with-minor_update.patch delete mode 100755 autogen.sh diff --git a/0001-lib-Seek-beginning-of-mountinfo-file.patch b/0001-lib-Seek-beginning-of-mountinfo-file.patch deleted file mode 100644 index fcb4bcb..0000000 --- a/0001-lib-Seek-beginning-of-mountinfo-file.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c8afd2847f59278faac8d12c150db1d29f7ad622 Mon Sep 17 00:00:00 2001 -From: Matej Marusak -Date: Tue, 4 Dec 2018 09:38:32 +0100 -Subject: [PATCH] lib: Seek beginning of mountinfo file - -Signed-off-by: Matej Marusak ---- - src/lib/get_cmdline.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/lib/get_cmdline.c b/src/lib/get_cmdline.c -index 83c2fb45..49d419d5 100644 ---- a/src/lib/get_cmdline.c -+++ b/src/lib/get_cmdline.c -@@ -905,6 +905,7 @@ int process_has_own_root_at(int pid_proc_fd) - close(mnt_fd); - return r; - } -+ fseek(fin, 0, SEEK_SET); - - r = get_mountinfo_for_mount_point(fin, &pid_root, "/"); - fclose(fin); -@@ -925,6 +926,7 @@ int process_has_own_root_at(int pid_proc_fd) - return r; - } - -+ fseek(fin, 0, SEEK_SET); - r = get_mountinfo_for_mount_point(fin, &system_root, "/"); - fclose(fin); - if (r) --- -2.17.2 - diff --git a/0002-rhbz-Replace-nomail-flag-with-minor_update.patch b/0002-rhbz-Replace-nomail-flag-with-minor_update.patch deleted file mode 100644 index 6ab8dce..0000000 --- a/0002-rhbz-Replace-nomail-flag-with-minor_update.patch +++ /dev/null @@ -1,232 +0,0 @@ -From 569bf0e3fed698e93b8e098bf6a0bb2f773aed6a Mon Sep 17 00:00:00 2001 -From: Martin Kutlak -Date: Fri, 4 Jan 2019 12:26:28 +0100 -Subject: [PATCH] rhbz: Replace nomail flag with minor_update - -In Bugzilla v5.0 nomail flag is replaced with minor_update. [1] -Because we still use the old nomail flag emails are being sent for every added attachment/comment. - -Related: rhbz#1660157 -Closes: abrt/abrt#1346 - -See also: -- https://partner-bugzilla.redhat.com/docs/en/html/integrating/api/Bugzilla/WebService/Bug.html?highlight=minor_update - -[1] https://bugzilla.redhat.com/show_bug.cgi?id=1655829 - -Signed-off-by: Martin Kutlak ---- - src/plugins/reporter-bugzilla.c | 12 +++++----- - src/plugins/rhbz.c | 41 ++++++++++++++++++--------------- - src/plugins/rhbz.h | 4 ++-- - 3 files changed, 30 insertions(+), 27 deletions(-) - -diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c -index d4d03f8e..c12e00d1 100644 ---- a/src/plugins/reporter-bugzilla.c -+++ b/src/plugins/reporter-bugzilla.c -@@ -35,7 +35,7 @@ int attach_text_item(struct abrt_xmlrpc *ax, const char *bug_id, - log_debug("attaching '%s' as text", item_name); - int r = rhbz_attach_blob(ax, bug_id, - item_name, item->content, strlen(item->content), -- RHBZ_NOMAIL_NOTIFY -+ RHBZ_MINOR_UPDATE - ); - return (r == 0); - } -@@ -63,7 +63,7 @@ int attach_file_item(struct abrt_xmlrpc *ax, const char *bug_id, - return 0; - } - log_debug("attaching '%s' as file", item_name); -- int flag = RHBZ_NOMAIL_NOTIFY; -+ int flag = RHBZ_MINOR_UPDATE; - if (!(item->flags & CD_FLAG_BIGTXT)) - flag |= RHBZ_BINARY_ATTACHMENT; - int r = rhbz_attach_fd(ax, bug_id, item_name, fd, flag); -@@ -793,7 +793,7 @@ int main(int argc, char **argv) - if (reported_to && reported_to->url) - { - log_warning(_("Adding External URL to bug %i"), new_id); -- rhbz_set_url(client, new_id, reported_to->url, RHBZ_NOMAIL_NOTIFY); -+ rhbz_set_url(client, new_id, reported_to->url, RHBZ_MINOR_UPDATE); - free_report_result(reported_to); - } - } -@@ -821,7 +821,7 @@ int main(int argc, char **argv) - if (existing_id >= 0) - { - log_warning(_("Closing bug %i as duplicate of bug %i"), new_id, existing_id); -- rhbz_close_as_duplicate(client, new_id, existing_id, RHBZ_NOMAIL_NOTIFY); -+ rhbz_close_as_duplicate(client, new_id, existing_id, RHBZ_MINOR_UPDATE); - } - - goto log_out; -@@ -876,7 +876,7 @@ int main(int argc, char **argv) - && !g_list_find_custom(bz->bi_cc_list, rhbz.b_login, (GCompareFunc)g_strcmp0) - ) { - log_warning(_("Adding %s to CC list"), rhbz.b_login); -- rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_NOMAIL_NOTIFY); -+ rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_MINOR_UPDATE); - } - - /* Add comment and bt */ -@@ -911,7 +911,7 @@ int main(int argc, char **argv) - sprintf(bug_id_str, "%i", bz->bi_id); - log_warning(_("Attaching better backtrace")); - rhbz_attach_blob(client, bug_id_str, FILENAME_BACKTRACE, bt, strlen(bt), -- RHBZ_NOMAIL_NOTIFY); -+ RHBZ_MINOR_UPDATE); - } - } - else -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index 680527d7..cb6505ea 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -605,7 +605,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, - return new_bug_id; - } - --/* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ -+/* suppress mail notify by {s:i} (minor_update:1) (driven by flag) */ - int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, - const char *filename, const char *data, int data_len, int flags) - { -@@ -620,7 +620,7 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, - - char *fn = xasprintf("File: %s", filename); - xmlrpc_value* result; -- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); -+ int minor_update = !!IS_MINOR_UPDATE(flags); - - /* http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/WebService/Bug.html#add_attachment - * -@@ -640,10 +640,11 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, - */ - "data", data, (size_t)data_len, - -- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 -- * and version 4.4.rc1.b02 -+ /* If set to true, this is considered a minor update and no mail is sent to users who do not want -+ * minor update emails. If current user is not in the minor_update_group, this parameter is simply -+ * ignored. - */ -- "nomail", nomail_notify -+ "minor_update", minor_update - ); - - free(fn); -@@ -737,25 +738,25 @@ struct bug_info *rhbz_find_origin_bug_closed_duplicate(struct abrt_xmlrpc *ax, - return bi_tmp; - } - --/* suppress mail notify by {s:i} (nomail:1) */ -+/* suppress mail notify by {s:i} (minor_update:1) */ - void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int flags) - { - func_entry(); - - xmlrpc_value *result; -- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); -+ int minor_update = !!IS_MINOR_UPDATE(flags); - #if 0 /* Obsolete API */ - result = abrt_xmlrpc_call(ax, "Bug.update", "({s:i,s:{s:(s),s:i}})", - "ids", bug_id, - "updates", "add_cc", mail, -- "nomail", nomail_notify -+ "minor_update", minor_update - ); - #endif - /* Bugzilla 4.0+ uses this API: */ - result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:{s:(s),s:i}}", - "ids", bug_id, - "cc", "add", mail, -- "nomail", nomail_notify -+ "minor_update", minor_update - ); - if (result) - xmlrpc_DECREF(result); -@@ -786,12 +787,12 @@ void rhbz_add_comment(struct abrt_xmlrpc *ax, int bug_id, const char *comment, - func_entry(); - - int private = !!IS_PRIVATE(flags); -- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); -+ int minor_update = !!IS_MINOR_UPDATE(flags); - - xmlrpc_value *result; - result = abrt_xmlrpc_call(ax, "Bug.add_comment", "{s:i,s:s,s:b,s:i}", - "id", bug_id, "comment", comment, -- "private", private, "nomail", nomail_notify); -+ "private", private, "minor_update", minor_update); - - if (result) - xmlrpc_DECREF(result); -@@ -801,15 +802,16 @@ void rhbz_set_url(struct abrt_xmlrpc *ax, int bug_id, const char *url, int flags - { - func_entry(); - -- const int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); -+ const int minor_update = !!IS_MINOR_UPDATE(flags); - xmlrpc_value *result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:s,s:i}", - "ids", bug_id, - "url", url, - -- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 -- * and version 4.4.rc1.b02 -+ /* If set to true, this is considered a minor update and no mail is sent to users who do not want -+ * minor update emails. If current user is not in the minor_update_group, this parameter is simply -+ * ignored. - */ -- "nomail", nomail_notify -+ "minor_update", minor_update - ); - - if (result) -@@ -822,17 +824,18 @@ void rhbz_close_as_duplicate(struct abrt_xmlrpc *ax, int bug_id, - { - func_entry(); - -- const int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); -+ const int minor_update = !!IS_MINOR_UPDATE(flags); - xmlrpc_value *result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:s,s:s,s:i,s:i}", - "ids", bug_id, - "status", "CLOSED", - "resolution", "DUPLICATE", - "dupe_of", duplicate_bug, - -- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 -- * and version 4.4.rc1.b02 -+ /* If set to true, this is considered a minor update and no mail is sent to users who do not want -+ * minor update emails. If current user is not in the minor_update_group, this parameter is simply -+ * ignored. - */ -- "nomail", nomail_notify -+ "minor_update", minor_update - ); - - if (result) -diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h -index 86632a35..3990eda0 100644 ---- a/src/plugins/rhbz.h -+++ b/src/plugins/rhbz.h -@@ -36,7 +36,7 @@ enum { - RHBZ_MANDATORY_MEMB = (1 << 0), - RHBZ_READ_STR = (1 << 1), - RHBZ_READ_INT = (1 << 2), -- RHBZ_NOMAIL_NOTIFY = (1 << 3), -+ RHBZ_MINOR_UPDATE = (1 << 3), - RHBZ_PRIVATE = (1 << 4), - RHBZ_BINARY_ATTACHMENT = (1 << 5), - }; -@@ -44,7 +44,7 @@ enum { - #define IS_MANDATORY(flags) ((flags) & RHBZ_MANDATORY_MEMB) - #define IS_READ_STR(flags) ((flags) & RHBZ_READ_STR) - #define IS_READ_INT(flags) ((flags) & RHBZ_READ_INT) --#define IS_NOMAIL_NOTIFY(flags) ((flags) & RHBZ_NOMAIL_NOTIFY) -+#define IS_MINOR_UPDATE(flags) ((flags) & RHBZ_MINOR_UPDATE) - #define IS_PRIVATE(flags) ((flags) & RHBZ_PRIVATE) - - struct bug_info { --- -2.17.2 - diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index c6e1729..0000000 --- a/autogen.sh +++ /dev/null @@ -1,70 +0,0 @@ -#! /bin/sh - -print_help() -{ -cat << EOH -Prepares the source tree for configuration - -Usage: - autogen.sh [sydeps [--install]] - -Options: - - sysdeps prints out all dependencies - --install install all dependencies ('sudo yum install \$DEPS') - -EOH -} - -build_depslist() -{ - DEPS_LIST=`grep "^\(Build\)\?Requires:" *.spec.in | grep -v "%{name}" | tr -s " " | tr "," "\n" | cut -f2 -d " " | grep -v "^libreport" | sort -u | tr "\n" " "` -} - -case "$1" in - "--help"|"-h") - print_help - exit 0 - ;; - "sysdeps") - build_depslist - - if [ "$2" == "--install" ]; then - set -x verbose - sudo yum install $DEPS_LIST - set +x verbose - else - echo $DEPS_LIST - fi - exit 0 - ;; - *) - echo "Running gen-version" - ./gen-version - - mkdir -p m4 - echo "Creating m4/aclocal.m4 ..." - test -r m4/aclocal.m4 || touch m4/aclocal.m4 - - echo "Running autopoint" - autopoint --force || exit 1 - - echo "Running intltoolize..." - intltoolize --force --copy --automake || exit 1 - - echo "Running aclocal..." - aclocal || exit 1 - - echo "Running libtoolize..." - libtoolize || exit 1 - - echo "Running autoheader..." - autoheader || return 1 - - echo "Running autoconf..." - autoconf --force || exit 1 - - echo "Running automake..." - automake --add-missing --force --copy || exit 1 - ;; -esac diff --git a/libreport.spec b/libreport.spec index 477ac6a..32691e6 100644 --- a/libreport.spec +++ b/libreport.spec @@ -10,7 +10,7 @@ %define libjson_devel json-c-devel %endif -%define glib_ver 2.43 +%define glib_ver 2.43.4 %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default @@ -28,17 +28,13 @@ Summary: Generic library for reporting various problems Name: libreport -Version: 2.9.5 -Release: 3%{?dist} +Version: 2.10.0 +Release: 1%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz -Patch0001: 0001-lib-Seek-beginning-of-mountinfo-file.patch -Patch0002: 0002-rhbz-Replace-nomail-flag-with-minor_update.patch - - BuildRequires: %{dbus_devel} BuildRequires: gtk3-devel BuildRequires: curl-devel @@ -365,9 +361,11 @@ data over ftp/scp... %build -autoconf +./gen-version +autoreconf -if +intltoolize --automake -c -f -CFLAGS="%{optflags} -Werror" %configure \ +%configure \ %if %{without python2} --without-python2 \ %endif # with python2 @@ -545,6 +543,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_includedir}/libreport/problem_details_widget.h %{_includedir}/libreport/problem_details_dialog.h %{_includedir}/libreport/problem_utils.h +%{_includedir}/libreport/report_result.h %{_includedir}/libreport/ureport.h %{_includedir}/libreport/reporters.h %{_includedir}/libreport/global_configuration.h @@ -817,6 +816,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Sat Feb 02 2019 Ernestas Kulik - 2.10.0-1 +- Update to 2.10.0 +- Bump GLib dependency +- Mirror commands run in autogen.sh + * Mon Jan 07 2019 Martin Kutlak 2.9.5-3 - Add BuildRequires for git to apply the patches From b554d3fac0286445cc831440a81e40a20387b5b2 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 4 Feb 2019 13:55:12 +0100 Subject: [PATCH 8/9] Update sources Signed-off-by: Ernestas Kulik --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0465349..08b3d7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /libreport-2.9.3.tar.gz /libreport-2.9.4.tar.gz /libreport-2.9.5.tar.gz +/libreport-2.10.0.tar.gz diff --git a/sources b/sources index 182b3ff..948e33d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libreport-2.9.5.tar.gz) = 160dcbd9dd1653dde4f2a0dd6ab8c07b7e8ae0bc906b5c586df4e9c3b99a392959f6cac9218632587eb077e6d294a43fb2f221f0845e927728970db2fe323a54 +SHA512 (libreport-2.10.0.tar.gz) = 978ea442d82b75abf80b2075f540cb05c5577387a9221f2070c9695c4546d36169738d223f5e903d0b774b7e1566a6111c55a6bb51a0822ad1676095f067c45b From 8fe0062fce5ed391c421371dfa9a3b23b924eeb9 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 4 Feb 2019 14:10:59 +0100 Subject: [PATCH 9/9] Revert "Update to 2.10.0" Some other time maybe. Signed-off-by: Ernestas Kulik --- .gitignore | 1 - ...lib-Seek-beginning-of-mountinfo-file.patch | 33 +++ ...eplace-nomail-flag-with-minor_update.patch | 232 ++++++++++++++++++ autogen.sh | 70 ++++++ libreport.spec | 22 +- sources | 2 +- 6 files changed, 345 insertions(+), 15 deletions(-) create mode 100644 0001-lib-Seek-beginning-of-mountinfo-file.patch create mode 100644 0002-rhbz-Replace-nomail-flag-with-minor_update.patch create mode 100755 autogen.sh diff --git a/.gitignore b/.gitignore index 08b3d7a..0465349 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /libreport-2.9.3.tar.gz /libreport-2.9.4.tar.gz /libreport-2.9.5.tar.gz -/libreport-2.10.0.tar.gz diff --git a/0001-lib-Seek-beginning-of-mountinfo-file.patch b/0001-lib-Seek-beginning-of-mountinfo-file.patch new file mode 100644 index 0000000..fcb4bcb --- /dev/null +++ b/0001-lib-Seek-beginning-of-mountinfo-file.patch @@ -0,0 +1,33 @@ +From c8afd2847f59278faac8d12c150db1d29f7ad622 Mon Sep 17 00:00:00 2001 +From: Matej Marusak +Date: Tue, 4 Dec 2018 09:38:32 +0100 +Subject: [PATCH] lib: Seek beginning of mountinfo file + +Signed-off-by: Matej Marusak +--- + src/lib/get_cmdline.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/lib/get_cmdline.c b/src/lib/get_cmdline.c +index 83c2fb45..49d419d5 100644 +--- a/src/lib/get_cmdline.c ++++ b/src/lib/get_cmdline.c +@@ -905,6 +905,7 @@ int process_has_own_root_at(int pid_proc_fd) + close(mnt_fd); + return r; + } ++ fseek(fin, 0, SEEK_SET); + + r = get_mountinfo_for_mount_point(fin, &pid_root, "/"); + fclose(fin); +@@ -925,6 +926,7 @@ int process_has_own_root_at(int pid_proc_fd) + return r; + } + ++ fseek(fin, 0, SEEK_SET); + r = get_mountinfo_for_mount_point(fin, &system_root, "/"); + fclose(fin); + if (r) +-- +2.17.2 + diff --git a/0002-rhbz-Replace-nomail-flag-with-minor_update.patch b/0002-rhbz-Replace-nomail-flag-with-minor_update.patch new file mode 100644 index 0000000..6ab8dce --- /dev/null +++ b/0002-rhbz-Replace-nomail-flag-with-minor_update.patch @@ -0,0 +1,232 @@ +From 569bf0e3fed698e93b8e098bf6a0bb2f773aed6a Mon Sep 17 00:00:00 2001 +From: Martin Kutlak +Date: Fri, 4 Jan 2019 12:26:28 +0100 +Subject: [PATCH] rhbz: Replace nomail flag with minor_update + +In Bugzilla v5.0 nomail flag is replaced with minor_update. [1] +Because we still use the old nomail flag emails are being sent for every added attachment/comment. + +Related: rhbz#1660157 +Closes: abrt/abrt#1346 + +See also: +- https://partner-bugzilla.redhat.com/docs/en/html/integrating/api/Bugzilla/WebService/Bug.html?highlight=minor_update + +[1] https://bugzilla.redhat.com/show_bug.cgi?id=1655829 + +Signed-off-by: Martin Kutlak +--- + src/plugins/reporter-bugzilla.c | 12 +++++----- + src/plugins/rhbz.c | 41 ++++++++++++++++++--------------- + src/plugins/rhbz.h | 4 ++-- + 3 files changed, 30 insertions(+), 27 deletions(-) + +diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c +index d4d03f8e..c12e00d1 100644 +--- a/src/plugins/reporter-bugzilla.c ++++ b/src/plugins/reporter-bugzilla.c +@@ -35,7 +35,7 @@ int attach_text_item(struct abrt_xmlrpc *ax, const char *bug_id, + log_debug("attaching '%s' as text", item_name); + int r = rhbz_attach_blob(ax, bug_id, + item_name, item->content, strlen(item->content), +- RHBZ_NOMAIL_NOTIFY ++ RHBZ_MINOR_UPDATE + ); + return (r == 0); + } +@@ -63,7 +63,7 @@ int attach_file_item(struct abrt_xmlrpc *ax, const char *bug_id, + return 0; + } + log_debug("attaching '%s' as file", item_name); +- int flag = RHBZ_NOMAIL_NOTIFY; ++ int flag = RHBZ_MINOR_UPDATE; + if (!(item->flags & CD_FLAG_BIGTXT)) + flag |= RHBZ_BINARY_ATTACHMENT; + int r = rhbz_attach_fd(ax, bug_id, item_name, fd, flag); +@@ -793,7 +793,7 @@ int main(int argc, char **argv) + if (reported_to && reported_to->url) + { + log_warning(_("Adding External URL to bug %i"), new_id); +- rhbz_set_url(client, new_id, reported_to->url, RHBZ_NOMAIL_NOTIFY); ++ rhbz_set_url(client, new_id, reported_to->url, RHBZ_MINOR_UPDATE); + free_report_result(reported_to); + } + } +@@ -821,7 +821,7 @@ int main(int argc, char **argv) + if (existing_id >= 0) + { + log_warning(_("Closing bug %i as duplicate of bug %i"), new_id, existing_id); +- rhbz_close_as_duplicate(client, new_id, existing_id, RHBZ_NOMAIL_NOTIFY); ++ rhbz_close_as_duplicate(client, new_id, existing_id, RHBZ_MINOR_UPDATE); + } + + goto log_out; +@@ -876,7 +876,7 @@ int main(int argc, char **argv) + && !g_list_find_custom(bz->bi_cc_list, rhbz.b_login, (GCompareFunc)g_strcmp0) + ) { + log_warning(_("Adding %s to CC list"), rhbz.b_login); +- rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_NOMAIL_NOTIFY); ++ rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_MINOR_UPDATE); + } + + /* Add comment and bt */ +@@ -911,7 +911,7 @@ int main(int argc, char **argv) + sprintf(bug_id_str, "%i", bz->bi_id); + log_warning(_("Attaching better backtrace")); + rhbz_attach_blob(client, bug_id_str, FILENAME_BACKTRACE, bt, strlen(bt), +- RHBZ_NOMAIL_NOTIFY); ++ RHBZ_MINOR_UPDATE); + } + } + else +diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c +index 680527d7..cb6505ea 100644 +--- a/src/plugins/rhbz.c ++++ b/src/plugins/rhbz.c +@@ -605,7 +605,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, + return new_bug_id; + } + +-/* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ ++/* suppress mail notify by {s:i} (minor_update:1) (driven by flag) */ + int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + const char *filename, const char *data, int data_len, int flags) + { +@@ -620,7 +620,7 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + + char *fn = xasprintf("File: %s", filename); + xmlrpc_value* result; +- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ int minor_update = !!IS_MINOR_UPDATE(flags); + + /* http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/WebService/Bug.html#add_attachment + * +@@ -640,10 +640,11 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + */ + "data", data, (size_t)data_len, + +- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 +- * and version 4.4.rc1.b02 ++ /* If set to true, this is considered a minor update and no mail is sent to users who do not want ++ * minor update emails. If current user is not in the minor_update_group, this parameter is simply ++ * ignored. + */ +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + + free(fn); +@@ -737,25 +738,25 @@ struct bug_info *rhbz_find_origin_bug_closed_duplicate(struct abrt_xmlrpc *ax, + return bi_tmp; + } + +-/* suppress mail notify by {s:i} (nomail:1) */ ++/* suppress mail notify by {s:i} (minor_update:1) */ + void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int flags) + { + func_entry(); + + xmlrpc_value *result; +- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ int minor_update = !!IS_MINOR_UPDATE(flags); + #if 0 /* Obsolete API */ + result = abrt_xmlrpc_call(ax, "Bug.update", "({s:i,s:{s:(s),s:i}})", + "ids", bug_id, + "updates", "add_cc", mail, +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + #endif + /* Bugzilla 4.0+ uses this API: */ + result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:{s:(s),s:i}}", + "ids", bug_id, + "cc", "add", mail, +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + if (result) + xmlrpc_DECREF(result); +@@ -786,12 +787,12 @@ void rhbz_add_comment(struct abrt_xmlrpc *ax, int bug_id, const char *comment, + func_entry(); + + int private = !!IS_PRIVATE(flags); +- int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ int minor_update = !!IS_MINOR_UPDATE(flags); + + xmlrpc_value *result; + result = abrt_xmlrpc_call(ax, "Bug.add_comment", "{s:i,s:s,s:b,s:i}", + "id", bug_id, "comment", comment, +- "private", private, "nomail", nomail_notify); ++ "private", private, "minor_update", minor_update); + + if (result) + xmlrpc_DECREF(result); +@@ -801,15 +802,16 @@ void rhbz_set_url(struct abrt_xmlrpc *ax, int bug_id, const char *url, int flags + { + func_entry(); + +- const int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ const int minor_update = !!IS_MINOR_UPDATE(flags); + xmlrpc_value *result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:s,s:i}", + "ids", bug_id, + "url", url, + +- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 +- * and version 4.4.rc1.b02 ++ /* If set to true, this is considered a minor update and no mail is sent to users who do not want ++ * minor update emails. If current user is not in the minor_update_group, this parameter is simply ++ * ignored. + */ +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + + if (result) +@@ -822,17 +824,18 @@ void rhbz_close_as_duplicate(struct abrt_xmlrpc *ax, int bug_id, + { + func_entry(); + +- const int nomail_notify = !!IS_NOMAIL_NOTIFY(flags); ++ const int minor_update = !!IS_MINOR_UPDATE(flags); + xmlrpc_value *result = abrt_xmlrpc_call(ax, "Bug.update", "{s:i,s:s,s:s,s:i,s:i}", + "ids", bug_id, + "status", "CLOSED", + "resolution", "DUPLICATE", + "dupe_of", duplicate_bug, + +- /* Undocumented argument but it works with Red Hat Bugzilla version 4.2.4-7 +- * and version 4.4.rc1.b02 ++ /* If set to true, this is considered a minor update and no mail is sent to users who do not want ++ * minor update emails. If current user is not in the minor_update_group, this parameter is simply ++ * ignored. + */ +- "nomail", nomail_notify ++ "minor_update", minor_update + ); + + if (result) +diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h +index 86632a35..3990eda0 100644 +--- a/src/plugins/rhbz.h ++++ b/src/plugins/rhbz.h +@@ -36,7 +36,7 @@ enum { + RHBZ_MANDATORY_MEMB = (1 << 0), + RHBZ_READ_STR = (1 << 1), + RHBZ_READ_INT = (1 << 2), +- RHBZ_NOMAIL_NOTIFY = (1 << 3), ++ RHBZ_MINOR_UPDATE = (1 << 3), + RHBZ_PRIVATE = (1 << 4), + RHBZ_BINARY_ATTACHMENT = (1 << 5), + }; +@@ -44,7 +44,7 @@ enum { + #define IS_MANDATORY(flags) ((flags) & RHBZ_MANDATORY_MEMB) + #define IS_READ_STR(flags) ((flags) & RHBZ_READ_STR) + #define IS_READ_INT(flags) ((flags) & RHBZ_READ_INT) +-#define IS_NOMAIL_NOTIFY(flags) ((flags) & RHBZ_NOMAIL_NOTIFY) ++#define IS_MINOR_UPDATE(flags) ((flags) & RHBZ_MINOR_UPDATE) + #define IS_PRIVATE(flags) ((flags) & RHBZ_PRIVATE) + + struct bug_info { +-- +2.17.2 + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..c6e1729 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,70 @@ +#! /bin/sh + +print_help() +{ +cat << EOH +Prepares the source tree for configuration + +Usage: + autogen.sh [sydeps [--install]] + +Options: + + sysdeps prints out all dependencies + --install install all dependencies ('sudo yum install \$DEPS') + +EOH +} + +build_depslist() +{ + DEPS_LIST=`grep "^\(Build\)\?Requires:" *.spec.in | grep -v "%{name}" | tr -s " " | tr "," "\n" | cut -f2 -d " " | grep -v "^libreport" | sort -u | tr "\n" " "` +} + +case "$1" in + "--help"|"-h") + print_help + exit 0 + ;; + "sysdeps") + build_depslist + + if [ "$2" == "--install" ]; then + set -x verbose + sudo yum install $DEPS_LIST + set +x verbose + else + echo $DEPS_LIST + fi + exit 0 + ;; + *) + echo "Running gen-version" + ./gen-version + + mkdir -p m4 + echo "Creating m4/aclocal.m4 ..." + test -r m4/aclocal.m4 || touch m4/aclocal.m4 + + echo "Running autopoint" + autopoint --force || exit 1 + + echo "Running intltoolize..." + intltoolize --force --copy --automake || exit 1 + + echo "Running aclocal..." + aclocal || exit 1 + + echo "Running libtoolize..." + libtoolize || exit 1 + + echo "Running autoheader..." + autoheader || return 1 + + echo "Running autoconf..." + autoconf --force || exit 1 + + echo "Running automake..." + automake --add-missing --force --copy || exit 1 + ;; +esac diff --git a/libreport.spec b/libreport.spec index 32691e6..477ac6a 100644 --- a/libreport.spec +++ b/libreport.spec @@ -10,7 +10,7 @@ %define libjson_devel json-c-devel %endif -%define glib_ver 2.43.4 +%define glib_ver 2.43 %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default @@ -28,13 +28,17 @@ Summary: Generic library for reporting various problems Name: libreport -Version: 2.10.0 -Release: 1%{?dist} +Version: 2.9.5 +Release: 3%{?dist} License: GPLv2+ URL: https://abrt.readthedocs.org/ Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Patch0001: 0001-lib-Seek-beginning-of-mountinfo-file.patch +Patch0002: 0002-rhbz-Replace-nomail-flag-with-minor_update.patch + + BuildRequires: %{dbus_devel} BuildRequires: gtk3-devel BuildRequires: curl-devel @@ -361,11 +365,9 @@ data over ftp/scp... %build -./gen-version -autoreconf -if -intltoolize --automake -c -f +autoconf -%configure \ +CFLAGS="%{optflags} -Werror" %configure \ %if %{without python2} --without-python2 \ %endif # with python2 @@ -543,7 +545,6 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_includedir}/libreport/problem_details_widget.h %{_includedir}/libreport/problem_details_dialog.h %{_includedir}/libreport/problem_utils.h -%{_includedir}/libreport/report_result.h %{_includedir}/libreport/ureport.h %{_includedir}/libreport/reporters.h %{_includedir}/libreport/global_configuration.h @@ -816,11 +817,6 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog -* Sat Feb 02 2019 Ernestas Kulik - 2.10.0-1 -- Update to 2.10.0 -- Bump GLib dependency -- Mirror commands run in autogen.sh - * Mon Jan 07 2019 Martin Kutlak 2.9.5-3 - Add BuildRequires for git to apply the patches diff --git a/sources b/sources index 948e33d..182b3ff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libreport-2.10.0.tar.gz) = 978ea442d82b75abf80b2075f540cb05c5577387a9221f2070c9695c4546d36169738d223f5e903d0b774b7e1566a6111c55a6bb51a0822ad1676095f067c45b +SHA512 (libreport-2.9.5.tar.gz) = 160dcbd9dd1653dde4f2a0dd6ab8c07b7e8ae0bc906b5c586df4e9c3b99a392959f6cac9218632587eb077e6d294a43fb2f221f0845e927728970db2fe323a54