Simplify previous.
--HG-- extra : convert_revision : c93b6612845c64f9b9b929150014a76d6584ec1c
This commit is contained in:
parent
d5d280a93c
commit
500cfe4b4f
10
lib/remove.c
10
lib/remove.c
|
@ -222,14 +222,8 @@ xbps_remove_binary_pkg(const char *pkgname, bool update)
|
|||
if (strcmp(rootdir, "") == 0)
|
||||
rootdir = "/";
|
||||
|
||||
if (rootdir) {
|
||||
if (chdir(rootdir) == -1)
|
||||
return errno;
|
||||
} else {
|
||||
if (chdir("/") == -1)
|
||||
return errno;
|
||||
rootdir = "";
|
||||
}
|
||||
if (chdir(rootdir) == -1)
|
||||
return errno;
|
||||
|
||||
/* Check if pkg is installed */
|
||||
if (xbps_check_is_installed_pkgname(pkgname) == false)
|
||||
|
|
|
@ -143,13 +143,8 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg)
|
|||
if (strcmp(rootdir, "") == 0)
|
||||
rootdir = "/";
|
||||
|
||||
if (rootdir) {
|
||||
if (chdir(rootdir) == -1)
|
||||
return errno;
|
||||
} else {
|
||||
if (chdir("/") == -1)
|
||||
return errno;
|
||||
}
|
||||
if (chdir(rootdir) == -1)
|
||||
return errno;
|
||||
|
||||
prop_dictionary_get_cstring_nocopy(pkg, "pkgname", &pkgname);
|
||||
prop_dictionary_get_cstring_nocopy(pkg, "version", &version);
|
||||
|
|
Loading…
Reference in New Issue