Commit 94ce7f01 authored by Timo Teräs's avatar Timo Teräs
Browse files

db: check and initiailize required package fields before addition to db

The atomization change broke virtual packages because they don't
have license or arch set.
parent 28dcd5d3
......@@ -426,6 +426,11 @@ struct apk_package *apk_db_pkg_add(struct apk_database *db, struct apk_package *
struct apk_package *idb;
if (pkg->license == NULL)
pkg->license = apk_blob_atomize(APK_BLOB_NULL);
if (pkg->arch == NULL)
pkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));
idb = apk_hash_get(&db->available.packages, APK_BLOB_CSUM(pkg->csum));
if (idb == NULL) {
idb = pkg;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment