Fix xbps-bin install without using a rootdir.

--HG--
extra : convert_revision : 7d9b697caa3f6d5c8b3d07462093c33c7fbfea29
This commit is contained in:
Juan RP 2009-08-10 00:08:58 +02:00
parent 350566818c
commit a5829d5467
2 changed files with 6 additions and 0 deletions

View file

@ -70,6 +70,9 @@ xbps_configure_pkg(const char *pkgname, const char *version)
return errno;
if (access(buf, R_OK) == 0) {
if (strcmp(rootdir, "") == 0)
rootdir = "/";
if (chdir(rootdir) == -1)
return errno;

View file

@ -141,6 +141,9 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg,
rootdir = xbps_get_rootdir();
flags = xbps_get_flags();
if (strcmp(rootdir, "") == 0)
rootdir = "/";
if (chdir(rootdir) == -1)
return errno;