Skip to content

Commit

Permalink
Merge pull request #1273 from rpm-software-management/update-desktop-…
Browse files Browse the repository at this point in the history
…files

Add new warning about the usage of %suse_update_desktop_file
  • Loading branch information
danigm authored Oct 3, 2024
2 parents 525b9c5 + 6009cc8 commit fd7ba4e
Show file tree
Hide file tree
Showing 5 changed files with 717 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 @@ -84,6 +84,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 @@ -685,6 +689,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 @@ -789,3 +794,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')
4 changes: 4 additions & 0 deletions rpmlint/descriptions/SpecCheck.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,7 @@ file path like:
%{python_sitelib}/packagename
%{python_sitelib}/packagename-%{version}*-info
"""

suse-update-desktop-file-deprecated="""
The usage of %suse_update_desktop_file is deprecated and should not be used.
"""
Loading

0 comments on commit fd7ba4e

Please sign in to comment.