summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-08-30 12:14:06 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-08-30 12:14:06 +0200
commitc4d1ab98921cddc8bd01f1e23ec1f4f9e7d2a90a (patch)
treed74de0c5a0007093178e7351423219d7d5ecec0e
parente93b4028825648bb29074a1422287e2cb435b0de (diff)
downloadapt-c4d1ab98921cddc8bd01f1e23ec1f4f9e7d2a90a.tar.gz
implement $(NATIVE_ARCHITECTURE) substvar for indextargets
-rw-r--r--apt-pkg/deb/debmetaindex.cc5
-rw-r--r--doc/acquire-additional-files.txt3
2 files changed, 8 insertions, 0 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 08d8ef05e..419de12e8 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -133,6 +133,7 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
DefCompressionTypes = os.str();
}
}
+ std::string const NativeArch = _config->Find("APT::Architecture");
bool const GzipIndex = _config->FindB("Acquire::GzipIndexes", false);
for (std::vector<debReleaseIndexPrivate::debSectionEntry>::const_iterator E = entries.begin(); E != entries.end(); ++E)
{
@@ -170,6 +171,10 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
Options.insert(std::make_pair("LANGUAGE", *L));
if (tplMetaKey.find("$(ARCHITECTURE)") != std::string::npos)
Options.insert(std::make_pair("ARCHITECTURE", *A));
+ else if (tplMetaKey.find("$(NATIVE_ARCHITECTURE)") != std::string::npos)
+ Options.insert(std::make_pair("ARCHITECTURE", NativeArch));
+ if (tplMetaKey.find("$(NATIVE_ARCHITECTURE)") != std::string::npos)
+ Options.insert(std::make_pair("NATIVE_ARCHITECTURE", NativeArch));
std::string MetaKey = tplMetaKey;
std::string ShortDesc = tplShortDesc;
diff --git a/doc/acquire-additional-files.txt b/doc/acquire-additional-files.txt
index 37773c321..c52955619 100644
--- a/doc/acquire-additional-files.txt
+++ b/doc/acquire-additional-files.txt
@@ -168,6 +168,9 @@ printed as-is.
APT::Architectures (potentially modified by sources.list options),
e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src'
this variable has the value "source".
+* $(NATIVE_ARCHITECTURE): The architecture apt treats as the native
+ architecture for this system configured as APT::Architecture
+ defaulting to the architecture apt itself was built for.
Note that while more variables might exist in the implementation, these
are to be considered undefined and their usage strongly discouraged. If