Crashes in `rules/licensepkg.py` on dangling symlink.
namcap version 3.5.2 repeatedly crashes on a broken symlink in a package file while checking for license.
I have attached such a package: amd-psr-identification-script-git-r168.20240116.d74e279-1-any.pkg.tar.
When I run namcap on it without the target of the symlink present on the system, namcap crashes with
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/lib/python3.11/site-packages/namcap.py", line 253, in <module>
process_realpackage(package, active_modules)
File "/usr/lib/python3.11/site-packages/namcap.py", line 95, in process_realpackage
rule.analyze(pkginfo, pkgtar)
File "/usr/lib/python3.11/site-packages/Namcap/rules/licensepkg.py", line 279, in analyze
if outbound_license in other_pkg["files"]:
~~~~~~~~~^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
When the target file is present on the syetem, it does not crash but correctly reports
amd-psr-identification-script-git E: Symlink to license file 'usr/share/doc/amdgpu-test-scripts/license-info.txt' points to an external package, but either the file is missing or the package is not a dependency
amd-psr-identification-script-git W: Symlinks to license files in other packages should be replaced by the actual license files: usr/share/doc/amdgpu-test-scripts/license-info.txt
Regards!
P.S.: I already reported this issue via email to persons in the AUTHORS file on 2024-01-17 (to caleb (at( alerque ]dot[ com), 2024-04-10 (to remy(at(archlinux_DOT_org and remy_at)archlinux(dot)org), since this forced two-factor authentication to submit issues was not overcomable for me for months. I got no reaction to that reports, and the issue is still present.