Mailinglist Archive: zypp-commit (545 mails)
| < Previous | Next > |
[zypp-commit] r8435 - in /trunk/zypper/src: zypper-repos.cc zypper.cc zypper.h
- From: jkupec@xxxxxxxxxxxxxxxx
- Date: Fri, 01 Feb 2008 17:12:12 -0000
- Message-id: <20080201171212.7A39B24055@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Fri Feb 1 18:12:12 2008
New Revision: 8435
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8435&view=rev
Log:
- --no-refresh added (#356741)
Modified:
trunk/zypper/src/zypper-repos.cc
trunk/zypper/src/zypper.cc
trunk/zypper/src/zypper.h
Modified: trunk/zypper/src/zypper-repos.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-repos.cc?rev=8435&r1=8434&r2=8435&view=diff
==============================================================================
--- trunk/zypper/src/zypper-repos.cc (original)
+++ trunk/zypper/src/zypper-repos.cc Fri Feb 1 18:12:12 2008
@@ -365,8 +365,10 @@
RepoInfo repo(*it);
MIL << "checking if to refresh " << repo.name() << endl;
- //! \todo honor command line options/commands
- bool do_refresh = repo.enabled() && repo.autorefresh();
+ bool do_refresh =
+ repo.enabled() &&
+ repo.autorefresh() &&
+ !zypper.globalOpts().no_refresh;
if (do_refresh)
{
Modified: trunk/zypper/src/zypper.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=8435&r1=8434&r2=8435&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Fri Feb 1 18:12:12 2008
@@ -141,6 +141,7 @@
"\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
"\t--plus-repo, -p <URI>\tUse an additional repository\n"
"\t--disable-repositories\tDo not read meta-data from repositories.\n"
+ "\t--no-refresh\tDo not refresh the repositories.\n"
);
static string help_global_target_options = _("\tTarget Options:\n"
@@ -230,9 +231,10 @@
{"opt", optional_argument, 0, 'o'},
// TARGET OPTIONS
{"disable-system-resolvables", no_argument, 0, 0 },
- // SOURCE OPTIONS
+ // REPO OPTIONS
{"plus-repo", required_argument, 0, 'p'},
{"disable-repositories", no_argument, 0, 0 },
+ {"no-refresh", no_argument, 0, 0 },
{0, 0, 0, 0}
};
@@ -347,6 +349,13 @@
MIL << "Repositories enabled" << endl;
}
+ if (gopts.count("no-refresh"))
+ {
+ _gopts.no_refresh = true;
+ cout_v << _("Autorefresh disabled.") << endl;
+ MIL << "Autorefresh disabled." << endl;
+ }
+
if (gopts.count("disable-system-resolvables"))
{
MIL << "System resolvables disabled" << endl;
@@ -1625,6 +1634,10 @@
setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);
return;
}
+
+ if (globalOpts().no_refresh)
+ cout << format(_("The '%s' option has no effect here.")) % "--no-refresh"
+ << endl;
refresh_repos(*this);
return;
Modified: trunk/zypper/src/zypper.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.h?rev=8435&r1=8434&r2=8435&view=diff
==============================================================================
--- trunk/zypper/src/zypper.h (original)
+++ trunk/zypper/src/zypper.h Fri Feb 1 18:12:12 2008
@@ -34,6 +34,7 @@
non_interactive(false),
no_gpg_checks(false),
machine_readable(false),
+ no_refresh(false),
root_dir("/")
{}
@@ -56,6 +57,8 @@
bool non_interactive;
bool no_gpg_checks;
bool machine_readable;
+ /** Whether to disable autorefresh. */
+ bool no_refresh;
std::string root_dir;
zypp::RepoManagerOptions rm_options;
};
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
Date: Fri Feb 1 18:12:12 2008
New Revision: 8435
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8435&view=rev
Log:
- --no-refresh added (#356741)
Modified:
trunk/zypper/src/zypper-repos.cc
trunk/zypper/src/zypper.cc
trunk/zypper/src/zypper.h
Modified: trunk/zypper/src/zypper-repos.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-repos.cc?rev=8435&r1=8434&r2=8435&view=diff
==============================================================================
--- trunk/zypper/src/zypper-repos.cc (original)
+++ trunk/zypper/src/zypper-repos.cc Fri Feb 1 18:12:12 2008
@@ -365,8 +365,10 @@
RepoInfo repo(*it);
MIL << "checking if to refresh " << repo.name() << endl;
- //! \todo honor command line options/commands
- bool do_refresh = repo.enabled() && repo.autorefresh();
+ bool do_refresh =
+ repo.enabled() &&
+ repo.autorefresh() &&
+ !zypper.globalOpts().no_refresh;
if (do_refresh)
{
Modified: trunk/zypper/src/zypper.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=8435&r1=8434&r2=8435&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Fri Feb 1 18:12:12 2008
@@ -141,6 +141,7 @@
"\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
"\t--plus-repo, -p <URI>\tUse an additional repository\n"
"\t--disable-repositories\tDo not read meta-data from repositories.\n"
+ "\t--no-refresh\tDo not refresh the repositories.\n"
);
static string help_global_target_options = _("\tTarget Options:\n"
@@ -230,9 +231,10 @@
{"opt", optional_argument, 0, 'o'},
// TARGET OPTIONS
{"disable-system-resolvables", no_argument, 0, 0 },
- // SOURCE OPTIONS
+ // REPO OPTIONS
{"plus-repo", required_argument, 0, 'p'},
{"disable-repositories", no_argument, 0, 0 },
+ {"no-refresh", no_argument, 0, 0 },
{0, 0, 0, 0}
};
@@ -347,6 +349,13 @@
MIL << "Repositories enabled" << endl;
}
+ if (gopts.count("no-refresh"))
+ {
+ _gopts.no_refresh = true;
+ cout_v << _("Autorefresh disabled.") << endl;
+ MIL << "Autorefresh disabled." << endl;
+ }
+
if (gopts.count("disable-system-resolvables"))
{
MIL << "System resolvables disabled" << endl;
@@ -1625,6 +1634,10 @@
setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);
return;
}
+
+ if (globalOpts().no_refresh)
+ cout << format(_("The '%s' option has no effect here.")) % "--no-refresh"
+ << endl;
refresh_repos(*this);
return;
Modified: trunk/zypper/src/zypper.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.h?rev=8435&r1=8434&r2=8435&view=diff
==============================================================================
--- trunk/zypper/src/zypper.h (original)
+++ trunk/zypper/src/zypper.h Fri Feb 1 18:12:12 2008
@@ -34,6 +34,7 @@
non_interactive(false),
no_gpg_checks(false),
machine_readable(false),
+ no_refresh(false),
root_dir("/")
{}
@@ -56,6 +57,8 @@
bool non_interactive;
bool no_gpg_checks;
bool machine_readable;
+ /** Whether to disable autorefresh. */
+ bool no_refresh;
std::string root_dir;
zypp::RepoManagerOptions rm_options;
};
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
| < Previous | Next > |