]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
disable automatical installation of dependencies in MarkInstall if we
[apt.git] / apt-pkg / deb / dpkgpm.cc
index 7b0955b96bd8390849df74f5474116d4b5fa81d3..01808be243b3cfef5329c86aec9d27aba43d70c0 100644 (file)
@@ -308,6 +308,15 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
         SetCloseExec(STDIN_FILENO,false);      
         SetCloseExec(STDERR_FILENO,false);
 
+        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);
+        }
+
         const char *Args[4];
         Args[0] = "/bin/sh";
         Args[1] = "-c";
@@ -993,6 +1002,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       else
       {
         string const nativeArch = _config->Find("APT::Architecture");
+        unsigned long const oldSize = I->Op == Item::Configure ? Size : 0;
         for (;I != J && Size < MaxArgBytes; I++)
         {
            if((*I).Pkg.end() == true)
@@ -1007,8 +1017,11 @@ bool pkgDPkgPM::Go(int OutStatusFd)
               Args[n++] = Packages[pkgcount++];
            }
            Size += strlen(Args[n-1]);
-        }       
-      }      
+        }
+        // skip configure action if all sheduled packages disappeared
+        if (oldSize == Size)
+           continue;
+      }
       Args[n] = 0;
       J = I;