From d34ee1af9d2dca08697dfa524582e3686b271b1b Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Wed, 3 Sep 2008 16:15:21 +0000 Subject: [PATCH] - targetDistro() added (only in-memory), will not be written out by dumpRepoOn(ostream) --- zypp/RepoInfo.cc | 13 +++++++++++++ zypp/RepoInfo.h | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/zypp/RepoInfo.cc b/zypp/RepoInfo.cc index 66c6f01..5679bfa 100644 --- a/zypp/RepoInfo.cc +++ b/zypp/RepoInfo.cc @@ -63,6 +63,7 @@ namespace zypp std::set baseUrls; Pathname path; std::string service; + std::string targetDistro; Pathname metadatapath; Pathname packagespath; DefaultIntegral 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; } diff --git a/zypp/RepoInfo.h b/zypp/RepoInfo.h index ea5cfa0..7aa2cae 100644 --- a/zypp/RepoInfo.h +++ b/zypp/RepoInfo.h @@ -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. */ -- 2.7.4