Author: jkupec
Date: Sun Sep 14 00:05:50 2008
New Revision: 11061
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11061&view=rev
Log:
- modifyservice --{ar,rr,cl}-to-{enable,disable} options added
- modifyservice can now modify also non-service repos
Modified:
trunk/zypper/doc/zypper.8
trunk/zypper/src/Zypper.cc
trunk/zypper/src/repos.cc
Modified: trunk/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=11061&r1=11060&r2=11061&view=diff
==============================================================================
--- trunk/zypper/doc/zypper.8 (original)
+++ trunk/zypper/doc/zypper.8 Sun Sep 14 00:05:50 2008
@@ -1,4 +1,4 @@
-.TH "zypper" "8" "0.12.5" "zypper" "System Tools"
+.TH "zypper" "8" "0.12.6" "zypper" "System Tools"
.SH "SYNTAX"
.LP
zypper [\fI\-\-global\-options\fR] <\fBcommand\fR> [\fI\-\-command\-options\fR] [\fBcommand-arguments\fR]
@@ -638,7 +638,10 @@
.TP
.B modifyrepo (mr) <options>
-Modify properties of the repository specified by alias, number or URI.
+.TP
+.B modifyrepo (mr) <options> <--all|--remote|--local|--medium-type>
+Modify properties of the repository specified by alias, number or URI or
+one of the aggregate options.
.TP
\fI\-e, \-\-enable\fR
Enable the repository.
@@ -733,11 +736,15 @@
.TP
.B addservice (as) [options] <URI> <alias>
Adds a service specified by \fBURI\fR to the system. The \fBalias\fR must be
-unique and serves to identify the services.
+unique and serves to identify the service.
Newly added services are not refereshed automatically. Use the
\fBrefresh-services\fR command to refresh them.
+This command also allows to add also ordinary repositories when used with
+--type option, where you specify the type of the repository. See the addrepo
+command for the list of supported repository types.
+
.TP
.I \-t, \-\-type <TYPE>
Type of the service (possible values: ris). There are several aliases
@@ -765,10 +772,14 @@
Ignore query string in the URI.
.TP
-.B modifyservice (ms) [options]
-Modify properties of services.
+.B modifyservice (ms) <options>
+.B modifyservice (ms) <options> <--all|--remote|--local|--medium-type>
+Modify properties of specified services.
.TP
+Common Options
+These options are common to all types of services and repositories.
+.TP
.I \-d, \-\-disable
Disable the service (but don't remove it).
.TP
@@ -797,6 +808,29 @@
Apply changes to services of specified type.
.TP
+RIS Service Specific Options
+These options are ignored by services other than Repository Index Services.
+.TP
+.I \-i, --ar-to-enable <alias>
+Add a RIS service repository to enable.
+.TP
+.I \-I, --ar-to-disable <alias>
+Add a RIS service repository to disable.
+.TP
+.I \-j, --rr-to-enable <alias>
+Remove a RIS service repository to enable.
+.TP
+.I \-J, --rr-to-disable <alias>
+Remove a RIS service repository to disable.
+.TP
+.I \-k, --cl-to-enable
+Clear the list of RIS repositories to enable.
+.TP
+.I \-K, --cl-to-disable
+Clear the list of RIS repositories to disable.
+
+
+.TP
.B services (ls) [options]
List services defined on the system.
Modified: trunk/zypper/src/Zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=11061&r1=11060&r2=11061&view=diff
==============================================================================
--- trunk/zypper/src/Zypper.cc (original)
+++ trunk/zypper/src/Zypper.cc Sun Sep 14 00:05:50 2008
@@ -1039,6 +1039,13 @@
{"refresh", no_argument, 0, 'r'},
{"no-refresh", no_argument, 0, 'R'},
{"name", required_argument, 0, 'n'},
+ {"ar-to-enable", required_argument, 0, 'i'},
+ {"ar-to-disable", required_argument, 0, 'I'},
+ {"rr-to-enable", required_argument, 0, 'j'},
+ {"rr-to-disable", required_argument, 0, 'J'},
+ {"cl-to-enable", no_argument, 0, 'k'},
+ {"cl-to-disable", no_argument, 0, 'K'},
+ // aggregates
{"all", no_argument, 0, 'a' },
{"local", no_argument, 0, 'l' },
{"remote", no_argument, 0, 't' },
@@ -1051,21 +1058,30 @@
"modifyservice (ms) <options> \n"
"modifyservice (ms) <options> <%s>\n"
"\n"
- "Modify properties of services specified by alias, number, or URI, or by"
- " the '%s' aggregate options.\n"
+ "Modify properties of services specified by alias, number, or URI, or by the\n"
+ "'%s' aggregate options.\n"
"\n"
" Command options:\n"
- "-d, --disable Disable the service (but don't remove it).\n"
- "-e, --enable Enable a disabled service.\n"
- "-r, --refresh Enable auto-refresh of the service.\n"
- "-R, --no-refresh Disable auto-refresh of the service.\n"
- "-n, --name Set a descriptive name for the service.\n"
- "-a, --all Apply changes to all services.\n"
- "-l, --local Apply changes to all local services.\n"
- "-t, --remote Apply changes to all remote services.\n"
- "-m, --medium-type <type> Apply changes to services of specified type.\n"
+ "-d, --disable Disable the service (but don't remove it).\n"
+ "-e, --enable Enable a disabled service.\n"
+ "-r, --refresh Enable auto-refresh of the service.\n"
+ "-R, --no-refresh Disable auto-refresh of the service.\n"
+ "-n, --name Set a descriptive name for the service.\n"
+ "\n"
+ "-i, --ar-to-enable <alias> Add a RIS service repository to enable.\n"
+ "-I, --ar-to-disable <alias> Add a RIS service repository to disable.\n"
+ "-j, --rr-to-enable <alias> Remove a RIS service repository to enable.\n"
+ "-J, --rr-to-disable <alias> Remove a RIS service repository to disable.\n"
+ "-k, --cl-to-enable Clear the list of RIS repositories to enable.\n"
+ "-K, --cl-to-disable Clear the list of RIS repositories to disable.\n"
+ "\n"
+ "-a, --all Apply changes to all services.\n"
+ "-l, --local Apply changes to all local services.\n"
+ "-t, --remote Apply changes to all remote services.\n"
+ "-m, --medium-type <type> Apply changes to services of specified type.\n"
), "--all|--remote|--local|--medium-type"
, "--all, --remote, --local, --medium-type");
+ // ---------|---------|---------|---------|---------|---------|---------|---------
break;
}
@@ -1278,8 +1294,8 @@
"modifyrepo (mr) <options> \n"
"modifyrepo (mr) <options> <%s>\n"
"\n"
- "Modify properties of repositories specified by alias, number, or URI, or by"
- " the '%s' aggregate options.\n"
+ "Modify properties of repositories specified by alias, number, or URI, or by the\n"
+ "'%s' aggregate options.\n"
"\n"
" Command options:\n"
"-d, --disable Disable the repository (but don't remove it).\n"
@@ -1290,6 +1306,7 @@
"-p, --priority <1-99> Set priority of the repository.\n"
"-k, --keep-packages Enable RPM files caching.\n"
"-K, --no-keep-packages Disable RPM files caching.\n"
+ "\n"
"-a, --all Apply changes to all repositories.\n"
"-l, --local Apply changes to all local repositories.\n"
"-t, --remote Apply changes to all remote repositories.\n"
@@ -2304,7 +2321,10 @@
repo::RepoInfoBase_Ptr srv;
if (match_service(*this, _arguments[0], srv))
{
- modify_service(*this, srv->alias());
+ if (dynamic_pointer_cast<ServiceInfo>(srv))
+ modify_service(*this, srv->alias());
+ else
+ modify_repo(*this, srv->alias());
}
else
{
Modified: trunk/zypper/src/repos.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/repos.cc?rev=11061&r1=11060&r2=11061&view=diff
==============================================================================
--- trunk/zypper/src/repos.cc (original)
+++ trunk/zypper/src/repos.cc Sun Sep 14 00:05:50 2008
@@ -2385,6 +2385,7 @@
{
RepoManager manager(zypper.globalOpts().rm_options);
ServiceInfo srv(manager.getService(alias));
+
bool chnaged_enabled = false;
bool changed_autoref = false;
@@ -2407,11 +2408,77 @@
if ((tmp1 = zypper.cOpts().find("name")) != zypper.cOpts().end())
{
name = *tmp1->second.begin();
- if (!name.empty())
- srv.setName(name);
+ srv.setName(name);
+ }
+
+ set<string> artoenable;
+ set<string> artodisable;
+ set<string> rrtoenable;
+ set<string> rrtodisable;
+
+ // RIS repos to enable
+ if (zypper.cOpts().count("cl-to-enable"))
+ {
+ rrtoenable.insert(srv.reposToEnableBegin(), srv.reposToEnableEnd());
+ srv.clearReposToEnable();
+ }
+ else
+ {
+ if ((tmp1 = zypper.cOpts().find("ar-to-enable")) != zypper.cOpts().end())
+ for_(rit, tmp1->second.begin(), tmp1->second.end())
+ {
+ if (!srv.repoToEnableFind(*rit))
+ {
+ srv.addRepoToEnable(*rit);
+ artoenable.insert(*rit);
+ }
+ }
+ if ((tmp1 = zypper.cOpts().find("rr-to-enable")) != zypper.cOpts().end())
+ for_(rit, tmp1->second.begin(), tmp1->second.end())
+ {
+ if (srv.repoToEnableFind(*rit))
+ {
+ srv.delRepoToEnable(*rit);
+ rrtoenable.insert(*rit);
+ }
+ }
+ }
+
+ // RIS repos to disable
+ if (zypper.cOpts().count("cl-to-disable"))
+ {
+ rrtodisable.insert(srv.reposToDisableBegin(), srv.reposToDisableEnd());
+ srv.clearReposToDisable();
+ }
+ else
+ {
+ if ((tmp1 = zypper.cOpts().find("ar-to-disable")) != zypper.cOpts().end())
+ for_(rit, tmp1->second.begin(), tmp1->second.end())
+ {
+ if (!srv.repoToDisableFind(*rit))
+ {
+ srv.addRepoToDisable(*rit);
+ artodisable.insert(*rit);
+ }
+ }
+ if ((tmp1 = zypper.cOpts().find("rr-to-disable")) != zypper.cOpts().end())
+ for_(rit, tmp1->second.begin(), tmp1->second.end())
+ {
+ if (srv.repoToDisableFind(*rit))
+ {
+ srv.delRepoToDisable(*rit);
+ rrtodisable.insert(*rit);
+ }
+ }
}
- if (chnaged_enabled || changed_autoref | !name.empty())
+ if (chnaged_enabled
+ || changed_autoref
+ || !name.empty()
+ || !artoenable.empty()
+ || !artodisable.empty()
+ || !rrtoenable.empty()
+ || !rrtodisable.empty())
{
manager.modifyService(alias, srv);
@@ -2440,6 +2507,39 @@
zypper.out().info(boost::str(format(
_("Name of service '%s' has been set to '%s'.")) % alias % name));
}
+
+ if (!artoenable.empty())
+ {
+ zypper.out().info(boost::str(format(
+ _PL("Repository '%s' has been added to enabled repositories of service '%s'",
+ "Repositories '%s' have been added to enabled repositories of service '%s'",
+ artoenable.size()))
+ % str::join(artoenable.begin(), artoenable.end(), ", ") % alias));
+ }
+ if (!artodisable.empty())
+ {
+ zypper.out().info(boost::str(format(
+ _PL("Repository '%s' has been added to disabled repositories of service '%s'",
+ "Repositories '%s' have been added to disabled repositories of service '%s'",
+ artodisable.size()))
+ % str::join(artodisable.begin(), artodisable.end(), ", ") % alias));
+ }
+ if (!rrtoenable.empty())
+ {
+ zypper.out().info(boost::str(format(
+ _PL("Repository '%s' has been removed from enabled repositories of service '%s'",
+ "Repositories '%s' have been removed from enabled repositories of service '%s'",
+ rrtoenable.size()))
+ % str::join(rrtoenable.begin(), rrtoenable.end(), ", ") % alias));
+ }
+ if (!rrtodisable.empty())
+ {
+ zypper.out().info(boost::str(format(
+ _PL("Repository '%s' has been removed from disabled repositories of service '%s'",
+ "Repositories '%s' have been removed from disabled repositories of service '%s'",
+ rrtodisable.size()))
+ % str::join(rrtodisable.begin(), rrtodisable.end(), ", ") % alias));
+ }
}
else
{
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org