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

store all targets data in IndexTarget struct

We still need an API for the targets, so slowly prepare the IndexTargets
to let them take this job.

Git-Dch: Ignore
David Kalnischkies лет назад: 11
Родитель
Сommit
d3a869e355

+ 12 - 3
apt-pkg/acquire-item.cc

@@ -382,6 +382,15 @@ bool pkgAcqDiffIndex::TransactionState(TransactionStates const state)
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 
+// IndexTarget - Constructor						/*{{{*/
+IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc,
+      std::string const &LongDesc, std::string const &URI, bool const IsOptional,
+      std::map<std::string, std::string> const &Options) :
+   URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), IsOptional(IsOptional), Options(Options)
+{
+}
+									/*}}}*/
+
 class APT_HIDDEN NoActionItem : public pkgAcquire::Item			/*{{{*/
 class APT_HIDDEN NoActionItem : public pkgAcquire::Item			/*{{{*/
 /* The sole purpose of this class is having an item which does nothing to
 /* The sole purpose of this class is having an item which does nothing to
    reach its done state to prevent cleanup deleting the mentioned file.
    reach its done state to prevent cleanup deleting the mentioned file.
@@ -955,7 +964,7 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify)			/*{{{*/
 	 if (TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false)
 	 if (TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false)
 	 {
 	 {
 	    // optional targets that we do not have in the Release file are skipped
 	    // optional targets that we do not have in the Release file are skipped
-	    if ((*Target)->IsOptional())
+	    if ((*Target)->IsOptional)
 	       continue;
 	       continue;
 
 
 	    Status = StatAuthError;
 	    Status = StatAuthError;
@@ -2388,7 +2397,7 @@ string pkgAcqIndex::Custom600Headers() const
    if (stat(Final.c_str(),&Buf) == 0)
    if (stat(Final.c_str(),&Buf) == 0)
       msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
       msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
 
 
-   if(Target->IsOptional())
+   if(Target->IsOptional)
       msg += "\nFail-Ignore: true";
       msg += "\nFail-Ignore: true";
 
 
    return msg;
    return msg;
@@ -2410,7 +2419,7 @@ void pkgAcqIndex::Failed(string const &Message,pkgAcquire::MethodConfig const *
       }
       }
    }
    }
 
 
-   if(Target->IsOptional() && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD)
+   if(Target->IsOptional && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD)
       Status = StatDone;
       Status = StatDone;
    else
    else
       TransactionManager->AbortTransaction();
       TransactionManager->AbortTransaction();

+ 10 - 21
apt-pkg/acquire-item.h

@@ -28,6 +28,7 @@
 
 
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
+#include <map>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>
@@ -49,7 +50,7 @@ class pkgSourceList;
 class IndexTarget;
 class IndexTarget;
 class pkgAcqMetaBase;
 class pkgAcqMetaBase;
 
 
-class APT_HIDDEN IndexTarget						/*{{{*/
+class IndexTarget							/*{{{*/
 /** \brief Information about an index file. */
 /** \brief Information about an index file. */
 {
 {
    public:
    public:
@@ -63,30 +64,18 @@ class APT_HIDDEN IndexTarget						/*{{{*/
    std::string const ShortDesc;
    std::string const ShortDesc;
 
 
    /** \brief The key by which this index file should be
    /** \brief The key by which this index file should be
-    *  looked up within the meta signature file.
-    */
+       looked up within the meta index file. */
    std::string const MetaKey;
    std::string const MetaKey;
 
 
-   virtual bool IsOptional() const {
-      return false;
-   }
+   /** \brief Is it okay if the file isn't found in the meta index */
+   bool const IsOptional;
 
 
-   IndexTarget(std::string const &MetaKey, std::string const &ShortDesc,
-	 std::string const &LongDesc, std::string const &URI) :
-      URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey) {}
-};
-									/*}}}*/
-class APT_HIDDEN OptionalIndexTarget : public IndexTarget		/*{{{*/
-/** \brief Information about an optional index file. */
-{
-   public:
-   virtual bool IsOptional() const {
-      return true;
-   }
+   /** \brief Target specific options defined by the implementation */
+   std::map<std::string, std::string> const Options;
 
 
-   OptionalIndexTarget(std::string const &MetaKey, std::string const &ShortDesc,
-	 std::string const &LongDesc, std::string const &URI) :
-      IndexTarget(MetaKey, ShortDesc, LongDesc, URI) {}
+   IndexTarget(std::string const &MetaKey, std::string const &ShortDesc,
+	 std::string const &LongDesc, std::string const &URI, bool const IsOptional,
+	 std::map<std::string, std::string> const &Options);
 };
 };
 									/*}}}*/
 									/*}}}*/
 class pkgAcquire::Item : public WeakPointable				/*{{{*/
 class pkgAcquire::Item : public WeakPointable				/*{{{*/

