- Check for YaST before doing anything
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 24 Aug 2007 09:52:22 +0000 (09:52 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 24 Aug 2007 09:52:22 +0000 (09:52 +0000)
tools/migrate-sources/migrate-sources.cc

index 9a313f9..5878eb4 100644 (file)
@@ -35,12 +35,6 @@ struct Options
 
 static void migrate_sources( const Options &opt )
 {
-  zypp::zypp_readonly_hack::IWantIt();
-  ZYpp::Ptr Z = zypp::getZYpp();
-  RepoManager manager;
-  
-  Pathname source_p = opt.root + opt.sources_dir;
-  
   if ( string(getenv("YAST_IS_RUNNING")) == "instsys" )
   {
     MIL << "YaST is running in instsys. Not migrating old sources. YaST will do it." << endl;
@@ -51,6 +45,12 @@ static void migrate_sources( const Options &opt )
     MIL << "YaST not running in instsys." << endl;
   }
 
+  zypp::zypp_readonly_hack::IWantIt();
+  ZYpp::Ptr Z = zypp::getZYpp();
+  RepoManager manager;
+  
+  Pathname source_p = opt.root + opt.sources_dir;
+
   if ( ! PathInfo(source_p).isExist() )
   {
     cout << "No sources to migrate." << endl;