- targetDistro() added (only in-memory), will not be written out by dumpRepoOn(ostream)
authorJan Kupec <jkupec@suse.cz>
Wed, 3 Sep 2008 16:15:21 +0000 (16:15 +0000)
committerJan Kupec <jkupec@suse.cz>
Wed, 3 Sep 2008 16:15:21 +0000 (16:15 +0000)
zypp/RepoInfo.cc
zypp/RepoInfo.h

index 66c6f01..5679bfa 100644 (file)
@@ -63,6 +63,7 @@ namespace zypp
     std::set<Url> baseUrls;
     Pathname path;
     std::string service;
+    std::string targetDistro;
     Pathname metadatapath;
     Pathname packagespath;
     DefaultIntegral<unsigned,defaultPriority> priority;
@@ -189,6 +190,12 @@ namespace zypp
     _pimpl->service = name;
     return *this;
   }
+  
+  RepoInfo & RepoInfo::setTargetDistribution(
+      const std::string & targetDistribution)
+  {
+    _pimpl->targetDistro = targetDistribution;
+  }
 
   bool RepoInfo::gpgCheck() const
   { return indeterminate(_pimpl->gpgcheck) ? true : (bool) _pimpl->gpgcheck; }
@@ -228,6 +235,9 @@ namespace zypp
 
   std::string RepoInfo::service() const
   { return _pimpl->service; }
+  
+  std::string RepoInfo::targetDistribution() const
+  { return _pimpl->targetDistro; }
 
   RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const
   {
@@ -284,6 +294,9 @@ namespace zypp
     str << "- keeppackages: " << keepPackages() << std::endl;
     str << "- service     : " << service() << std::endl;
 
+    if (!targetDistribution().empty())
+      str << "- targetdistro: " << targetDistribution() << std::endl;
+
     return str;
   }
 
index ea5cfa0..7aa2cae 100644 (file)
@@ -200,6 +200,11 @@ namespace zypp
      */
     std::string service() const;
 
+    /**
+     * Distribution for which is this repository meant.
+     */
+    std::string targetDistribution() const;
+
     public:
     /**
      * Add a base url. \see baseUrls
@@ -299,6 +304,13 @@ namespace zypp
     RepoInfo & setService( const std::string& name );
 
     /**
+     * Sets the distribution for which is this repository meant. This is
+     * an in-memory value only, does not get written to the .repo file upon
+     * saving.
+     */
+    RepoInfo & setTargetDistribution(const std::string & targetDistribution);
+
+    /**
      * Write a human-readable representation of this RepoInfo object
      * into the \a str stream. Useful for logging.
      */