+ 54 - 60
apt-pkg/deb/debmetaindex.cc

@@ -116,12 +116,12 @@ void foreachTarget(std::string const URI, std::string const Dist,
       for (std::vector<std::string>::const_iterator T = targets.begin(); T != targets.end(); ++T)
       for (std::vector<std::string>::const_iterator T = targets.begin(); T != targets.end(); ++T)
       {
       {
 #define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb-src::") + *T + "::" + (X))
 #define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb-src::") + *T + "::" + (X))
-	 std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI");
+	 std::string const MetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey");
 	 std::string const ShortDesc = APT_T_CONFIG("ShortDescription");
 	 std::string const ShortDesc = APT_T_CONFIG("ShortDescription");
 	 std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description");
 	 std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description");
 	 bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb-src::") + *T + "::Optional", true);
 	 bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb-src::") + *T + "::Optional", true);
 #undef APT_T_CONFIG
 #undef APT_T_CONFIG
-	 if (URI.empty())
+	 if (MetaKey.empty())
 	    continue;
 	    continue;
 
 
 	 vector<debReleaseIndex::debSectionEntry const*> const SectionEntries = src->second;
 	 vector<debReleaseIndex::debSectionEntry const*> const SectionEntries = src->second;
@@ -130,23 +130,24 @@ void foreachTarget(std::string const URI, std::string const Dist,
 	 {
 	 {
 	    for (vector<std::string>::const_iterator l = lang.begin(); l != lang.end(); ++l)
 	    for (vector<std::string>::const_iterator l = lang.begin(); l != lang.end(); ++l)
 	    {
 	    {
-	       if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos)
+	       if (*l == "none" && MetaKey.find("$(LANGUAGE)") != std::string::npos)
 		  continue;
 		  continue;
 
 
-	       struct SubstVar subst[] = {
-		  { "$(SITE)", &Site },
-		  { "$(RELEASE)", &Release },
-		  { "$(COMPONENT)", &((*I)->Section) },
-		  { "$(LANGUAGE)", &(*l) },
-		  { NULL, NULL }
-	       };
-	       Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst);
-
-	       if (URI.find("$(LANGUAGE)") == std::string::npos)
+	       std::map<std::string, std::string> Options;
+	       Options.insert(std::make_pair("SITE", Site));
+	       Options.insert(std::make_pair("RELEASE", Release));
+	       Options.insert(std::make_pair("COMPONENT", (*I)->Section));
+	       Options.insert(std::make_pair("LANGUAGE", *l));
+	       Options.insert(std::make_pair("ARCHITECTURE", "source"));
+	       Options.insert(std::make_pair("BASE_URI", baseURI));
+	       Options.insert(std::make_pair("CREATED_BY", *T));
+	       Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options);
+
+	       if (MetaKey.find("$(LANGUAGE)") == std::string::npos)
 		  break;
 		  break;
 	    }
 	    }
 
 
-	    if (URI.find("$(COMPONENT)") == std::string::npos)
+	    if (MetaKey.find("$(COMPONENT)") == std::string::npos)
 	       break;
 	       break;
 	 }
 	 }
       }
       }
