Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / zypp_detail / ZYppImpl.cc
index 7c6589f..8af290a 100644 (file)
@@ -16,7 +16,6 @@
 #include "zypp/base/String.h"
 
 #include "zypp/zypp_detail/ZYppImpl.h"
-#include "zypp/solver/detail/Helper.h"
 #include "zypp/target/TargetImpl.h"
 #include "zypp/ZYpp.h"
 #include "zypp/DiskUsageCounter.h"
 #include "zypp/sat/Pool.h"
 #include "zypp/PoolItem.h"
 
+#include "zypp/ZYppCallbacks.h"        // JobReport::instance
+
 using std::endl;
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  namespace media
+  {
+    ScopedDisableMediaChangeReport::ScopedDisableMediaChangeReport( bool condition_r )
+    {
+      static weak_ptr<callback::TempConnect<media::MediaChangeReport> > globalguard;
+      if ( condition_r && ! (_guard = globalguard.lock()) )
+      {
+       // aquire a new one....
+       _guard.reset( new callback::TempConnect<media::MediaChangeReport>() );
+       globalguard = _guard;
+      }
+    }
+  } // namespace media
+  ///////////////////////////////////////////////////////////////////
+
+  callback::SendReport<JobReport> & JobReport::instance()
+  {
+    static callback::SendReport<JobReport> _report;
+    return _report;
+  }
+
+
   ///////////////////////////////////////////////////////////////////
   namespace zypp_detail
   { /////////////////////////////////////////////////////////////////
@@ -162,6 +187,13 @@ namespace zypp
       _target->_pimpl->installSrcPackage( srcPackage_r );
     }
 
+    ManagedFile ZYppImpl::provideSrcPackage( const SrcPackage_constPtr & srcPackage_r )
+    {
+      if (! _target)
+        ZYPP_THROW( Exception("Target not initialized.") );
+      return _target->_pimpl->provideSrcPackage( srcPackage_r );
+    }
+
     //------------------------------------------------------------------------
     // target store path