Misc cleanups and performance improvements.
- There's no need to check rval for prop_dictionary_get_*, we are sure the objects are there at prop_dictionary_set_* time. - Avoid two chdir(2) calls per INSTALL/REMOVE run. - Avoid using access(2) to check for existence of INSTALL/REMOVE scripts, just try to run the executable directly and check for ENOENT.
This commit is contained in:
@ -167,10 +167,8 @@ xbps_repository_get_path_from_pkg_dict(prop_dictionary_t d, const char *uri)
|
||||
if (path)
|
||||
return path;
|
||||
|
||||
if (!prop_dictionary_get_cstring_nocopy(d, "architecture", &arch))
|
||||
return NULL;
|
||||
if (!prop_dictionary_get_cstring_nocopy(d, "filename", &filen))
|
||||
return NULL;
|
||||
prop_dictionary_get_cstring_nocopy(d, "architecture", &arch);
|
||||
prop_dictionary_get_cstring_nocopy(d, "filename", &filen);
|
||||
|
||||
return xbps_xasprintf("%s/%s/%s", uri, arch, filen);
|
||||
}
|
||||
|
Reference in New Issue
Block a user