@@ -156,12 +157,12 @@ void foreachTarget(std::string const URI, std::string const Dist,
    for (std::vector<std::string>::const_iterator T = targets.begin(); T != targets.end(); ++T)
    for (std::vector<std::string>::const_iterator T = targets.begin(); T != targets.end(); ++T)
    {
    {
 #define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb::") + *T + "::" + (X))
 #define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb::") + *T + "::" + (X))
-      std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI");
+      std::string const MetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey");
       std::string const ShortDesc = APT_T_CONFIG("ShortDescription");
       std::string const ShortDesc = APT_T_CONFIG("ShortDescription");
       std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description");
       std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description");
       bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb::") + *T + "::Optional", true);
       bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb::") + *T + "::Optional", true);
 #undef APT_T_CONFIG
 #undef APT_T_CONFIG
-      if (URI.empty())
+      if (MetaKey.empty())
 	 continue;
 	 continue;
 
 
       for (map<string, vector<debReleaseIndex::debSectionEntry const*> >::const_iterator a = ArchEntries.begin();
       for (map<string, vector<debReleaseIndex::debSectionEntry const*> >::const_iterator a = ArchEntries.begin();
@@ -175,28 +176,28 @@ void foreachTarget(std::string const URI, std::string const Dist,
 
 
 	    for (vector<std::string>::const_iterator l = lang.begin(); l != lang.end(); ++l)
 	    for (vector<std::string>::const_iterator l = lang.begin(); l != lang.end(); ++l)
 	    {
 	    {
-	       if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos)
+	       if (*l == "none" && MetaKey.find("$(LANGUAGE)") != std::string::npos)
 		  continue;
 		  continue;
 
 
-	       struct SubstVar subst[] = {
-		  { "$(SITE)", &Site },
-		  { "$(RELEASE)", &Release },
-		  { "$(COMPONENT)", &((*I)->Section) },
-		  { "$(LANGUAGE)", &(*l) },
-		  { "$(ARCHITECTURE)", &(a->first) },
-		  { NULL, NULL }
-	       };
-	       Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst);
-
-	       if (URI.find("$(LANGUAGE)") == std::string::npos)
+	       std::map<std::string, std::string> Options;
+	       Options.insert(std::make_pair("SITE", Site));
+	       Options.insert(std::make_pair("RELEASE", Release));
+	       Options.insert(std::make_pair("COMPONENT", (*I)->Section));
+	       Options.insert(std::make_pair("LANGUAGE", *l));
+	       Options.insert(std::make_pair("ARCHITECTURE", a->first));
+	       Options.insert(std::make_pair("BASE_URI", baseURI));
+	       Options.insert(std::make_pair("CREATED_BY", *T));
+	       Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options);
+
+	       if (MetaKey.find("$(LANGUAGE)") == std::string::npos)
 		  break;
 		  break;
 	    }
 	    }
 
 
-	    if (URI.find("$(COMPONENT)") == std::string::npos)
+	    if (MetaKey.find("$(COMPONENT)") == std::string::npos)
 	       break;
 	       break;
 	 }
 	 }
 
 
-	 if (URI.find("$(ARCHITECTURE)") == std::string::npos)
+	 if (MetaKey.find("$(ARCHITECTURE)") == std::string::npos)
 	    break;
 	    break;
       }
       }
    }
    }
