summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 10:06:57 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 10:06:57 +0200
commitaf8a8da9c1aa6506d230a0df8abc670661176ba3 (patch)
tree343935c56f2294c835082233398fdef5d5d5e2eb /apt-pkg/deb/dpkgpm.cc
parent549edd163e34a50091623b47881f2eefbdc53aca (diff)
parentedde664d0cc5fe46f572696c605832700c553b9e (diff)
merged from davids branch
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index c0efa7b59..ca8faa8a5 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -105,7 +105,7 @@ ionice(int PID)
/* */
pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache)
: pkgPackageManager(Cache), dpkgbuf_pos(0),
- term_out(NULL), PackagesDone(0), PackagesTotal(0)
+ term_out(NULL), history_out(NULL), PackagesDone(0), PackagesTotal(0)
{
}
/*}}}*/
@@ -124,7 +124,19 @@ bool pkgDPkgPM::Install(PkgIterator Pkg,string File)
if (File.empty() == true || Pkg.end() == true)
return _error->Error("Internal Error, No file name for %s",Pkg.Name());
- List.push_back(Item(Item::Install,Pkg,File));
+ // If the filename string begins with DPkg::Chroot-Directory, return the
+ // substr that is within the chroot so dpkg can access it.
+ string const chrootdir = _config->FindDir("DPkg::Chroot-Directory","/");
+ if (chrootdir != "/" && File.find(chrootdir) == 0)
+ {
+ size_t len = chrootdir.length();
+ if (chrootdir.at(len - 1) == '/')
+ len--;
+ List.push_back(Item(Item::Install,Pkg,File.substr(len)));
+ }
+ else
+ List.push_back(Item(Item::Install,Pkg,File));
+
return true;
}
/*}}}*/
@@ -651,6 +663,7 @@ bool pkgDPkgPM::CloseLog()
fprintf(history_out, "End-Date: %s\n", timestr);
fclose(history_out);
}
+ history_out = NULL;
return true;
}