diff options
author | Timo Teräs <timo.teras@iki.fi> | 2011-01-04 11:45:34 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2011-01-04 11:45:34 +0200 |
commit | 94ce7f01bf62bc30e8b5f44f6fb17eecbd820036 (patch) | |
tree | d83d91fe3382d38b8cc854a9ac38a873c6589807 /src/database.c | |
parent | 28dcd5d3b341eb16fceb6cd362e5dd6875b4467b (diff) | |
download | apk-tools-94ce7f01bf62bc30e8b5f44f6fb17eecbd820036.tar.gz apk-tools-94ce7f01bf62bc30e8b5f44f6fb17eecbd820036.tar.bz2 apk-tools-94ce7f01bf62bc30e8b5f44f6fb17eecbd820036.tar.xz apk-tools-94ce7f01bf62bc30e8b5f44f6fb17eecbd820036.zip |
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.
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c index c1e8a6a..a536fb1 100644 --- a/src/database.c +++ b/src/database.c @@ -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; |