From: Michael Andres Date: Mon, 20 Jan 2014 11:51:58 +0000 (+0100) Subject: Don't read metadata from CD/DVD repo if --no-check was used (bnc#859160) X-Git-Tag: upstream/1.11.11~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84a8950d89741f03cec596f92c3d0a0db406a3dd;p=platform%2Fupstream%2Fzypper.git Don't read metadata from CD/DVD repo if --no-check was used (bnc#859160) --- diff --git a/src/repos.cc b/src/repos.cc index 7221054..3aeaa77 100644 --- a/src/repos.cc +++ b/src/repos.cc @@ -1692,22 +1692,31 @@ void add_repo(Zypper & zypper, RepoInfo & repo) MIL << "Repository successfully added: " << repo << endl; - if(is_cd) + if ( is_cd ) { - zypper.out().info(boost::str( - format(_("Reading data from '%s' media")) - % (zypper.config().show_alias ? repo.alias() : repo.name()))); - bool error = refresh_raw_metadata(zypper, repo, false); - if (!error) - error = build_cache(zypper, repo, false); - if (error) - { - zypper.out().error(boost::str( - format(_("Problem reading data from '%s' media")) - % (zypper.config().show_alias ? repo.alias() : repo.name())), - _("Please check if your installation media is valid and readable.")); - zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP); - return; + if ( ! copts.count("no-check") ) + { + zypper.out().info(boost::str( + format(_("Reading data from '%s' media")) + % (zypper.config().show_alias ? repo.alias() : repo.name()))); + bool error = refresh_raw_metadata(zypper, repo, false); + if (!error) + error = build_cache(zypper, repo, false); + if (error) + { + zypper.out().error(boost::str( + format(_("Problem reading data from '%s' media")) + % (zypper.config().show_alias ? repo.alias() : repo.name())), + _("Please check if your installation media is valid and readable.")); + zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP); + return; + } + } + else + { + zypper.out().info( boost::format(_("Reading data from '%s' media is delayed until next refresh.")) + % (zypper.config().show_alias ? repo.alias() : repo.name()), + " [--no-check]" ); } } }