|
|
@@ -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;
|
|
|
}
|
|
|
/*}}}*/
|