* apt-pkg/deb/dpkgpm.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 21 Jul 2009 11:52:48 +0000 (13:52 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 21 Jul 2009 11:52:48 +0000 (13:52 +0200)
  - provide DPkg::Chroot-Directory config option (useful for testing)

apt-pkg/deb/dpkgpm.cc
debian/changelog

index 416860f..f787f36 100644 (file)
@@ -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);
         
index 65fd9e5..cf92311 100644 (file)
@@ -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