summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-06-12 14:42:17 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-06-15 14:39:37 +0200
commite185d8b3e39e3840f439cab7d5d265fd96d84c6f (patch)
tree02a47fba5662736ecbc0b9bd68b6175cad21b359 /apt-pkg/pkgcachegen.cc
parent3fd89e62e985c89b1f9a545ab72c20987b756aff (diff)
populate the Architecture field for PackageFiles
This is mainly visible in the policy, so that you can now pin by b= and let it only effect Packages files of this architecture and hence the packages coming from it (which do not need to be from this architecture, but very likely are in a normal repository setup). If you should pin by architecture in this way is a different question… Closes: 687255
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc10
1 files changed, 10 insertions, 0 deletions
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;