Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new warning about the usage of %suse_update_desktop_file #1273

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading