From: Duncan Mac-Vicar P Date: Fri, 24 Aug 2007 09:52:22 +0000 (+0000) Subject: - Check for YaST before doing anything X-Git-Tag: BASE-SuSE-Linux-10_3-Branch~212 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d7af89695f3f1c953035152f067648cbbcc0cd8;p=platform%2Fupstream%2Flibzypp.git - Check for YaST before doing anything --- diff --git a/tools/migrate-sources/migrate-sources.cc b/tools/migrate-sources/migrate-sources.cc index 9a313f9..5878eb4 100644 --- a/tools/migrate-sources/migrate-sources.cc +++ b/tools/migrate-sources/migrate-sources.cc @@ -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;