Compare commits

...

10 Commits

Author SHA1 Message Date
Michal Domonkos
c15f69361f Don't gate on tier0 test 2023-05-19 09:27:14 +00:00
Michal Domonkos
6722bafeee Disable flake8 self-test
RHEL-9 doesn't ship flake8.  Note that it was already disabled for
%check anyway, but we also have an internal beaker test that runs
test.sh where we would have to disable it too, at which point it's just
easier to do that in test.sh itself.

While at it, remove all traces of flake8 from the spec file as well, to
avoid confusion in the future.

Related: #1929210
2022-01-12 17:24:43 +01:00
Michal Domonkos
466781fc37 Handle missing language error during spellcheck
Previously, PyEnchant raised a DictNotFoundError from the SpellChecker
constructor in case it didn't find the given language.  This was
recently[1] changed/fixed upstream to actually handle that error in the
constructor and then raise a DefaultLanguageNotFoundError instead.
Adapt our code to it but also keep handling the previous error, just in
case.

Note that this was never fixed in rpmlint upstream since that has moved
on and rewritten quite a bit of the codebase, fixing this traceback in
the process, hence a downstream-only patch here.

[1] commit 5fc8ecc458b7b84d88ce629f74905549790141ee at:
    https://github.com/pyenchant/pyenchant/

Resolves: #1929210
2022-01-11 16:50:45 +01:00
Michal Domonkos
2d27f76ec0 Enable bash-completion
This is the same RHEL-specific change as we made in 8.1 (#1577890).

Resolves: #1999654
2022-01-10 11:19:18 +01:00
Mohan Boddu
0cc08d4a83 Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-08-10 00:39:38 +00:00
Aleksandra Fedorova
178f84a306 Add RHEL gating configuration 2021-07-15 03:26:35 +02:00
Mohan Boddu
94ddd18904 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
Signed-off-by: Mohan Boddu <mboddu@redhat.com>
2021-04-16 05:11:43 +00:00
DistroBaker
b6e57fe35d Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/rpmlint.git#6f1c44bf23fe5760e02a48280bb13db33f5ff596
2021-02-05 15:31:44 +00:00
DistroBaker
214a1600ef Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/rpmlint.git#44a9bb588af1bc7a3fc764b964179ba3384e5690
2021-02-05 05:28:50 +01:00
DistroBaker
2ddbc9a144 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/rpmlint.git#77d737a57a2cc278dd2bb182679ee441afc73b97
2021-01-25 21:26:09 +00:00
6 changed files with 80 additions and 19 deletions

1
.rpmlint.metadata Normal file
View File

@ -0,0 +1 @@
473ddaabbe28a2f5836116d4b19e4a9b641fd038 rpmlint-1.11.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1-gating.functional}

View File

@ -0,0 +1,23 @@
diff -up rpmlint-rpmlint-1.11/test.sh.orig rpmlint-rpmlint-1.11/test.sh
--- rpmlint-rpmlint-1.11/test.sh.orig 2022-01-12 17:23:52.565790275 +0100
+++ rpmlint-rpmlint-1.11/test.sh 2022-01-12 17:24:02.043920708 +0100
@@ -2,7 +2,7 @@
export PYTHONPATH=$(pwd)/tools:$(pwd)
export TESTPATH="$(pwd)/test/"
-: ${PYTHON:=python} ${PYTEST:=py.test} ${FLAKE8:=flake8}
+: ${PYTHON:=python} ${PYTEST:=py.test}
: ${PYTHONWARNINGS:=all}
export PYTHONWARNINGS
@@ -40,10 +40,6 @@ $PYTEST -v || exit $?
unset PYTHONWARNINGS
-echo "$FLAKE8 tests"
-$FLAKE8 --version
-$FLAKE8 . ./rpmdiff ./rpmlint || exit $?
-
echo "man page tests"
if man --help 2>&1 | grep -q -- --warnings; then
tmpfile=$(mktemp) || exit 1

View File

@ -0,0 +1,13 @@
diff -up rpmlint-rpmlint-1.11/TagsCheck.py.orig rpmlint-rpmlint-1.11/TagsCheck.py
--- rpmlint-rpmlint-1.11/TagsCheck.py.orig 2022-01-11 16:49:18.424026182 +0100
+++ rpmlint-rpmlint-1.11/TagsCheck.py 2022-01-11 16:50:05.774665734 +0100
@@ -463,7 +463,8 @@ def spell_check(pkg, str, fmt, lang, ign
lang, filters=[enchant.tokenize.EmailFilter,
enchant.tokenize.URLFilter,
enchant.tokenize.WikiWordFilter])
- except enchant.DictNotFoundError:
+ except (enchant.errors.DefaultLanguageNotFoundError,
+ enchant.DictNotFoundError):
printInfo(pkg, 'enchant-dictionary-not-found', lang)
pass
_enchant_checkers[lang] = checker

