uyuni-project / uyuni

Source code for Uyuni
https://www.uyuni-project.org/
GNU General Public License v2.0
432 stars 181 forks source link

repository sync failed - caret sign in package name #9211

Closed ZsBT closed 1 week ago

ZsBT commented 2 months ago

Problem description

repo sync fails when a package contains some special characters, e.g. caret sign (^) or tilde (~). it says ValueError: The value <PACKAGE NAME> cannot be parsed as a NEVRA string.

Steps to reproduce

  1. sync a repo that has a package with caret sign in its name

Uyuni version

Repository     : uyuni-server-stable
Name           : Uyuni-Server-release
Version        : 2024.07-230900.219.1.uyuni3
Arch           : x86_64
Vendor         : obs://build.opensuse.org/systemsmanagement:Uyuni
Support Level  : Level 3
Installed Size : 1.4 KiB
Installed      : Yes
Status         : up-to-date
Source package : Uyuni-Server-release-2024.07-230900.219.1.uyuni3.src

Uyuni proxy version (if used)

No response

Useful logs

Syncing Channel 'centosstream8' failed:

Exception reported from uyuni
Time: Tue Aug 27 01:53:17 2024
Exception type <class 'ValueError'>

Exception Handler Information
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/reposync.py", line 787, in sync
    modulemd_importer.import_module_metadata()
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/appstreams.py", line 127, in import_module_metadata
    nevra = self._parse_rpm_name(rpm)
  File "/usr/lib/python3.6/site-packages/spacewalk/satellite_tools/appstreams.py", line 305, in _parse_rpm_name
    raise ValueError(f"The value {nevra} cannot be parsed as a NEVRA string.")
ValueError: The value toolbox-0:0.0.99.2^1.git660b6970e998-1.module_el8.5.0+874+6db8bee3.src cannot be parsed as a NEVRA string.

Additional information

No response

ZsBT commented 2 months ago

Maybe this line is responsible:

https://github.com/uyuni-project/uyuni/blob/37d5572dbcf563012a7a1b15a3c9d9caefd49c03/python/spacewalk/satellite_tools/appstreams.py#L292

I'll look at it.