Imported Upstream version 14.45.10
[platform/upstream/libzypp.git] / zypp / media / MediaHandler.cc
index 18c05fe..90967bd 100644 (file)
@@ -608,6 +608,21 @@ MediaHandler::checkAttached(bool matchMountFs) const
          }
           // differs
         }
+        else // mixed cases:
+       {
+         // Type ISO: Since 11.1 mtab might contain the name of
+         // the loop device instead of the iso file:
+         if ( ref.mediaSource->type == "iso"
+           && str::hasPrefix( Pathname(e->src).asString(), "/dev/loop" )
+           && ref.attachPoint->path == Pathname(e->dir) )
+         {
+           DBG << "Found bound media "
+           << ref.mediaSource->asString()
+           << " in the mount table as " << e->src << std::endl;
+           _isAttached = true;
+           break;
+         }
+       }
       }
 
       if( !_isAttached)