summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/package.c b/src/package.c
index 377c82c..e327ce5 100644
--- a/src/package.c
+++ b/src/package.c
@@ -623,6 +623,9 @@ int apk_pkg_add_info(struct apk_database *db, struct apk_package *pkg,
case 'L':
pkg->license = apk_blob_cstr(value);
break;
+ case 'A':
+ pkg->arch = apk_blob_cstr(value);
+ break;
case 'D':
apk_deps_parse(db, &pkg->depends, value);
break;
@@ -655,6 +658,7 @@ static int read_info_line(void *ctx, apk_blob_t line)
{ "url", 'U' },
{ "size", 'I' },
{ "license", 'L' },
+ { "arch", 'A' },
{ "depend", 'D' },
};
struct read_info_ctx *ri = (struct read_info_ctx *) ctx;
@@ -767,6 +771,8 @@ void apk_pkg_free(struct apk_package *pkg)
free(pkg->description);
if (pkg->license)
free(pkg->license);
+ if (pkg->arch)
+ free(pkg->arch);
free(pkg);
}
@@ -903,6 +909,10 @@ int apk_pkg_write_index_entry(struct apk_package *info,
apk_blob_push_blob(&bbuf, APK_BLOB_STR(info->name->name));
apk_blob_push_blob(&bbuf, APK_BLOB_STR("\nV:"));
apk_blob_push_blob(&bbuf, APK_BLOB_STR(info->version));
+ if (info->arch != NULL) {
+ apk_blob_push_blob(&bbuf, APK_BLOB_STR("\nA:"));
+ apk_blob_push_blob(&bbuf, APK_BLOB_STR(info->arch));
+ }
apk_blob_push_blob(&bbuf, APK_BLOB_STR("\nS:"));
apk_blob_push_uint(&bbuf, info->size, 10);
apk_blob_push_blob(&bbuf, APK_BLOB_STR("\nI:"));