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.cute-signatures
parent
28dcd5d3b3
commit
94ce7f01bf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue