summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-21 13:52:48 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-21 13:52:48 +0200
commit4b7cfe96d621ab8fc0cec1334f0cd5f9ea87bf6d (patch)
tree88fa31f644eae3ff0920a1059a5c7d90b9dfaeec
parent599d6ad5ecb0f5876c391fef6db4171759911cf2 (diff)
* apt-pkg/deb/dpkgpm.cc:
- provide DPkg::Chroot-Directory config option (useful for testing)
-rw-r--r--apt-pkg/deb/dpkgpm.cc9
-rw-r--r--debian/changelog2
2 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 416860f35..f787f365e 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -866,6 +866,15 @@ bool pkgDPkgPM::Go(int OutStatusFd)
}
close(fd[0]); // close the read end of the pipe
+ if (_config->FindDir("DPkg::Chroot-Directory","/") != "/")
+ {
+ std::cerr << "Chrooting into "
+ << _config->FindDir("DPkg::Chroot-Directory")
+ << std::endl;
+ if (chroot(_config->FindDir("DPkg::Chroot-Directory","/").c_str()) != 0)
+ _exit(100);
+ }
+
if (chdir(_config->FindDir("DPkg::Run-Directory","/").c_str()) != 0)
_exit(100);
diff --git a/debian/changelog b/debian/changelog
index 65fd9e590..cf9231105 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,6 +27,8 @@ apt (0.7.21) UNRELEASED; urgency=low
* methods/http.cc:
- ignore SIGPIPE, we deal with EPIPE from write in
HttpMethod::ServerDie() (LP: #385144)
+ * apt-pkg/deb/dpkgpm.cc:
+ - provide DPkg::Chroot-Directory config option (useful for testing)
-- Michael Vogt <michael.vogt@ubuntu.com> Thu, 28 May 2009 17:51:42 +0200