Catch RPM-Exeption when instaling the Distribution (with root != '/')
authorDominik Heidler <dheidler@suse.de>
Fri, 10 Dec 2010 16:17:54 +0000 (17:17 +0100)
committerDominik Heidler <dheidler@suse.de>
Fri, 10 Dec 2010 16:17:54 +0000 (17:17 +0100)
(bnc#658714)

zypp/target/TargetImpl.cc

index aa1998d3d81fd45e28ac37a825f0361a3bc06785..a6c10ea218ed47caf1b69947bede733d11b2fb07 100644 (file)
@@ -1597,8 +1597,15 @@ namespace zypp
         scoped_ptr<rpm::RpmDb> tmprpmdb;
         if ( ZConfig::instance().systemRoot() == Pathname() )
         {
-          tmprpmdb.reset( new rpm::RpmDb );
-          tmprpmdb->initDatabase( "/", Pathname(), false );
+          try
+          {
+              tmprpmdb.reset( new rpm::RpmDb );
+              tmprpmdb->initDatabase( "/", Pathname(), false );
+          }
+          catch( ... )
+          {
+            return "";
+          }
         }
         rpm::librpmDb::db_const_iterator it;
         if ( it.findByProvides( ZConfig::instance().distroverpkg() ) )