summaryrefslogtreecommitdiff
path: root/lib/transaction.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-11-11 03:58:46 +0000
committerjbj <devnull@localhost>2004-11-11 03:58:46 +0000
commit8ce559b875c401630120a251cc73b23012f45080 (patch)
tree916aee4d6620d6dd8f1a8a0be5195698876dd239 /lib/transaction.c
parent13b145b6af842a268d99a6a64fcf4e416ee4e681 (diff)
downloadlibrpm-tizen-8ce559b875c401630120a251cc73b23012f45080.tar.gz
librpm-tizen-8ce559b875c401630120a251cc73b23012f45080.tar.bz2
librpm-tizen-8ce559b875c401630120a251cc73b23012f45080.zip
Avoid unnecessary chroot("/") calls for certain Mac OSX kernels.
Strip URL clutter from --root paths in rpmtsRootDir(ts) and newRpmdb(). CVS patchset: 7574 CVS date: 2004/11/11 03:58:46
Diffstat (limited to 'lib/transaction.c')
-rw-r--r--lib/transaction.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/transaction.c b/lib/transaction.c
index bb05f4b63..5b5e3fafd 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1671,7 +1671,7 @@ rpmMessage(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount)
const char * rootDir = rpmtsRootDir(ts);
xx = chdir("/");
/*@-superuser -noeffect @*/
- if (rootDir != NULL)
+ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/')
xx = chroot(rootDir);
/*@=superuser =noeffect @*/
(void) rpmtsSetChrootDone(ts, 1);
@@ -1843,9 +1843,11 @@ rpmMessage(RPMMESS_DEBUG, _("computing file dispositions\n"));
ps = rpmpsFree(ps);
if (rpmtsChrootDone(ts)) {
+ const char * rootDir = rpmtsRootDir(ts);
const char * currDir = rpmtsCurrDir(ts);
/*@-superuser -noeffect @*/
- xx = chroot(".");
+ if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/')
+ xx = chroot(".");
/*@=superuser =noeffect @*/
(void) rpmtsSetChrootDone(ts, 0);
if (currDir != NULL)