@@ -207,30 +208,23 @@ struct ComputeIndexTargetsClass
 {
 {
    vector <IndexTarget *> * const IndexTargets;
    vector <IndexTarget *> * const IndexTargets;
 
 
-   void operator()(std::string const &baseURI, std::string const &/*TargetName*/,
-	 std::string const &URI, std::string const &ShortDesc, std::string const &LongDesc,
-	 bool const IsOptional, struct SubstVar const * const subst)
+   void operator()(std::string MetaKey, std::string ShortDesc, std::string LongDesc,
+	 bool const IsOptional, std::map<std::string, std::string> Options)
    {
    {
-      std::string const name = SubstVar(URI, subst);
-      IndexTarget * Target;
-      if (IsOptional == true)
-      {
-	 Target = new OptionalIndexTarget(
-	       name,
-	       SubstVar(ShortDesc, subst),
-	       SubstVar(LongDesc, subst),
-	       baseURI + name
-	       );
-      }
-      else
+      for (std::map<std::string, std::string>::const_iterator O = Options.begin(); O != Options.end(); ++O)
       {
       {
-	 Target = new IndexTarget(
-	       name,
-	       SubstVar(ShortDesc, subst),
-	       SubstVar(LongDesc, subst),
-	       baseURI + name
-	       );
+	 MetaKey = SubstVar(MetaKey, std::string("$(") + O->first + ")", O->second);
+	 ShortDesc = SubstVar(ShortDesc, std::string("$(") + O->first + ")", O->second);
+	 LongDesc = SubstVar(LongDesc, std::string("$(") + O->first + ")", O->second);
       }
       }
+      IndexTarget * Target = new IndexTarget(
+	    MetaKey,
+	    ShortDesc,
+	    LongDesc,
+	    Options.find("BASE_URI")->second + MetaKey,
+	    IsOptional,
+	    Options
+	    );
       IndexTargets->push_back(Target);
       IndexTargets->push_back(Target);
    }
    }
 
 
@@ -256,7 +250,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
 
 
    // special case for --print-uris
    // special case for --print-uris
    vector <IndexTarget *> const * const targets = ComputeIndexTargets();
    vector <IndexTarget *> const * const targets = ComputeIndexTargets();
-#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X))
+#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map<std::string,std::string>())
    pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner,
    pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner,
 	 APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"),
 	 APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"),
 	 targets, iR);
 	 targets, iR);
@@ -309,33 +303,33 @@ struct GetIndexFilesClass
    std::string const Release;
    std::string const Release;
    bool const IsTrusted;
    bool const IsTrusted;
 
 
-   void operator()(std::string const &/*baseURI*/, std::string const &TargetName,
-	 std::string const &/*URI*/, std::string const &/*ShortDesc*/, std::string const &/*LongDesc*/,
-	 bool const /*IsOptional*/, struct SubstVar const * const subst)
+   void operator()(std::string const &/*URI*/, std::string const &/*ShortDesc*/, std::string const &/*LongDesc*/,
+	 bool const /*IsOptional*/, std::map<std::string, std::string> Options)
    {
    {
+      std::string const TargetName = Options.find("CREATED_BY")->second;
       if (TargetName == "Packages")
       if (TargetName == "Packages")
       {
       {
 	 Indexes->push_back(new debPackagesIndex(
 	 Indexes->push_back(new debPackagesIndex(
 		  URI,
 		  URI,
 		  Release,
 		  Release,
-		  SubstVar("$(COMPONENT)", subst),
+		  Options.find("COMPONENT")->second,
 		  IsTrusted,
 		  IsTrusted,
-		  SubstVar("$(ARCHITECTURE)", subst)
+		  Options.find("ARCHITECTURE")->second
 		  ));
 		  ));
       }
       }
       else if (TargetName == "Sources")
       else if (TargetName == "Sources")
 	 Indexes->push_back(new debSourcesIndex(
 	 Indexes->push_back(new debSourcesIndex(
 		  URI,
 		  URI,
 		  Release,
 		  Release,
-		  SubstVar("$(COMPONENT)", subst),
+		  Options.find("COMPONENT")->second,
 		  IsTrusted
 		  IsTrusted
 		  ));
 		  ));
       else if (TargetName == "Translations")
       else if (TargetName == "Translations")
 	 Indexes->push_back(new debTranslationsIndex(
 	 Indexes->push_back(new debTranslationsIndex(
 		  URI,
 		  URI,
 		  Release,
 		  Release,
-		  SubstVar("$(COMPONENT)", subst),
-		  SubstVar("$(LANGUAGE)", subst)
+		  Options.find("COMPONENT")->second,
+		  Options.find("LANGUAGE")->second
 		  ));
 		  ));
    }
    }
 
 

+ 6 - 6
apt-pkg/init.cc

@@ -101,19 +101,19 @@ bool pkgInitConfig(Configuration &Cnf)
    // The default user we drop to in the methods
    // The default user we drop to in the methods
    Cnf.CndSet("APT::Sandbox::User", "_apt");
    Cnf.CndSet("APT::Sandbox::User", "_apt");
 
 
