Do not try to write to an unwritable directory (bz 1751021).

Fix cross-references in the documentation.
This commit is contained in:
Jerry James 2020-01-25 09:32:22 -07:00
parent 06d125bbc8
commit 972c9aaa7f
4 changed files with 68 additions and 25 deletions

View File

@ -0,0 +1,14 @@
--- src/scripts/cysignals-CSI.orig 2019-10-25 09:09:23.892784878 -0600
+++ src/scripts/cysignals-CSI 2019-10-25 09:24:39.077211746 -0600
@@ -172,7 +172,10 @@ def save_backtrace(output):
except KeyError:
pass
- mkdir_p(bt_dir)
+ try:
+ mkdir_p(bt_dir)
+ except PermissionError:
+ return None
if bt_days >= 0:
prune_old_logs(bt_dir, bt_days)
f, filename = tempfile.mkstemp(dir=bt_dir, prefix='crash_', suffix='.log')

View File

@ -0,0 +1,14 @@
--- src/cysignals/pysignals.pyx.orig 2019-03-14 07:39:24.000000000 -0600
+++ src/cysignals/pysignals.pyx 2019-10-25 10:27:20.768572126 -0600
@@ -44,11 +44,6 @@ from cpython.object cimport Py_EQ, Py_NE
from cpython.exc cimport PyErr_SetFromErrno, PyErr_CheckSignals
-# Fix https://github.com/cython/cython/pull/2756
-cdef extern from "<signal.h>" nogil:
- int sigismember(const sigset_t *, int)
-
-
cdef class SigAction:
"""
An opaque object representing an OS-level signal handler.

View File

@ -0,0 +1,8 @@
# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON
# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors
# No man page: user should not invoke the script directly
addFilter(r'W: no-manual-page-for-binary cysignals-CSI')
# Documentation is in the -doc subpackage
addFilter(r'python3-cysignals-devel\.[^:]+: W: no-documentation')

View File

@ -5,7 +5,7 @@
Name: python-%{modname}
Version: 1.10.2
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Interrupt and signal handling for Cython
License: LGPLv3+
URL: https://github.com/sagemath/%{modname}
@ -21,20 +21,24 @@ Patch1: %{name}-emms.patch
Patch2: %{name}-fortify.patch
# Fix underlinked signals.so
Patch3: %{name}-underlink.patch
# Do not fail if cysignals_crash_logs cannot be created
Patch4: %{name}-crash-logs.patch
# Remove workaround for Cython bug that is already fixed in Fedora
Patch5: %{name}-sigismember.patch
%global _description \
When writing Cython code, special care must be taken to ensure that the\
code can be interrupted with CTRL-C. Since Cython optimizes for speed,\
Cython normally does not check for interrupts. For example, code like\
the following cannot be interrupted in Cython:\
\
while True:\
pass\
\
The cysignals package provides mechanisms to handle interrupts\
(and other signals and errors) in Cython code.\
\
See http://cysignals.readthedocs.org/ for the full documentation.
%global _description %{expand:
When writing Cython code, special care must be taken to ensure that the
code can be interrupted with CTRL-C. Since Cython optimizes for speed,
Cython normally does not check for interrupts. For example, code like
the following cannot be interrupted in Cython:
while True:
pass
The cysignals package provides mechanisms to handle interrupts
(and other signals and errors) in Cython code.
See http://cysignals.readthedocs.org/ for the full documentation.}
%description %{_description}
@ -42,13 +46,9 @@ See http://cysignals.readthedocs.org/ for the full documentation.
Summary: %{summary}
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel
BuildRequires: python3-docs
BuildRequires: python3dist(cython)
BuildRequires: python3dist(setuptools)
Requires: python3-Cython
# This can be removed when F29 reaches EOL
Obsoletes: python2-%{modname} < 1.8.1-1
Provides: python2-%{modname} = %{version}-%{release}
%description -n python3-%{modname} %{_description}
@ -57,10 +57,6 @@ Summary: %{summary} headers files
%{?python_provide:%python_provide python3-%{modname}-devel}
Requires: python3-%{modname}
# This can be removed when F29 reaches EOL
Obsoletes: python2-%{modname}-devel < 1.8.1-1
Provides: python2-%{modname}-devel = %{version}-%{release}
%description -n python3-%{modname}-devel %{_description}
%package doc
@ -74,13 +70,20 @@ Documentation and examples for %{name}.
%prep
%autosetup -p0 -n %{modname}-%{version}
# Use local objects.inv for intersphinx
sed -i "s|'https://docs\.python\.org/2\.7', None|'https://docs.python.org/3', '%{_docdir}/python3-docs/html/objects.inv'|" docs/source/conf.py
# Build for python 3
sed -i 's/language_level=2/language_level=3/' setup.py
%build
%configure
%py3_build
# Build the documentation
export PYTHONPATH=$PWD/$(ls -1d build/lib.linux*%{python3_version})
%__make -C docs html SPHINXBUILD=sphinx-build-3
%__make -C docs html
rst2html --no-datestamp README.rst README.html
%install
%py3_install
@ -96,7 +99,7 @@ export PATH PYTHONPATH
%files -n python3-%{modname}
%license LICENSE
%doc PKG-INFO README.rst
%doc README.html
%{_bindir}/%{modname}-CSI
%{_datadir}/%{modname}/
%{python3_sitearch}/%{modname}
@ -115,6 +118,10 @@ export PATH PYTHONPATH
%{_docdir}/%{name}/html
%changelog
* Sat Jan 25 2020 Jerry James <loganjerry@gmail.com> - 1.10.2-5
- Do not try to write to an unwritable directory (bz 1751021)
- Fix cross-references in the documentation
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10.2-4
- Rebuilt for Python 3.8.0rc1 (#1748018)