Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#65042 - namcap: failure on simple PKGBUILD

Attached to Project: Arch Linux
Opened by Allan McRae (Allan) - Saturday, 04 January 2020, 09:14 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 16 November 2020, 20:07 GMT
Task Type Bug Report
Category Arch Projects
Status Assigned
Assigned To Kyle Keen (keenerd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 50%
Votes 6
Private No

Details

pkgname=('a')
pkgver=1
pkgrel=1
arch=('any')

package_a() {
mkdir -p $pkgdir/usr/bin/bar/
}



$ namcap PKGBUILD
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.8/site-packages/namcap.py", line 247, in <module>
process_pkgbuild(package, active_modules)
File "/usr/lib/python3.8/site-packages/namcap.py", line 148, in process_pkgbuild
ret = rule.analyze(pkginfo, package)
File "/usr/lib/python3.8/site-packages/Namcap/rules/makedepends.py", line 59, in analyze
for s in pkginfo["source"]:
File "/usr/lib/python3.8/site-packages/Namcap/package.py", line 128, in __getitem__
return self._data[self.canonical_varname(key)]
KeyError: 'source'
This task depends upon

Comment by sekret (sekret) - Saturday, 04 January 2020, 11:08 GMT
That output makes sense! Your simple PKGBUILD doesn't contain the source variable, which I'd say is required, even if empty (edit: no, source mustn't be empty!)

After adding a source line source=('test'), the output is fine, only complaining about missing checksums, Maintainer tag, description in PKGBUILD, url and license.
   output (0.7 KiB)
Comment by Allan McRae (Allan) - Saturday, 04 January 2020, 11:20 GMT
It is a valid PKGBUILD. It should not error with a lack of source array. Note that the Arch Linux "base" package has no source array.
Comment by Doug Newgard (Scimmia) - Saturday, 04 January 2020, 15:45 GMT
sekret, I don't know what would give you the idea that the source array is required. See metapackages, for example.
Comment by sekret (sekret) - Saturday, 04 January 2020, 19:13 GMT
Sorry, my comment was bullshit! Please ignore :-( It's clearly a bug!
Comment by Eli Schwartz (eschwartz) - Sunday, 05 January 2020, 01:11 GMT
Reassigning to the actual namcap maintainer...
Comment by (arisinfenix) - Friday, 24 January 2020, 19:45 GMT Comment by Richard Neumann (rne) - Tuesday, 28 July 2020, 08:37 GMT
This appears to be a regression from  FS#23258 .
Furthermore this issue also occurs on PKGBUILDs with architecture-specific sources, like anydesk-bin from the AUR:
https://bbs.archlinux.org/viewtopic.php?id=257692
Comment by Nicolas I. (IooNag) - Monday, 16 November 2020, 19:57 GMT
I stumbled about this bug while trying to run namcap on base ("asp checkout base && cd base/trunk && namcap PKGBUILD" leads to exception "KeyError: 'source'"). What is preventing it from being fixed?
Comment by Eli Schwartz (eschwartz) - Monday, 16 November 2020, 20:07 GMT
  • Field changed: Percent Complete (0% → 50%)
It is fixed in namcap-git, currently we're just waiting for a release is all.
Comment by Erich Eckner (deepthought) - Friday, 26 March 2021, 07:07 GMT
What's the expected time before a new namcap is being released? This bugs me each time, namcap is being re-packaged (and thus, my manual patch is being overwritten by pacman again).
Comment by Dan Ginovker (Dr-Bracket) - Thursday, 21 October 2021, 20:42 GMT
Also wondering - it's either not fixed or the same bug has regressed again

Loading...