Escape % symbols in macro files comments
This is most likely not neccessary but can prevent serious problems like: https://bugzilla.redhat.com/show_bug.cgi?id=1953910 Related: rhbz#1950291
This commit is contained in:
parent
093a0036db
commit
a272f59825
@ -4,13 +4,13 @@
|
||||
# Which unfortunately makes the definition more complicated than it should be
|
||||
|
||||
# Usage:
|
||||
# %py_byte_compile <interpereter> <path>
|
||||
# %%py_byte_compile <interpereter> <path>
|
||||
# Example:
|
||||
# %py_byte_compile %{__python3} %{buildroot}%{_datadir}/spam/plugins/
|
||||
# %%py_byte_compile %%{__python3} %%{buildroot}%%{_datadir}/spam/plugins/
|
||||
|
||||
# This will terminate build on SyntaxErrors, if you want to avoid that,
|
||||
# use it in a subshell like this:
|
||||
# (%{py_byte_compile <interpereter> <path>}) || :
|
||||
# (%%{py_byte_compile <interpereter> <path>}) || :
|
||||
|
||||
# Setting PYTHONHASHSEED=0 disables Python hash seed randomization
|
||||
# This should help with byte-compilation reproducibility: https://bugzilla.redhat.com/show_bug.cgi?id=1686078
|
||||
|
@ -47,7 +47,7 @@
|
||||
# a specific version (e.g. 34 in Fedora EPEL7)
|
||||
%python3_pkgversion 3
|
||||
|
||||
# Set to /bin/true to avoid %ifdefs and %{? in specfiles
|
||||
# Set to /bin/true to avoid %%ifdefs and %%{? in specfiles
|
||||
%__python3_other /bin/true
|
||||
%py3_other_build /bin/true
|
||||
%py3_other_install /bin/true
|
||||
@ -68,7 +68,7 @@
|
||||
|
||||
# Creates Python 2 dist tag(s) after converting names to canonical format
|
||||
# Needs to first put all arguments into a list, because invoking a different
|
||||
# macro (%py_dist_name) overwrites them
|
||||
# macro (%%py_dist_name) overwrites them
|
||||
%py2_dist() %{lua:\
|
||||
args = {}\
|
||||
arg = 1\
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
# Creates Python 3 dist tag(s) after converting names to canonical format
|
||||
# Needs to first put all arguments into a list, because invoking a different
|
||||
# macro (%py_dist_name) overwrites them
|
||||
# macro (%%py_dist_name) overwrites them
|
||||
%py3_dist() %{lua:\
|
||||
python3_pkgversion = rpm.expand("%python3_pkgversion");\
|
||||
args = {}\
|
||||
@ -110,12 +110,12 @@
|
||||
# Macro to replace overly complicated references to PyPI source files.
|
||||
# Expands to the pythonhosted URL for a package
|
||||
# Accepts zero to three arguments:
|
||||
# 1: The PyPI project name, defaulting to %srcname if it is defined, then
|
||||
# %pypi_name if it is defined, then just %name.
|
||||
# 2: The PYPI version, defaulting to %version with tildes stripped.
|
||||
# 1: The PyPI project name, defaulting to %%srcname if it is defined, then
|
||||
# %%pypi_name if it is defined, then just %%name.
|
||||
# 2: The PYPI version, defaulting to %%version with tildes stripped.
|
||||
# 3: The file extension, defaulting to "tar.gz". (A period will be added
|
||||
# automatically.)
|
||||
# Requires %__pypi_url and %__pypi_default_extension to be defined.
|
||||
# Requires %%__pypi_url and %%__pypi_default_extension to be defined.
|
||||
%__pypi_url https://files.pythonhosted.org/packages/source/
|
||||
%__pypi_default_extension tar.gz
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: python-rpm-macros
|
||||
Version: 3.9
|
||||
Release: 37%{?dist}
|
||||
Release: 38%{?dist}
|
||||
Summary: The common Python RPM macros
|
||||
|
||||
# macros and lua: MIT, compileall2.py: PSFv2
|
||||
@ -76,6 +76,11 @@ mkdir -p %{buildroot}%{_rpmconfigdir}/redhat
|
||||
install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
|
||||
|
||||
%check
|
||||
# no macros in comments
|
||||
! grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.*
|
||||
|
||||
|
||||
%files
|
||||
%{rpmmacrodir}/macros.python
|
||||
%{rpmmacrodir}/macros.pybytecompile
|
||||
@ -90,6 +95,10 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Apr 27 2021 Miro Hrončok <mhroncok@redhat.com> - 3.9-38
|
||||
- Escape %% symbols in macro files comments
|
||||
- Fixes: rhbz#1953910
|
||||
|
||||
* Fri Apr 16 2021 Karolina Surma <ksurma@redhat.com> - 3.9-37
|
||||
- Use sysconfig.get_path() to get %%python3_sitelib and %%python3_sitearch
|
||||
- Fixes: rhbz#1947468
|
||||
|
Loading…
Reference in New Issue
Block a user