From b462d75aab39f85d4ce9bd03c4dfda54f77b566f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 1 Oct 2008 17:55:05 +0200 Subject: * apt-pkg/packagemanager.cc, apt-pkg/deb/dpkgpm.cc: - move the state file writting into the Go() implementation of dpkgpm (closes: #498799) --- apt-pkg/deb/dpkgpm.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 2abb3a0ef..c9af2f401 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -927,6 +927,8 @@ bool pkgDPkgPM::Go(int OutStatusFd) if (RunScripts("DPkg::Post-Invoke") == false) return false; + + Cache.writeStateFile(NULL); return true; } /*}}}*/ -- cgit v1.2.3 From 17745b02462bfbc0f1e8e5b2a062d887280345ea Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 28 Oct 2008 20:57:31 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - fix potential hang when in a backgroud process group --- apt-pkg/deb/dpkgpm.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 85cf4e119..36c20ad85 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -587,6 +587,11 @@ static int racy_pselect(int nfds, fd_set *readfds, fd_set *writefds, */ bool pkgDPkgPM::Go(int OutStatusFd) { + fd_set rfds; + struct timespec tv; + sigset_t sigmask; + sigset_t original_sigmask; + unsigned int MaxArgs = _config->FindI("Dpkg::MaxArgs",8*1024); unsigned int MaxArgBytes = _config->FindI("Dpkg::MaxArgBytes",32*1024); bool NoTriggers = _config->FindB("DPkg::NoTriggers",false); @@ -795,7 +800,14 @@ bool pkgDPkgPM::Go(int OutStatusFd) rtt = tt; cfmakeraw(&rtt); rtt.c_lflag &= ~ECHO; + // block SIGTTOU during tcsetattr to prevent a hang if + // the process is a member of the background process group + // http://www.opengroup.org/onlinepubs/000095399/functions/tcsetattr.html + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGTTOU); + sigprocmask(SIG_BLOCK,&sigmask, &original_sigmask); tcsetattr(0, TCSAFLUSH, &rtt); + sigprocmask(SIG_SETMASK, &original_sigmask, 0); } // Fork dpkg @@ -862,10 +874,6 @@ bool pkgDPkgPM::Go(int OutStatusFd) close(slave); // setups fds - fd_set rfds; - struct timespec tv; - sigset_t sigmask; - sigset_t original_sigmask; sigemptyset(&sigmask); sigprocmask(SIG_BLOCK,&sigmask,&original_sigmask); -- cgit v1.2.3 From 73e598c3acc354b963d2ec93b77006841175df5d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 12 Nov 2008 16:23:19 +0100 Subject: fix SIGHUP handling (closes: #463030) --- apt-pkg/deb/dpkgpm.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 36c20ad85..dde1c6d63 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -778,6 +778,9 @@ bool pkgDPkgPM::Go(int OutStatusFd) sighandler_t old_SIGQUIT = signal(SIGQUIT,SIG_IGN); sighandler_t old_SIGINT = signal(SIGINT,SIG_IGN); + // ignore SIGHUP as well (debian #463030) + sighandler_t old_SIGHUP = signal(SIGHUP,SIG_IGN); + struct termios tt; struct termios tt_out; struct winsize win; @@ -889,6 +892,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) // Restore sig int/quit signal(SIGQUIT,old_SIGQUIT); signal(SIGINT,old_SIGINT); + signal(SIGINT,old_SIGHUP); return _error->Errno("waitpid","Couldn't wait for subprocess"); } @@ -928,6 +932,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) // Restore sig int/quit signal(SIGQUIT,old_SIGQUIT); signal(SIGINT,old_SIGINT); + signal(SIGINT,old_SIGHUP); if(master >= 0) { -- cgit v1.2.3 From d9ec0faca41c96df02bac493549af64c5e6a8bc2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 12 Nov 2008 20:40:09 +0100 Subject: merge from debian-sid --- apt-pkg/deb/dpkgpm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index dde1c6d63..5349a7ef2 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -932,7 +932,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) // Restore sig int/quit signal(SIGQUIT,old_SIGQUIT); signal(SIGINT,old_SIGINT); - signal(SIGINT,old_SIGHUP); + signal(SIGHUP,old_SIGHUP); if(master >= 0) { -- cgit v1.2.3 From e306ec4728557675680115af4470d16159f22ab1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 12 Nov 2008 21:17:34 +0100 Subject: fix another typo --- apt-pkg/deb/dpkgpm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 5349a7ef2..686cbc6ee 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -892,7 +892,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) // Restore sig int/quit signal(SIGQUIT,old_SIGQUIT); signal(SIGINT,old_SIGINT); - signal(SIGINT,old_SIGHUP); + signal(SIGHUP,old_SIGHUP); return _error->Errno("waitpid","Couldn't wait for subprocess"); } -- cgit v1.2.3 From f23153d046f014f96d442fca5b9ef6ede7fcf546 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Dec 2008 14:38:10 -0800 Subject: * methods/gpgv.cc: - fix compiler warning * cmdline/apt-get.cc: - fix "apt-get source pkg=ver" if binary name != source name and show a message (LP: #202219) * apt-pkg/deb/debsystem.cc: - make strings i18n able --- apt-pkg/deb/debsystem.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 11a84f1c6..b882367b8 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -17,7 +17,8 @@ #include #include #include - +#include + #include #include #include @@ -66,11 +67,11 @@ bool debSystem::Lock() if (LockFD == -1) { if (errno == EACCES || errno == EAGAIN) - return _error->Error("Unable to lock the administration directory (%s), " - "is another process using it?",AdminDir.c_str()); + return _error->Error(_("Unable to lock the administration directory (%s), " + "is another process using it?"),AdminDir.c_str()); else - return _error->Error("Unable to lock the administration directory (%s), " - "are you root?",AdminDir.c_str()); + return _error->Error(_("Unable to lock the administration directory (%s), " + "are you root?"),AdminDir.c_str()); } // See if we need to abort with a dirty journal @@ -78,8 +79,8 @@ bool debSystem::Lock() { close(LockFD); LockFD = -1; - return _error->Error("dpkg was interrupted, you must manually " - "run 'dpkg --configure -a' to correct the problem. "); + return _error->Error(_("dpkg was interrupted, you must manually " + "run 'dpkg --configure -a' to correct the problem. ")); } LockCount++; -- cgit v1.2.3 From f814fbf4f2c78e3b9ceeeaba3cb93ed0ebbc7943 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 28 Jan 2009 17:36:03 +0100 Subject: apt-pkg/deb/debsystem.cc: add missing i18n string --- apt-pkg/deb/debsystem.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index b882367b8..82464d998 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -97,7 +97,7 @@ bool debSystem::UnLock(bool NoErrors) return false; if (LockCount < 1) - return _error->Error("Not locked"); + return _error->Error(_("Not locked")); if (--LockCount == 0) { close(LockFD); -- cgit v1.2.3 From 51f07d3215a814cba98ed90f2ee4900ba2ba5780 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 6 Mar 2009 09:56:30 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - revert the change by Kees again for the amd64 ALL-CAPS problem --- apt-pkg/deb/dpkgpm.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 686cbc6ee..1d45e70e9 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -782,16 +782,14 @@ bool pkgDPkgPM::Go(int OutStatusFd) sighandler_t old_SIGHUP = signal(SIGHUP,SIG_IGN); struct termios tt; - struct termios tt_out; struct winsize win; int master; int slave; // FIXME: setup sensible signal handling (*ick*) tcgetattr(0, &tt); - tcgetattr(1, &tt_out); ioctl(0, TIOCGWINSZ, (char *)&win); - if (openpty(&master, &slave, NULL, &tt_out, &win) < 0) + if (openpty(&master, &slave, NULL, &tt, &win) < 0) { const char *s = _("Can not write log, openpty() " "failed (/dev/pts not mounted?)\n"); -- cgit v1.2.3 From 4e86942abf369e5bce6c3612d0e8f2aa5a9f2821 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 23 Apr 2009 12:53:48 +0200 Subject: fix problematic use of tolower() when calculating the version hash by using locale independant tolower_ascii() function. Thanks to M. Vefa Bicakci (LP: #80248) --- apt-pkg/deb/deblistparser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 896d4d6d8..55ba1f8c4 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -213,7 +213,7 @@ unsigned short debListParser::VersionHash() for (; Start != End; Start++) { if (isspace(*Start) == 0) - *I++ = tolower(*Start); + *I++ = tolower_ascii(*Start); if (*Start == '<' && Start[1] != '<' && Start[1] != '=') *I++ = '='; if (*Start == '>' && Start[1] != '>' && Start[1] != '=') -- cgit v1.2.3 From efc487fbd46905f5f3efc4f31d7df15625bcbecf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 7 May 2009 12:04:21 +0200 Subject: [apt-pkg] allow also codenames for specifying a release * MatchType::Release checks first for archive than for codename equality * new n= option in apt_preference to be able to pin based on a codeName --- apt-pkg/deb/deblistparser.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 896d4d6d8..d8be66cba 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -637,6 +637,8 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator FileI, FileI->Version = WriteUniqString(Start,Stop - Start); if (Section.Find("Origin",Start,Stop) == true) FileI->Origin = WriteUniqString(Start,Stop - Start); + if (Section.Find("Codename",Start,Stop) == true) + FileI->Codename = WriteUniqString(Start,Stop - Start); if (Section.Find("Label",Start,Stop) == true) FileI->Label = WriteUniqString(Start,Stop - Start); if (Section.Find("Architecture",Start,Stop) == true) -- cgit v1.2.3 From f8ae7e8b3c5585888cbc0516b35131acec14ff05 Mon Sep 17 00:00:00 2001 From: "jak@debian.org" <> Date: Mon, 15 Jun 2009 14:57:01 +0200 Subject: Introduce support for the Enhances field. (Closes: #137583) --- apt-pkg/deb/deblistparser.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 896d4d6d8..74fa6fab4 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -109,6 +109,8 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver) return false; if (ParseDepends(Ver,"Replaces",pkgCache::Dep::Replaces) == false) return false; + if (ParseDepends(Ver,"Enhances",pkgCache::Dep::Enhances) == false) + return false; // Obsolete. if (ParseDepends(Ver,"Optional",pkgCache::Dep::Suggests) == false) -- cgit v1.2.3 From cebe0287c36408e44196266de45737386eaa28fc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 Jun 2009 10:15:51 +0200 Subject: * apt-pkg/deb/dpkgpm.cc: - add Dpkg::UseIoNice boolean option to run dpkg with ionice -c3 (off by default) --- apt-pkg/deb/dpkgpm.cc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 1d45e70e9..462f4a739 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -74,6 +74,31 @@ namespace }; } +/* helper function to ionice the given PID + + there is no C header for ionice yet - just the syscall interface + so we use the binary from util-linux +*/ +static bool +ionice(int PID) +{ + if (!FileExists("/usr/bin/ionice")) + return false; + pid_t Process = ExecFork(); + if (Process == 0) + { + char buf[32]; + snprintf(buf, sizeof(buf), "-p%d", PID); + const char *Args[4]; + Args[0] = "/usr/bin/ionice"; + Args[1] = "-c3"; + Args[2] = buf; + Args[3] = 0; + execv(Args[0], (char **)Args); + } + return ExecWait(Process, "ionice"); +} + // DPkgPM::pkgDPkgPM - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -850,7 +875,6 @@ bool pkgDPkgPM::Go(int OutStatusFd) _exit(100); } - /* No Job Control Stop Env is a magic dpkg var that prevents it from using sigstop */ putenv((char *)"DPKG_NO_TSTP=yes"); @@ -859,6 +883,10 @@ bool pkgDPkgPM::Go(int OutStatusFd) _exit(100); } + // apply ionice + if (_config->FindB("DPkg::UseIoNice", false) == true) + ionice(Child); + // clear the Keep-Fd again _config->Clear("APT::Keep-Fds",fd[1]); -- cgit v1.2.3 From ccd8e28fe16bf8e80db65e330ed89454c0104f80 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 17 Jun 2009 10:44:21 +0200 Subject: send "dpkg-exec" message on the status fd when dpkg is run --- apt-pkg/deb/dpkgpm.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 462f4a739..a8d08f500 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -839,6 +839,15 @@ bool pkgDPkgPM::Go(int OutStatusFd) // Fork dpkg pid_t Child; _config->Set("APT::Keep-Fds::",fd[1]); + // send status information that we are about to fork dpkg + if(OutStatusFd > 0) { + ostringstream status; + status << "pmstatus:dpkg-exec:" + << (PackagesDone/float(PackagesTotal)*100.0) + << ":" << _("Running dpkg") + << endl; + write(OutStatusFd, status.str().c_str(), status.str().size()); + } Child = ExecFork(); // This is the child -- cgit v1.2.3 From 7a9f09bd66d51b92bb68f07e7fbc111df6206c93 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 30 Jun 2009 14:11:31 +0200 Subject: merged r1811..1815 from lp:~donkult/apt/experimental --- apt-pkg/deb/debmetaindex.cc | 7 +++++++ apt-pkg/deb/debmetaindex.h | 1 + apt-pkg/deb/debsrcrecords.cc | 8 ++++++++ apt-pkg/deb/debsrcrecords.h | 1 + 4 files changed, 17 insertions(+) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index ee035191f..f3ab6960c 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -115,6 +115,13 @@ debReleaseIndex::debReleaseIndex(string URI,string Dist) this->Type = "deb"; } +debReleaseIndex::~debReleaseIndex() +{ + for (vector::const_iterator I = SectionEntries.begin(); + I != SectionEntries.end(); I++) + delete *I; +} + vector * debReleaseIndex::ComputeIndexTargets() const { vector * IndexTargets = new vector ; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index c021a1b5a..8e6a1463b 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -22,6 +22,7 @@ class debReleaseIndex : public metaIndex { public: debReleaseIndex(string URI, string Dist); + ~debReleaseIndex(); virtual string ArchiveURI(string File) const {return URI + File;}; virtual bool GetIndexes(pkgAcquire *Owner, bool GetAll=false) const; diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index ace4e00b5..2f87c767b 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -152,3 +152,11 @@ bool debSrcRecordParser::Files(vector &List) return true; } /*}}}*/ +// SrcRecordParser::~SrcRecordParser - Destructor /*{{{*/ +// --------------------------------------------------------------------- +/* */ +debSrcRecordParser::~debSrcRecordParser() +{ + delete[] Buffer; +} + /*}}}*/ diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index 8b1237ccd..a3b5a8286 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -50,6 +50,7 @@ class debSrcRecordParser : public pkgSrcRecords::Parser debSrcRecordParser(string File,pkgIndexFile const *Index) : Parser(Index), Fd(File,FileFd::ReadOnly), Tags(&Fd,102400), Buffer(0), BufSize(0) {} + ~debSrcRecordParser(); }; #endif -- cgit v1.2.3 From 599d6ad5ecb0f5876c391fef6db4171759911cf2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 10 Jul 2009 17:21:11 +0200 Subject: apt-pkg/deb/dpkgpm.cc: remove dead code, add comment on problematic argument list split --- apt-pkg/deb/dpkgpm.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index a8d08f500..416860f35 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -640,20 +640,12 @@ bool pkgDPkgPM::Go(int OutStatusFd) { {"unpacked",N_("Preparing to configure %s") }, {"half-configured", N_("Configuring %s") }, -#if 0 - {"triggers-awaited", N_("Processing triggers for %s") }, - {"triggers-pending", N_("Processing triggers for %s") }, -#endif { "installed", N_("Installed %s")}, {NULL, NULL} }, // Remove operation { {"half-configured", N_("Preparing for removal of %s")}, -#if 0 - {"triggers-awaited", N_("Preparing for removal of %s")}, - {"triggers-pending", N_("Preparing for removal of %s")}, -#endif {"half-installed", N_("Removing %s")}, {"config-files", N_("Removed %s")}, {NULL, NULL} @@ -690,10 +682,19 @@ bool pkgDPkgPM::Go(int OutStatusFd) for (vector::iterator I = List.begin(); I != List.end();) { vector::iterator J = I; - for (; J != List.end() && J->Op == I->Op; J++); + for (; J != List.end() && J->Op == I->Op; J++) + /* nothing */; // Generate the argument list const char *Args[MaxArgs + 50]; + + // Now check if we are within the MaxArgs limit + // + // this code below is problematic, because it may happen that + // the argument list is split in a way that A depends on B + // and they are in the same "--configure A B" run + // - with the split they may now be configured in different + // runs if (J - I > (signed)MaxArgs) J = I + MaxArgs; -- cgit v1.2.3 From 4b7cfe96d621ab8fc0cec1334f0cd5f9ea87bf6d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 21 Jul 2009 13:52:48 +0200 Subject: * apt-pkg/deb/dpkgpm.cc: - provide DPkg::Chroot-Directory config option (useful for testing) --- apt-pkg/deb/dpkgpm.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apt-pkg/deb') 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); -- cgit v1.2.3