check that repo exists when using cache too. Otherwise it detects a YUM repo just...
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 20 Feb 2006 12:51:19 +0000 (12:51 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 20 Feb 2006 12:51:19 +0000 (12:51 +0000)
zypp/source/yum/YUMSourceImpl.cc

index cf53e6f..392df5c 100644 (file)
@@ -19,6 +19,7 @@
 #include "zypp/source/yum/YUMGroupImpl.h"
 #include "zypp/source/yum/YUMPatternImpl.h"
 
+#include "zypp/PathInfo.h"
 #include "zypp/base/Logger.h"
 #include "zypp/base/Exception.h"
 #include "zypp/CapFactory.h"
@@ -79,6 +80,9 @@ namespace zypp
             filename = _cache_dir + "/repodata/repomd.xml";
           }
         
+          if ( ! PathInfo(filename).isExist() )
+            ZYPP_THROW(Exception("repodata/repomd.xml not found"));
+
           DBG << "Reading file " << filename << endl;
           ifstream repo_st(filename.asString().c_str());
           YUMRepomdParser repomd(repo_st, "");