diff --git a/bin/xbps-repo/util.c b/bin/xbps-repo/util.c index c9def1f8..a66fad39 100644 --- a/bin/xbps-repo/util.c +++ b/bin/xbps-repo/util.c @@ -73,6 +73,11 @@ show_pkg_info(prop_dictionary_t dict) assert(dict != NULL); assert(prop_dictionary_count(dict) != 0); + obj = prop_dictionary_get(dict, "archive-compression-type"); + if (obj && prop_object_type(obj) == PROP_TYPE_STRING) + printf("Compression type: %s\n", + prop_string_cstring_nocopy(obj)); + obj = prop_dictionary_get(dict, "pkgname"); if (obj && prop_object_type(obj) == PROP_TYPE_STRING) printf("Package: %s\n", prop_string_cstring_nocopy(obj)); diff --git a/lib/repository_plist.c b/lib/repository_plist.c index 198043e4..f67efe19 100644 --- a/lib/repository_plist.c +++ b/lib/repository_plist.c @@ -175,12 +175,17 @@ xbps_get_pkg_plist_dict_from_url(const char *url, const char *plistf) prop_dictionary_t plistd = NULL; struct archive *a; struct archive_entry *entry; - const char *curpath; + const char *curpath, *comptype; int i = 0; if ((a = open_archive(url)) == NULL) return NULL; + /* + * Save compression type string for future use. + */ + comptype = archive_compression_name(a); + while ((archive_read_next_header(a, &entry)) == ARCHIVE_OK) { curpath = archive_entry_pathname(entry); if (i >= 5) { @@ -201,6 +206,9 @@ xbps_get_pkg_plist_dict_from_url(const char *url, const char *plistf) errno = EINVAL; break; } + prop_dictionary_set_cstring_nocopy(plistd, + "archive-compression-type", comptype); + break; } archive_read_finish(a);