libxbps: unpack: simplify file hash matching code.

This commit is contained in:
Juan RP
2012-09-30 17:07:51 +02:00
parent 7909f597cb
commit bdeeaa46b8
2 changed files with 15 additions and 32 deletions

View File

@ -358,12 +358,11 @@ unpack_archive(struct xbps_handle *xhp,
*/
conf_file = file_exists = false;
if (S_ISREG(entry_statp->st_mode)) {
if (xbps_entry_is_a_conf_file(propsd, entry_pname))
buf = strchr(entry_pname, '.') + 1;
assert(buf != NULL);
if (xbps_entry_is_a_conf_file(propsd, buf))
conf_file = true;
if (stat(entry_pname, &st) == 0) {
/* remove first char, i.e '.' */
buf = strchr(entry_pname, '.') + 1;
assert(buf != NULL);
file_exists = true;
rv = xbps_file_hash_check_dictionary(xhp, filesd,
conf_file ? "conf_files" : "files", buf);