From 0cf9047bd26b84a45c68a25251b1c4c5361cf65e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 25 Dec 2013 08:40:45 +0100 Subject: [PATCH] unpack: use files.plist from binpkg when checking for configuration files. --- lib/package_config_files.c | 11 +++++------ lib/package_unpack.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/package_config_files.c b/lib/package_config_files.c index 16a95d39..8653ffd1 100644 --- a/lib/package_config_files.c +++ b/lib/package_config_files.c @@ -34,21 +34,20 @@ * Returns true if entry is a configuration file, false otherwise. */ int HIDDEN -xbps_entry_is_a_conf_file(xbps_dictionary_t propsd, +xbps_entry_is_a_conf_file(xbps_dictionary_t filesd, const char *entry_pname) { xbps_array_t array; + xbps_dictionary_t d; const char *cffile; - assert(xbps_object_type(propsd) == XBPS_TYPE_DICTIONARY); - assert(entry_pname != NULL); - - array = xbps_dictionary_get(propsd, "conf_files"); + array = xbps_dictionary_get(filesd, "conf_files"); if (xbps_array_count(array) == 0) return false; for (unsigned int i = 0; i < xbps_array_count(array); i++) { - xbps_array_get_cstring_nocopy(array, i, &cffile); + d = xbps_array_get(array, i); + xbps_dictionary_get_cstring_nocopy(d, "file", &cffile); if (strcmp(cffile, entry_pname) == 0) return true; } diff --git a/lib/package_unpack.c b/lib/package_unpack.c index b7ecb981..47c8282b 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -373,7 +373,7 @@ unpack_archive(struct xbps_handle *xhp, * "conf_files" array on its XBPS_PKGPROPS * dictionary. */ - if (xbps_entry_is_a_conf_file(propsd, buf)) { + if (xbps_entry_is_a_conf_file(filesd, buf)) { conf_file = true; if (xhp->unpack_cb != NULL) xucd.entry_is_conf = true;