Imported Upstream version 15.0.0
[platform/upstream/libzypp.git] / zypp / repo / RepoVariables.cc
index 93c0f20..d53e534 100644 (file)
@@ -21,7 +21,6 @@ using std::endl;
 #include "zypp/base/String.h"
 #include "zypp/base/Regex.h"
 
-#include "zypp/ZYppFactory.h"
 #include "zypp/ZConfig.h"
 #include "zypp/Target.h"
 #include "zypp/Arch.h"
@@ -390,23 +389,6 @@ namespace zypp
     ///////////////////////////////////////////////////////////////////
     namespace
     {
-      inline std::string getReleaseverString()
-      {
-       std::string ret( env::ZYPP_REPO_RELEASEVER() );
-       if( ret.empty() )
-       {
-         Target_Ptr trg( getZYpp()->getTarget() );
-         if ( trg )
-           ret = trg->distributionVersion();
-         else
-           ret = Target::distributionVersion( Pathname()/*guess*/ );
-       }
-       else
-         WAR << "ENV overwrites $releasever=" << ret << endl;
-
-       return ret;
-      }
-
       /** \brief Provide lazy initialized repo variables
        */
       struct RepoVars : private zypp::base::NonCopyable
@@ -456,11 +438,14 @@ namespace zypp
 
        void assertReleaseverStr() const
        {
-         // check for changing releasever (bnc#943563)
-         std::string check( getReleaseverString() );
-         if ( check != _releasever )
+         if ( _releasever.empty() )
          {
-           _releasever = std::move(check);
+           _releasever = env::ZYPP_REPO_RELEASEVER();
+           if( _releasever.empty() )
+             _releasever = Target::distributionVersion( Pathname()/*guess*/ );
+           else
+             WAR << "ENV overwrites $releasever=" << _releasever << endl;
+
            // split major/minor for SLE
            std::string::size_type pos = _releasever.find( "." );
            if ( pos == std::string::npos )