of all packages the db contains. @param db pointer to the package database to get the package from @return the list of packages on success, NULL on error