Mailinglist Archive: zypp-commit (339 mails)

< Previous Next >
[zypp-commit] r11252 - in /trunk/libzypp: VERSION.cmake package/libzypp.changes zypp/CMakeLists.txt zypp/media/MediaHandler.cc
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Tue, 07 Oct 2008 11:35:49 -0000
  • Message-id: <20081007113549.CE4D3F2E84@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Tue Oct 7 13:35:49 2008
New Revision: 11252

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11252&view=rev
Log:
- Fixed detection of loopback mounted iso-files. The mtab entry does
not necessarily mention the iso-file. (bnc #432504)

Modified:
trunk/libzypp/VERSION.cmake
trunk/libzypp/package/libzypp.changes
trunk/libzypp/zypp/CMakeLists.txt
trunk/libzypp/zypp/media/MediaHandler.cc

Modified: trunk/libzypp/VERSION.cmake
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=11252&r1=11251&r2=11252&view=diff
==============================================================================
--- trunk/libzypp/VERSION.cmake (original)
+++ trunk/libzypp/VERSION.cmake Tue Oct 7 13:35:49 2008
@@ -60,9 +60,9 @@
#
SET(LIBZYPP_MAJOR "5")
SET(LIBZYPP_COMPATMINOR "13")
-SET(LIBZYPP_MINOR "14")
+SET(LIBZYPP_MINOR "15")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 5.14.0 (13)
+# LAST RELEASED: 5.15.0 (13)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======

Modified: trunk/libzypp/package/libzypp.changes
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=11252&r1=11251&r2=11252&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Tue Oct 7 13:35:49 2008
@@ -1,7 +1,15 @@
-------------------------------------------------------------------
+Tue Oct 7 13:24:10 CEST 2008 - ma@xxxxxxx
+
+- Fixed detection of loopback mounted iso-files. The mtab entry does
+ not necessarily mention the iso-file. (bnc #432504)
+- revision 11252
+- version 5.15.0 (13)
+
+-------------------------------------------------------------------
Thu Oct 2 19:46:13 CEST 2008 - ma@xxxxxxx

-- Add zypp.conf option 'download.use_deltarpm_always' to enable using
+- Add zypp.conf option 'download.use_deltarpmr.always' to enable using
delta rpms even if the package is available on a local source.
(Axel C. Frinke)
- revision 11235

Modified: trunk/libzypp/zypp/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=11252&r1=11251&r2=11252&view=diff
==============================================================================
--- trunk/libzypp/zypp/CMakeLists.txt (original)
+++ trunk/libzypp/zypp/CMakeLists.txt Tue Oct 7 13:35:49 2008
@@ -260,6 +260,7 @@
media/MediaCurl.cc
media/MediaAria2c.cc
media/MediaISO.cc
+ media/MediaSource.cc
media/MediaManager.cc
media/MediaUserAuth.cc
media/CredentialFileReader.cc

Modified: trunk/libzypp/zypp/media/MediaHandler.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/media/MediaHandler.cc?rev=11252&r1=11251&r2=11252&view=diff
==============================================================================
--- trunk/libzypp/zypp/media/MediaHandler.cc (original)
+++ trunk/libzypp/zypp/media/MediaHandler.cc Tue Oct 7 13:35:49 2008
@@ -15,7 +15,7 @@
#include <sstream>

#include "zypp/TmpPath.h"
-#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
#include "zypp/base/String.h"
#include "zypp/media/MediaHandler.h"
#include "zypp/media/MediaManager.h"
@@ -503,11 +503,11 @@
bool _isAttached = false;

AttachedMedia ref( attachedMedia());
- if( ref.mediaSource)
+ if( ref.mediaSource )
{
time_t old_mtime = _attach_mtime;
_attach_mtime = MediaManager::getMountTableMTime();
- if( !(old_mtime <= 0 || _attach_mtime != old_mtime))
+ if( !(old_mtime <= 0 || _attach_mtime != old_mtime) )
{
// OK, skip the check (we've seen it at least once)
_isAttached = true;
@@ -519,15 +519,13 @@
else
DBG << "Forced check of the mount table" << std::endl;

- MountEntries entries( MediaManager::getMountEntries());
- MountEntries::const_iterator e;
- for( e = entries.begin(); e != entries.end(); ++e)
+ MountEntries entries( MediaManager::getMountEntries());
+ for_( e, entries.begin(), entries.end() )
{
bool is_device = false;
- std::string dev_path(Pathname(e->src).asString());
PathInfo dev_info;

- if( dev_path.compare(0, sizeof("/dev/")-1, "/dev/") == 0 &&
+ if( str::hasPrefix( Pathname(e->src).asString(), "/dev/" ) &&
dev_info(e->src) && dev_info.isBlk())
{
is_device = true;
@@ -583,24 +581,35 @@
}
// 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)
{
- if( entries.empty())
+ MIL << "Looking for " << ref << endl;
+ if( entries.empty() )
{
ERR << "Unable to find any entry in the /etc/mtab file" << std::endl;
}
else
{
- MountEntries::const_iterator e;
- for( e = entries.begin(); e != entries.end(); ++e)
- {
- XXX << "mount entry: " << e->src << " on " << e->dir
- << " type " << e->type << "(" << e->opts << ")" << endl;
- }
+ dumpRange( DBG << "MountEntries: ", entries.begin(), entries.end() )
<< endl;
}
- if( old_mtime > 0)
+ if( old_mtime > 0 )
{
ERR << "Attached media not in mount table any more - forcing reset!"
<< std::endl;
@@ -797,10 +806,9 @@
for( e = entries.begin(); e != entries.end(); ++e)
{
bool is_device = false;
- std::string dev_path(Pathname(e->src).asString());
PathInfo dev_info;

- if( dev_path.compare(0, sizeof("/dev/")-1, "/dev/") == 0 &&
+ if( str::hasPrefix( Pathname(e->src).asString(), "/dev/" ) &&
dev_info(e->src) && dev_info.isBlk())
{
is_device = true;

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages