FS#23258 - [namcap] namcap dies when pkgbuild misses source or md5sum array

Attached to Project: Arch Linux
Opened by Jelle van der Waa (jelly) - Sunday, 13 March 2011, 14:00 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Sunday, 13 March 2011, 16:24 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Rémy Oudompheng (remyoudompheng)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

If the source=() or md5sums=() array is missing namcap aborts with a python traceback. This will happen with all the -cvs,git,svn packages.
Because these pkgbuilds pull from vcs it's not logical to add md5sums or source array, it would also be nicer to get an error message like: " source array is missing "

Version: namcap 3.0-1

Erroroutput:
Traceback (most recent call last):
File "/usr/lib/python3.2/runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python3.2/runpy.py", line 73, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.2/site-packages/namcap.py", line 276, in <module>
process_pkgbuild(package, active_modules)
File "/usr/lib/python3.2/site-packages/namcap.py", line 182, in process_pkgbuild
ret = rule.analyze(pkginfo, package)
File "/usr/lib/python3.2/site-packages/Namcap/rules/missingvars.py", line 46, in analyze
if len(pkginfo["source"]) > len(pkginfo[sumname]):
File "/usr/lib/python3.2/site-packages/Namcap/package.py", line 114, in __getitem__
return self._data[self.canonical_varname(key)]
KeyError: 'source'
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Sunday, 13 March 2011, 16:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 3.0.1
Comment by Jelle van der Waa (jelly) - Sunday, 13 March 2011, 14:26 GMT
here is the pkgbuild i used namcap one.
   PKGBUILD (1.6 KiB)
Comment by Jelle van der Waa (jelly) - Sunday, 13 March 2011, 14:28 GMT
btw just realised this isn't the faulty one, when you remove the source=() and md5sums=() array it fails.

Loading...