Просмотр исходного кода

implement $(NATIVE_ARCHITECTURE) substvar for indextargets

David Kalnischkies лет назад: 11
Родитель
Сommit
c4d1ab9892
2 измененных файлов с 8 добавлено и 0 удалено
  1. 5 0
      apt-pkg/deb/debmetaindex.cc
  2. 3 0
      doc/acquire-additional-files.txt

+ 5 - 0
apt-pkg/deb/debmetaindex.cc

@@ -133,6 +133,7 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
 	 DefCompressionTypes = os.str();
 	 DefCompressionTypes = os.str();
       }
       }
    }
    }
+   std::string const NativeArch = _config->Find("APT::Architecture");
    bool const GzipIndex = _config->FindB("Acquire::GzipIndexes", false);
    bool const GzipIndex = _config->FindB("Acquire::GzipIndexes", false);
    for (std::vector<debReleaseIndexPrivate::debSectionEntry>::const_iterator E = entries.begin(); E != entries.end(); ++E)
    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));
 		  Options.insert(std::make_pair("LANGUAGE", *L));
 	       if (tplMetaKey.find("$(ARCHITECTURE)") != std::string::npos)
 	       if (tplMetaKey.find("$(ARCHITECTURE)") != std::string::npos)
 		  Options.insert(std::make_pair("ARCHITECTURE", *A));
 		  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 MetaKey = tplMetaKey;
 	       std::string ShortDesc = tplShortDesc;
 	       std::string ShortDesc = tplShortDesc;

+ 3 - 0
doc/acquire-additional-files.txt

@@ -168,6 +168,9 @@ printed as-is.
   APT::Architectures (potentially modified by sources.list options),
   APT::Architectures (potentially modified by sources.list options),
   e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src'
   e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src'
   this variable has the value "source".
   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
 Note that while more variables might exist in the implementation, these
 are to be considered undefined and their usage strongly discouraged. If
 are to be considered undefined and their usage strongly discouraged. If