-   Cnf.CndSet("APT::Acquire::Targets::deb::Packages::URI", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages");
-   Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatURI", "Packages");
+   Cnf.CndSet("APT::Acquire::Targets::deb::Packages::MetaKey", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages");
+   Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatMetaKey", "Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::ShortDescription", "Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::ShortDescription", "Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Description", "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Description", "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatDescription", "$(SITE) $(RELEASE) Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatDescription", "$(SITE) $(RELEASE) Packages");
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Optional", false);
    Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Optional", false);
-   Cnf.CndSet("APT::Acquire::Targets::deb::Translations::URI", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)");
-   Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatURI", "$(LANGUAGE)");
+   Cnf.CndSet("APT::Acquire::Targets::deb::Translations::MetaKey", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)");
+   Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatMetaKey", "$(LANGUAGE)");
    Cnf.CndSet("APT::Acquire::Targets::deb::Translations::ShortDescription", "Translation-$(LANGUAGE)");
    Cnf.CndSet("APT::Acquire::Targets::deb::Translations::ShortDescription", "Translation-$(LANGUAGE)");
    Cnf.CndSet("APT::Acquire::Targets::deb::Translations::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)");
    Cnf.CndSet("APT::Acquire::Targets::deb::Translations::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)");
    Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatDescription", "$(SITE) $(RELEASE) Translation-$(LANGUAGE)");
    Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatDescription", "$(SITE) $(RELEASE) Translation-$(LANGUAGE)");
-   Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::URI", "$(COMPONENT)/source/Sources");
-   Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatURI", "Sources");
+   Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::MetaKey", "$(COMPONENT)/source/Sources");
+   Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatMetaKey", "Sources");
    Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::ShortDescription", "Sources");
    Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::ShortDescription", "Sources");
    Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Sources");
    Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Sources");
    Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatDescription", "$(SITE) $(RELEASE) Sources");
    Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatDescription", "$(SITE) $(RELEASE) Sources");

+ 13 - 16
doc/acquire-additional-files.txt

@@ -33,11 +33,11 @@ instructing the Acquire system to download the Packages files would look
 like this (see also apt.conf(5) manpage for configuration file syntax):
 like this (see also apt.conf(5) manpage for configuration file syntax):
 
 
 	APT::Acquire::Targets::deb::Packages {
 	APT::Acquire::Targets::deb::Packages {
-		URI "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
+		MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
 		ShortDescription "Packages";
 		ShortDescription "Packages";
 		Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
 		Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
 
 
-		flatURI "Packages";
+		flatMetaKey "Packages";
 		flatDescription "$(SITE) $(RELEASE) Packages";
 		flatDescription "$(SITE) $(RELEASE) Packages";
 
 
 		Optional "false";
 		Optional "false";
@@ -47,18 +47,18 @@ All files which should be downloaded (nicknamed 'Targets') are mentioned
 below the APT::Acquire::Targets scope. 'deb' is here the type of the
 below the APT::Acquire::Targets scope. 'deb' is here the type of the
 sources.list entry the file should be acquired for. The only other
 sources.list entry the file should be acquired for. The only other
 supported value is hence 'deb-src'. Beware: You can't specify multiple
 supported value is hence 'deb-src'. Beware: You can't specify multiple
-types here and you can't download the same URI for multiple types!
+types here and you can't download the same MetaKey form multiple types!
 
 
 After the type you can pick any valid and unique string which preferable
 After the type you can pick any valid and unique string which preferable
 refers to the file it downloads (In the example we picked 'Packages').
 refers to the file it downloads (In the example we picked 'Packages').
 This string is never shown or used.
 This string is never shown or used.
 
 
 All targets have three main properties you can define:
 All targets have three main properties you can define:
-* URI: The identifier of the file to be downloaded as used in the
+* MetaKey: The identifier of the file to be downloaded as used in the
   Release file.  It is also the relative location of the file from the
   Release file.  It is also the relative location of the file from the
   Release file.  You can neither download from a different server
   Release file.  You can neither download from a different server
-  entirely (absolute URI) nor should you try to access directories above
-  the Release file (e.g. "../../").
+  entirely (absolute URI) nor access directories above the Release file
+  (e.g. "../../").
 * ShortDescription: Very short string intended to be displayed to the
 * ShortDescription: Very short string intended to be displayed to the
   user e.g.  while reporting progress. apt will e.g. use this string in
   user e.g.  while reporting progress. apt will e.g. use this string in
   the last line to indicate progress of e.g. the download of a specific
   the last line to indicate progress of e.g. the download of a specific
@@ -69,7 +69,7 @@ All targets have three main properties you can define:
   progress lines.
   progress lines.
 
 
 Additional optional properties:
 Additional optional properties:
-* flat{URI,Description}: APT supports two types of repositories:
+* flat{MetaKey,Description}: APT supports two types of repositories:
   dists-style repositories which are the default and by far the most
   dists-style repositories which are the default and by far the most
   common which are named after the fact that the files are in an
   common which are named after the fact that the files are in an
   elaborated directory structure.  In contrast a flat-style repositories
   elaborated directory structure.  In contrast a flat-style repositories
@@ -96,20 +96,20 @@ look like this:
 
 
 APT::Acquire::Targets {
 APT::Acquire::Targets {
 	deb::Translations {
 	deb::Translations {
-		URI "$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
+		MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
 		ShortDescription "Translation-$(LANGUAGE)";
 		ShortDescription "Translation-$(LANGUAGE)";
 		Description "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
 		Description "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
 
 
-		flatURI "$(LANGUAGE)";
+		flatMetaKey "$(LANGUAGE)";
 		flatDescription "$(SITE) $(RELEASE) Translation-$(LANGUAGE)";
 		flatDescription "$(SITE) $(RELEASE) Translation-$(LANGUAGE)";
 	};
 	};
 
 
 	deb-src::Sources {
 	deb-src::Sources {
-		URI "$(COMPONENT)/source/Sources";
+		MetaKey "$(COMPONENT)/source/Sources";
 		ShortDescription "Sources";
 		ShortDescription "Sources";
 		Description "$(SITE) $(RELEASE)/$(COMPONENT) Sources";
 		Description "$(SITE) $(RELEASE)/$(COMPONENT) Sources";
 
 
-		flatURI "Sources";
+		flatMetaKey "Sources";
 		flatDescription "$(SITE) $(RELEASE) Sources";
 		flatDescription "$(SITE) $(RELEASE) Sources";
 
 
 		Optional "false";
 		Optional "false";
@@ -133,10 +133,7 @@ printed literally.
   have a meaningful value here.
   have a meaningful value here.
 * $(LANGUAGE): Values are all entries (expect "none") of configuration
 * $(LANGUAGE): Values are all entries (expect "none") of configuration
   option Acquire::Languages, e.g. "en", "de" or "de_AT".
   option Acquire::Languages, e.g. "en", "de" or "de_AT".
-
-These values are defined both for 'deb' as well as 'deb-src' targets.
-'deb' targets additional have the variable:
-
 * $(ARCHITECTURE): Values are all entries of configuration option
 * $(ARCHITECTURE): Values are all entries of configuration option
   APT::Architectures (potentially modified by sources.list options),
   APT::Architectures (potentially modified by sources.list options),
-  e.g. "amd64", "i386" or "armel".
+  e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src'
+  this variable has the value "source".

+ 2 - 2
test/integration/test-apt-acquire-additional-files

@@ -31,7 +31,7 @@ testempty find rootdir/var/lib/apt/lists -name '*Contents*'
 
 
 cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
 cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
 APT::Acquire::Targets::deb::Contents {
 APT::Acquire::Targets::deb::Contents {
-	URI "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
+	MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)";
 	ShortDescription "Contents";
 	ShortDescription "Contents";
 	Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents";
 	Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents";
 };
 };
@@ -54,7 +54,7 @@ testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Co
 # only if we downloaded a compressed file, but target was uncompressed
 # only if we downloaded a compressed file, but target was uncompressed
 cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
 cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF
 APT::Acquire::Targets::deb::Contents {
 APT::Acquire::Targets::deb::Contents {
-	URI "\$(COMPONENT)/Contents-\$(ARCHITECTURE).gz";
+	MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE).gz";
 	ShortDescription "Contents.gz";
 	ShortDescription "Contents.gz";
 	Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents.gz";
 	Description "\$(SITE) \$(RELEASE)/\$(COMPONENT) \$(ARCHITECTURE) Contents.gz";
 };
 };