Commit e128c95f authored by Timo Teräs's avatar Timo Teräs

pkg: add field for provides as 'p'

ref #574
parent 9ef5bf6e
...@@ -93,7 +93,7 @@ struct apk_package { ...@@ -93,7 +93,7 @@ struct apk_package {
apk_blob_t *origin, *maintainer; apk_blob_t *origin, *maintainer;
char *url, *description, *commit; char *url, *description, *commit;
char *filename; char *filename;
struct apk_dependency_array *depends, *install_if; struct apk_dependency_array *depends, *install_if, *provides;
size_t installed_size, size; size_t installed_size, size;
time_t build_time; time_t build_time;
unsigned int topology_hard; unsigned int topology_hard;
......
...@@ -69,6 +69,7 @@ struct apk_package *apk_pkg_new(void) ...@@ -69,6 +69,7 @@ struct apk_package *apk_pkg_new(void)
if (pkg != NULL) { if (pkg != NULL) {
apk_dependency_array_init(&pkg->depends); apk_dependency_array_init(&pkg->depends);
apk_dependency_array_init(&pkg->install_if); apk_dependency_array_init(&pkg->install_if);
apk_dependency_array_init(&pkg->provides);
} }
return pkg; return pkg;
...@@ -732,6 +733,9 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg, ...@@ -732,6 +733,9 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg,
case 'I': case 'I':
pkg->installed_size = apk_blob_pull_uint(&value, 10); pkg->installed_size = apk_blob_pull_uint(&value, 10);
break; break;
case 'p':
apk_blob_pull_deps(&value, db, &pkg->provides);
break;
case 'i': case 'i':
apk_blob_pull_deps(&value, db, &pkg->install_if); apk_blob_pull_deps(&value, db, &pkg->install_if);
break; break;
...@@ -748,7 +752,7 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg, ...@@ -748,7 +752,7 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg,
pkg->commit = apk_blob_cstr(value); pkg->commit = apk_blob_cstr(value);
break; break;
case 'F': case 'M': case 'R': case 'Z': case 'r': case 'q': 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 */ /* installed db entries which are handled in database.c */
return 1; return 1;
default: default:
...@@ -780,6 +784,7 @@ static int read_info_line(void *ctx, apk_blob_t line) ...@@ -780,6 +784,7 @@ static int read_info_line(void *ctx, apk_blob_t line)
{ "arch", 'A' }, { "arch", 'A' },
{ "depend", 'D' }, { "depend", 'D' },
{ "install_if", 'i' }, { "install_if", 'i' },
{ "provides", 'p' },
{ "origin", 'o' }, { "origin", 'o' },
{ "maintainer", 'm' }, { "maintainer", 'm' },
{ "builddate", 't' }, { "builddate", 't' },
...@@ -1093,6 +1098,7 @@ int apk_pkg_write_index_entry(struct apk_package *info, ...@@ -1093,6 +1098,7 @@ int apk_pkg_write_index_entry(struct apk_package *info,
bbuf = apk_blob_pushed(APK_BLOB_BUF(buf), bbuf); bbuf = apk_blob_pushed(APK_BLOB_BUF(buf), bbuf);
if (os->write(os, bbuf.ptr, bbuf.len) != bbuf.len || if (os->write(os, bbuf.ptr, bbuf.len) != bbuf.len ||
write_depends(os, "D:", info->depends) || write_depends(os, "D:", info->depends) ||
write_depends(os, "p:", info->provides) ||
write_depends(os, "i:", info->install_if)) write_depends(os, "i:", info->install_if))
return -1; return -1;
......
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