View File

@ -461,6 +461,8 @@ addFilter("info-files-without-install-info-postun")
addFilter("postin-without-install-info")
# pip 20.2 generates PEP 376 "REQUESTED" marker (empty)
addFilter(r"zero-length .+/site-packages/.+\.dist-info/REQUESTED\b")
# py.typed files are empty
addFilter(r"zero-length .+/site-packages/.+/py\.typed\b")
bad_crypto_warning = \
'''This application package calls a function to explicitly set crypto ciphers

View File

@ -15,12 +15,9 @@
%global pytest py.test
%endif
# linitng is flaky, so we fake it
%global flake8 true
Name: rpmlint
Version: 1.11
Release: 12%{?dist}
Release: 19%{?dist}
Summary: Tool for checking common errors in RPM packages
License: GPLv2
URL: https://github.com/rpm-software-management/rpmlint
@ -40,27 +37,27 @@ Patch213: rpmlint-1.11-libc-warnings.patch
# See https://fedoraproject.org/wiki/Changes/PythonMacroError
Patch214: rpmlint-1.11-no-python-macro.patch
# Downstream-only patches
Patch215: rpmlint-1.11-spellcheck-handle-missing-language-error.patch
Patch216: rpmlint-1.11-disable-flake8-self-test.patch
BuildArch: noarch
BuildRequires: make
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-rpm >= 4.4.2.2
BuildRequires: python3-pytest
#BuildRequires: python3-flake8-import-order
Requires: python3
Requires: python3-rpm >= 4.4.2.2
%else
BuildRequires: python >= 2.6
BuildRequires: rpm-python >= 4.4.2.2
BuildRequires: pytest
#BuildRequires: python2-flake8-import-order
Requires: python >= 2.6
Requires: rpm-python >= 4.4.2.2
%endif
BuildRequires: sed >= 3.95
%if ! 0%{?rhel}
# no bash-completion for RHEL
BuildRequires: bash-completion
%endif
# python-magic and python-enchant are actually optional dependencies, but
# they bring quite desirable features.
%if %{with python3}
@ -105,6 +102,10 @@ and source packages as well as spec files can be checked.
%patch212 -p1
%patch213 -p1
%patch214 -p1
%patch215 -p1
%patch216 -p1
sed -i 's|1.10|%{version}|g' Makefile
%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9
# TODO, take upstream (RPM 4.15 related)
@ -127,9 +128,7 @@ make install DESTDIR=$RPM_BUILD_ROOT ETCDIR=%{_sysconfdir} MANDIR=%{_mandir} \
LIBDIR=%{_datadir}/rpmlint BINDIR=%{_bindir} PYTHON=%{python}
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config
%if 0%{?rhel}
rm -rf %{buildroot}%{_sysconfdir}/bash_completion.d/
%endif
%check
@ -141,20 +140,14 @@ sed -i 's/test_pyc_m/xxx_pyc_m/' test/test_files.py
sed -i 's/test_inconsistent_file_extension/xxx_inconsistent_file_extension/' test/test_sources.py
%endif
make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8}
make check PYTHON=%{python} PYTEST=%{pytest}
%files
%license COPYING
%doc README.md config.example
%config(noreplace) %{_sysconfdir}/rpmlint/
%if 0%{?fedora}
%{_datadir}/bash-completion/
%else
%if ! 0%{?rhel}
%{_sysconfdir}/bash_completion.d/
%endif
%endif
%{_datadir}/bash-completion/completions/
%{_bindir}/rpmdiff
%{_bindir}/rpmlint
%{_datadir}/rpmlint/
@ -162,6 +155,29 @@ make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8}
%{_mandir}/man1/rpmlint.1*
%changelog
* Wed Jan 12 2022 Michal Domonkos <mdomonko@redhat.com> - 1.11-19
- Disable flake8 self-test (#1929210)
* Mon Jan 10 2022 Michal Domonkos <mdomonko@redhat.com> - 1.11-18
- Enable bash-completion (#1999654)
- Handle missing language error during spellcheck (#1929210)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.11-17
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.11-16
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Fri Feb 5 2021 Tom Callaway <spot@fedoraproject.org> - 1.11-15
- correct hard-coded version in Makefile
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jan 25 2021 Miro Hrončok <mhroncok@redhat.com> - 1.11-13
- Filter out empty py.typed files in Python site-packages
* Fri Aug 21 2020 Miro Hrončok <mhroncok@redhat.com> - 1.11-12
- Filter out empty REQUESTED files in pip installed Python metadata dist-info dirs