aboutcode-org / aboutcode-org/debian-inspector

Add an option to skip version validation in `package.get_nva`

Đang mở
#50 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
17
Fork
7
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

We're using `package.get_nva` to extract name and version from a Debian package filename in [pipeline to mine Debian PURLs](https://github.com/aboutcode-org/purldb/blob/785907d602dfc8b003aaa374c21fadd3d33603ad/minecode_pipelines/pipelines/mine_debian.py). At PackageURL mining stage if we find a package version upstream we need to collect it, and we are not concerned whether or not the given version is a syntactically correct version at that stage. To insure this we should have an optional flag in `package.get_nva` to skip version validation.

Log from mine_debain pipeline:
```python
2025-12-08 12:11:14.248750 UTC Failed to get PURL field from: gcc-bpf_14.3.0-10+_s390x.deb with error ValueError('Invalid version string: "14.3.0-10+"'):
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/minecode_pipelines/pipes/debian.py", line 131, in get_packages
name, version, arch = debian_inspector.package.get_nva(file_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/debian_inspector/package.py", line 163, in get_nva
return name, Version.from_string(evr), arch
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/debian_inspector/version.py", line 135, in from_string
raise ValueError('Invalid version string: "{}"'.format(version))
ValueError: Invalid version string: "14.3.0-10+"
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.