Red Hat Bugzilla – Bug 283831
Last modified: 2008-04-03 14:27:21 EDT
Description of problem:
Due to operator error, I managed to create an empty jar file (containing only
META-INF/MANIFEST.MF). Then aot-compile-rpm crashed:
Traceback (most recent call last):
File "/usr/bin/aot-compile-rpm", line 66, in <module>
File "/usr/lib/python2.5/site-packages/aotcompile.py", line 98, in compile
File "/usr/lib/python2.5/site-packages/aotcompile.py", line 124, in
(job.dsoName(), job.dbName()) for job in jobs]))}
TypeError: reduce() of empty sequence with no initial value
error: Bad exit status from /var/tmp/rpm-tmp.78936 (%install)
It took me a little digging through the code to figure out what that crash
meant. It would be good to catch this exception and issue an error message
instead, perhaps "You dummy, there's nothing in your JAR file!"
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Write an RPM script that produces an empty jar file. Have the %build script
execute "jar cf some.jar", for example.
2. Invoke aot-compile-rpm in the %install section
3. Invoke rpmbuild on the script
aot-compile-rpm crashes with the stacktrace given above
aot-compile-rpm should instead warn that it was given an empty JAR file
I've managed to generate the same error on F8 under the same circumstances. As
I'm not a Python person, I didn't know what I doing was wrong until some
Googling brought me here.
Gary, can you take a quick look at this one?
I committed a fix.