remove.c: check that required objs are in files.plist.

--HG--
extra : convert_revision : a4e15ac3f48bf496d8671997b8e875c750b42730
This commit is contained in:
Juan RP 2009-03-02 02:47:12 +01:00
parent 0d8f08e8ea
commit 4c70b24941
1 changed files with 6 additions and 3 deletions

View File

@ -118,15 +118,18 @@ remove_pkg_files(prop_object_t obj, void *arg, bool *loop_done)
(void)loop_done;
prop_dictionary_get_cstring_nocopy(obj, "file", &file);
if (file == NULL)
if (!prop_dictionary_get_cstring_nocopy(obj, "file", &file))
return EINVAL;
path = xbps_append_full_path(false, rmcb->destdir, file);
if (path == NULL)
return EINVAL;
prop_dictionary_get_cstring_nocopy(obj, "type", &type);
if (!prop_dictionary_get_cstring_nocopy(obj, "type", &type)) {
free(path);
return EINVAL;
}
if (strcmp(type, "file") == 0) {
prop_dictionary_get_cstring_nocopy(obj, "sha256", &sha256);
rv = xbps_check_file_hash(path, sha256);