summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/debindexfile.cc8
-rw-r--r--apt-pkg/edsp/edspindexfile.cc2
-rw-r--r--apt-pkg/pkgcachegen.cc10
-rw-r--r--apt-pkg/pkgcachegen.h2
4 files changed, 16 insertions, 6 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index 3a79cbc58..f089cda81 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -128,7 +128,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
if (Dist.empty())
Dist = "/";
::URI Tmp(URI);
- if (Gen.SelectFile(PackageFile, *this, Target.Option(IndexTarget::COMPONENT)) == false)
+ if (Gen.SelectFile(PackageFile, *this, Target.Option(IndexTarget::ARCHITECTURE), Target.Option(IndexTarget::COMPONENT)) == false)
return _error->Error("Problem with SelectFile %s",PackageFile.c_str());
// Store the IMS information
@@ -203,7 +203,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
if (Prog != NULL)
Prog->SubProgress(0, Target.Description);
- if (Gen.SelectFile(TranslationFile, *this, Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource) == false)
+ if (Gen.SelectFile(TranslationFile, *this, "", Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource) == false)
return _error->Error("Problem with SelectFile %s",TranslationFile.c_str());
// Store the IMS information
@@ -284,7 +284,7 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
if (Prog != NULL)
Prog->SubProgress(0,File);
- if (Gen.SelectFile(File, *this, "now", pkgCache::Flag::NotSource) == false)
+ if (Gen.SelectFile(File, *this, "", "now", pkgCache::Flag::NotSource) == false)
return _error->Error("Problem with SelectFile %s",File.c_str());
// Store the IMS information
@@ -409,7 +409,7 @@ bool debDebPkgFileIndex::Merge(pkgCacheGenerator& Gen, OpProgress* Prog) const
// and give it to the list parser
debDebFileParser Parser(DebControl, DebFile);
- if(Gen.SelectFile(DebFile, *this, "now", pkgCache::Flag::LocalSource) == false)
+ if(Gen.SelectFile(DebFile, *this, "", "now", pkgCache::Flag::LocalSource) == false)
return _error->Error("Problem with SelectFile %s", DebFile.c_str());
pkgCache::PkgFileIterator File = Gen.GetCurFile();
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index 43dd44a79..a2ec0a19b 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/apt-pkg/edsp/edspindexfile.cc
@@ -49,7 +49,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
if (Prog != NULL)
Prog->SubProgress(0,File);
- if (Gen.SelectFile(File, *this, "edsp") == false)
+ if (Gen.SelectFile(File, *this, "", "edsp") == false)
return _error->Error("Problem with SelectFile %s",File.c_str());
// Store the IMS information
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 9db4ef41f..ea0205944 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1113,6 +1113,7 @@ bool pkgCacheGenerator::SelectReleaseFile(const string &File,const string &Site,
added versions. The caller is responsible for setting the IMS fields. */
bool pkgCacheGenerator::SelectFile(std::string const &File,
pkgIndexFile const &Index,
+ std::string const &Architecture,
std::string const &Component,
unsigned long const Flags)
{
@@ -1133,6 +1134,15 @@ bool pkgCacheGenerator::SelectFile(std::string const &File,
if (unlikely(idxIndexType == 0))
return false;
CurrentFile->IndexType = idxIndexType;
+ if (Architecture.empty())
+ CurrentFile->Architecture = 0;
+ else
+ {
+ map_stringitem_t const arch = StoreString(pkgCacheGenerator::MIXED, Architecture);
+ if (unlikely(arch == 0))
+ return false;
+ CurrentFile->Architecture = arch;
+ }
map_stringitem_t const component = StoreString(pkgCacheGenerator::MIXED, Component);
if (unlikely(component == 0))
return false;
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index 2795d09d6..ade93795b 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -102,7 +102,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/
inline map_stringitem_t StoreString(enum StringType const type, const std::string &S) {return StoreString(type, S.c_str(),S.length());};
void DropProgress() {Progress = 0;};
- bool SelectFile(const std::string &File,pkgIndexFile const &Index, std::string const &Component, unsigned long Flags = 0);
+ bool SelectFile(const std::string &File,pkgIndexFile const &Index, std::string const &Architecture, std::string const &Component, unsigned long Flags = 0);
bool SelectReleaseFile(const std::string &File, const std::string &Site, unsigned long Flags = 0);
bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0);
inline pkgCache &GetCache() {return Cache;};