diff options
-rw-r--r-- | src/apk_package.h | 2 | ||||
-rw-r--r-- | src/package.c | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/apk_package.h b/src/apk_package.h index 329bdec0ee..832168263b 100644 --- a/src/apk_package.h +++ b/src/apk_package.h @@ -93,7 +93,7 @@ struct apk_package { apk_blob_t *origin, *maintainer; char *url, *description, *commit; char *filename; - struct apk_dependency_array *depends, *install_if; + struct apk_dependency_array *depends, *install_if, *provides; size_t installed_size, size; time_t build_time; unsigned int topology_hard; diff --git a/src/package.c b/src/package.c index 74ce183d83..5b89c0b189 100644 --- a/src/package.c +++ b/src/package.c @@ -69,6 +69,7 @@ struct apk_package *apk_pkg_new(void) if (pkg != NULL) { apk_dependency_array_init(&pkg->depends); apk_dependency_array_init(&pkg->install_if); + apk_dependency_array_init(&pkg->provides); } return pkg; @@ -732,6 +733,9 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg, case 'I': pkg->installed_size = apk_blob_pull_uint(&value, 10); break; + case 'p': + apk_blob_pull_deps(&value, db, &pkg->provides); + break; case 'i': apk_blob_pull_deps(&value, db, &pkg->install_if); break; @@ -748,7 +752,7 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg, pkg->commit = apk_blob_cstr(value); break; case 'F': case 'M': case 'R': case 'Z': case 'r': case 'q': - case 'a': case 'p': case 's': + case 'a': case 's': /* installed db entries which are handled in database.c */ return 1; default: @@ -780,6 +784,7 @@ static int read_info_line(void *ctx, apk_blob_t line) { "arch", 'A' }, { "depend", 'D' }, { "install_if", 'i' }, + { "provides", 'p' }, { "origin", 'o' }, { "maintainer", 'm' }, { "builddate", 't' }, @@ -1093,6 +1098,7 @@ int apk_pkg_write_index_entry(struct apk_package *info, bbuf = apk_blob_pushed(APK_BLOB_BUF(buf), bbuf); if (os->write(os, bbuf.ptr, bbuf.len) != bbuf.len || write_depends(os, "D:", info->depends) || + write_depends(os, "p:", info->provides) || write_depends(os, "i:", info->install_if)) return -1; |