Handle empty hash values on packages

If a packages does not provide a sha256 hash we need to generate one.
Use the package name and version for this. This issue appears for
example on older precise boxes where no package updates have happened.

Include two package lists generated with aptcacheexport as test cases.