Simplify previous.

--HG--
extra : convert_revision : c93b6612845c64f9b9b929150014a76d6584ec1c
This commit is contained in:
Juan RP 2009-04-05 12:46:15 +02:00
parent d5d280a93c
commit 500cfe4b4f
2 changed files with 4 additions and 15 deletions

View file

@ -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)

View file

@ -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);