some refactoring -- borrowing code from pkgfile
drop dead code
move entry_filename in parse_db_entry