Skip to content

Commit

Permalink
Merge branch 'main' into opensuse
Browse files Browse the repository at this point in the history
  • Loading branch information
danigm committed Oct 3, 2024
2 parents 5cb5647 + fd7ba4e commit 6ac7f14
Show file tree
Hide file tree
Showing 5 changed files with 716 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rpmlint/checks/SpecCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def re_tag_compile(tag):
python_module_def_regex = re.compile(r'^[^#]*%{\?!python_module:%define python_module()')
python_sitelib_glob_regex = re.compile(r'^[^#]*%{python_site(lib|arch)}/\*\s*$')

# %suse_update_desktop_file deprecation
# https://lists.opensuse.org/archives/list/[email protected]/message/TF4QO7ECOSEDHBFI5YDEA3OF4RNSI7D7/
suse_update_desktop_file_regex = re.compile(r'^BuildRequires:\s*update-desktop-files', re.IGNORECASE)

UNICODE_NBSP = '\xa0'


Expand Down Expand Up @@ -698,6 +702,7 @@ def _checkline_package(self, line):
self._checkline_package_conflicts(line)

self._checkline_forbidden_controlchars(line)
self._check_suse_update_desktop_file(line)

def _checkline_changelog(self, line):
if self.current_section == 'changelog':
Expand Down Expand Up @@ -802,3 +807,13 @@ def _checkline_forbidden_controlchars(self, line):
# https://github.com/rpm-software-management/rpmlint/issues/1067
if Pkg.has_forbidden_controlchars(line):
self.output.add_info('W', self.pkg, 'forbidden-controlchar-found')

def _check_suse_update_desktop_file(self, line):
"""
Test if update-desktop-files is in BuildRequires. The usage of
%suse_update_desktop_file is deprecated now.
"""
if suse_update_desktop_file_regex.match(line):
self.output.add_info('W', self.pkg,
'suse-update-desktop-file-deprecated',
'%suse_update_desktop_file is deprecated')
3 changes: 3 additions & 0 deletions rpmlint/descriptions/SpecCheck.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,6 @@ invalid-suse-version-check="""
The specfile contains a comparison of %suse_version against a suse release
that does not exist. Please double check.
"""
suse-update-desktop-file-deprecated="""
The usage of %suse_update_desktop_file is deprecated and should not be used.
"""
Loading

0 comments on commit 6ac7f14

Please sign in to comment.