diff options
author | 2011-10-03 22:00:01 +0100 | |
---|---|---|
committer | 2011-10-04 22:19:54 +0100 | |
commit | 338d0ebd6a158fedb3763c2d8f028646a73978af (patch) | |
tree | c3ca500940aa09771a8c374d7b27a6d9e40c53c2 | |
parent | 95c707052672c0f772355e9a1dad22989d656d40 (diff) | |
download | paludis-338d0ebd6a158fedb3763c2d8f028646a73978af.tar.gz paludis-338d0ebd6a158fedb3763c2d8f028646a73978af.tar.xz |
Rename sync suffixes to sources
"Suffixes" made sense when they were going to be configured as sync.foo = ,
sync.bar = , etc, but not anymore.
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | doc/configuration/repositories/e.html.part | 4 | ||||
-rw-r--r-- | doc/configuration/repositories/unavailable.html.part | 4 | ||||
-rw-r--r-- | doc/configuration/repositories/unwritten.html.part | 4 | ||||
-rw-r--r-- | paludis/repositories/e/e_repository.cc | 34 | ||||
-rw-r--r-- | paludis/repositories/unavailable/unavailable_repository.cc | 34 | ||||
-rw-r--r-- | paludis/repositories/unwritten/unwritten_repository.cc | 34 | ||||
-rw-r--r-- | paludis/repository.hh | 4 | ||||
-rw-r--r-- | src/clients/cave/cmd_sync.cc | 12 | ||||
-rw-r--r-- | zsh-completion/_cave | 2 |
10 files changed, 72 insertions, 65 deletions
@@ -4,6 +4,11 @@ News for Paludis This file lists the major changes between versions. For a more detailed list of every change, see the Git log. +master: + * 'cave sync --suffix' is now known as '--source' (although the old + version is still supported for compatibility). The short version is + still '-s'. + 0.68.0: * Licence groups are now supported. diff --git a/doc/configuration/repositories/e.html.part b/doc/configuration/repositories/e.html.part index 5398ac050..93ede77b1 100644 --- a/doc/configuration/repositories/e.html.part +++ b/doc/configuration/repositories/e.html.part @@ -76,11 +76,11 @@ for <code>e</code> format repositories:</p> <dt><code>sync</code></dt> <dd>How to sync the repository. See <a href="../syncers.html">Syncers</a> for supported formats. Optional if the - repository does not need to be synced. Different sync URIs to use when a different suffix is requested may be + repository does not need to be synced. Different sync URIs to use when a different source is requested may be specified, e.g. <code>sync = git+http://host/path local: git+file:///path</code>.</dd> <dt><code>sync_options</code></dt> - <dd>Any options to be passed to the syncer. Optional. Options for suffixes are specified using the same format as + <dd>Any options to be passed to the syncer. Optional. Options for alternative sources are specified using the same format as for <code>sync</code>.</dd> <dt><code>builddir</code></dt> diff --git a/doc/configuration/repositories/unavailable.html.part b/doc/configuration/repositories/unavailable.html.part index 187e7e396..cfd107f56 100644 --- a/doc/configuration/repositories/unavailable.html.part +++ b/doc/configuration/repositories/unavailable.html.part @@ -19,11 +19,11 @@ for <code>unavailable</code> format repositories:</p> <dt><code>sync</code></dt> <dd>How to sync the repository. See <a href="../syncers.html">Syncers</a> for supported formats. Optional if the - repository does not need to be synced. Different sync URIs to use when a different suffix is requested may be + repository does not need to be synced. Different sync URIs to use when a different source is requested may be specified, e.g. <code>sync = git+http://host/path local: git+file:///path</code>.</dd> <dt><code>sync_options</code></dt> - <dd>Any options to be passed to the syncer. Optional. Options for suffixes are specified using the same format as + <dd>Any options to be passed to the syncer. Optional. Options for alternative sources are specified using the same format as for <code>sync</code>.</dd> </dl> diff --git a/doc/configuration/repositories/unwritten.html.part b/doc/configuration/repositories/unwritten.html.part index 92b1ea446..0426d50fd 100644 --- a/doc/configuration/repositories/unwritten.html.part +++ b/doc/configuration/repositories/unwritten.html.part @@ -18,11 +18,11 @@ for <code>unwritten</code> format repositories:</p> <dt><code>sync</code></dt> <dd>How to sync the repository. See <a href="../syncers.html">Syncers</a> for supported formats. Optional if the - repository does not need to be synced. Different sync URIs to use when a different suffix is requested may be + repository does not need to be synced. Different sync URIs to use when a different source is requested may be specified, e.g. <code>sync = git+http://host/path local: git+file:///path</code>.</dd> <dt><code>sync_options</code></dt> - <dd>Any options to be passed to the syncer. Optional. Options for suffixes are specified using the same format as + <dd>Any options to be passed to the syncer. Optional. Options for alternative sources are specified using the same format as for <code>sync</code>.</dd> </dl> diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc index f8b5806b1..c0ab5ed45 100644 --- a/paludis/repositories/e/e_repository.cc +++ b/paludis/repositories/e/e_repository.cc @@ -725,20 +725,20 @@ ERepository::need_mirrors() const bool ERepository::sync( - const std::string & suffix, + const std::string & source, const std::string & revision, const std::shared_ptr<OutputManager> & output_manager) const { Context context("When syncing repository '" + stringify(name()) + "':"); std::string sync_uri, sync_options; - if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix)) - sync_uri = _imp->params.sync()->find(suffix)->second; + if (_imp->params.sync()->end() != _imp->params.sync()->find(source)) + sync_uri = _imp->params.sync()->find(source)->second; if (sync_uri.empty()) return false; - if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(suffix)) - sync_options = _imp->params.sync_options()->find(suffix)->second; + if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(source)) + sync_options = _imp->params.sync_options()->find(source)->second; std::list<std::string> sync_list; tokenise_whitespace(sync_uri, std::back_inserter(sync_list)); @@ -1373,35 +1373,35 @@ ERepository::repository_factory_create( auto sync(std::make_shared<Map<std::string, std::string> >()); std::vector<std::string> sync_tokens; tokenise_whitespace(f("sync"), std::back_inserter(sync_tokens)); - std::string suffix; + std::string source; for (auto t(sync_tokens.begin()), t_end(sync_tokens.end()) ; t != t_end ; ++t) if ((! t->empty()) && (':' == t->at(t->length() - 1))) - suffix = t->substr(0, t->length() - 1); + source = t->substr(0, t->length() - 1); else { std::string v; - if (sync->end() != sync->find(suffix)) - v = sync->find(suffix)->second + " "; - sync->erase(suffix); - sync->insert(suffix, v + *t); + if (sync->end() != sync->find(source)) + v = sync->find(source)->second + " "; + sync->erase(source); + sync->insert(source, v + *t); } auto sync_options(std::make_shared<Map<std::string, std::string> >()); std::vector<std::string> sync_options_tokens; tokenise_whitespace(f("sync_options"), std::back_inserter(sync_options_tokens)); - suffix = ""; + source = ""; for (auto t(sync_options_tokens.begin()), t_end(sync_options_tokens.end()) ; t != t_end ; ++t) if ((! t->empty()) && (':' == t->at(t->length() - 1))) - suffix = t->substr(0, t->length() - 1); + source = t->substr(0, t->length() - 1); else { std::string v; - if (sync_options->end() != sync_options->find(suffix)) - v = sync_options->find(suffix)->second + " "; - sync_options->erase(suffix); - sync_options->insert(suffix, v + *t); + if (sync_options->end() != sync_options->find(source)) + v = sync_options->find(source)->second + " "; + sync_options->erase(source); + sync_options->insert(source, v + *t); } std::string builddir(f("builddir")); diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc index 9ce26190a..61af1e1a3 100644 --- a/paludis/repositories/unavailable/unavailable_repository.cc +++ b/paludis/repositories/unavailable/unavailable_repository.cc @@ -306,20 +306,20 @@ UnavailableRepository::some_ids_might_not_be_masked() const bool UnavailableRepository::sync( - const std::string & suffix, + const std::string & source, const std::string & revision, const std::shared_ptr<OutputManager> & output_manager) const { Context context("When syncing repository '" + stringify(name()) + "':"); std::string sync_uri, sync_options; - if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix)) - sync_uri = _imp->params.sync()->find(suffix)->second; + if (_imp->params.sync()->end() != _imp->params.sync()->find(source)) + sync_uri = _imp->params.sync()->find(source)->second; if (sync_uri.empty()) return false; - if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(suffix)) - sync_options = _imp->params.sync_options()->find(suffix)->second; + if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(source)) + sync_options = _imp->params.sync_options()->find(source)->second; std::list<std::string> sync_list; tokenise_whitespace(sync_uri, std::back_inserter(sync_list)); @@ -377,35 +377,35 @@ UnavailableRepository::repository_factory_create( auto sync(std::make_shared<Map<std::string, std::string> >()); std::vector<std::string> sync_tokens; tokenise_whitespace(f("sync"), std::back_inserter(sync_tokens)); - std::string suffix; + std::string source; for (auto t(sync_tokens.begin()), t_end(sync_tokens.end()) ; t != t_end ; ++t) if ((! t->empty()) && (':' == t->at(t->length() - 1))) - suffix = t->substr(0, t->length() - 1); + source = t->substr(0, t->length() - 1); else { std::string v; - if (sync->end() != sync->find(suffix)) - v = sync->find(suffix)->second + " "; - sync->erase(suffix); - sync->insert(suffix, v + *t); + if (sync->end() != sync->find(source)) + v = sync->find(source)->second + " "; + sync->erase(source); + sync->insert(source, v + *t); } auto sync_options(std::make_shared<Map<std::string, std::string> >()); std::vector<std::string> sync_options_tokens; tokenise_whitespace(f("sync_options"), std::back_inserter(sync_options_tokens)); - suffix = ""; + source = ""; for (auto t(sync_options_tokens.begin()), t_end(sync_options_tokens.end()) ; t != t_end ; ++t) if ((! t->empty()) && (':' == t->at(t->length() - 1))) - suffix = t->substr(0, t->length() - 1); + source = t->substr(0, t->length() - 1); else { std::string v; - if (sync_options->end() != sync_options->find(suffix)) - v = sync_options->find(suffix)->second + " "; - sync_options->erase(suffix); - sync_options->insert(suffix, v + *t); + if (sync_options->end() != sync_options->find(source)) + v = sync_options->find(source)->second + " "; + sync_options->erase(source); + sync_options->insert(source, v + *t); } return std::make_shared<UnavailableRepository>( diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc index 445b31d25..648f6965d 100644 --- a/paludis/repositories/unwritten/unwritten_repository.cc +++ b/paludis/repositories/unwritten/unwritten_repository.cc @@ -254,20 +254,20 @@ UnwrittenRepository::some_ids_might_not_be_masked() const bool UnwrittenRepository::sync( - const std::string & suffix, + const std::string & source, const std::string & revision, const std::shared_ptr<OutputManager> & output_manager) const { Context context("When syncing repository '" + stringify(name()) + "':"); std::string sync_uri, sync_options; - if (_imp->params.sync()->end() != _imp->params.sync()->find(suffix)) - sync_uri = _imp->params.sync()->find(suffix)->second; + if (_imp->params.sync()->end() != _imp->params.sync()->find(source)) + sync_uri = _imp->params.sync()->find(source)->second; if (sync_uri.empty()) return false; - if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(suffix)) - sync_options = _imp->params.sync_options()->find(suffix)->second; + if (_imp->params.sync_options()->end() != _imp->params.sync_options()->find(source)) + sync_options = _imp->params.sync_options()->find(source)->second; std::list<std::string> sync_list; tokenise_whitespace(sync_uri, std::back_inserter(sync_list)); @@ -333,35 +333,35 @@ UnwrittenRepository::repository_factory_create( auto sync(std::make_shared<Map<std::string, std::string> >()); std::vector<std::string> sync_tokens; tokenise_whitespace(f("sync"), std::back_inserter(sync_tokens)); - std::string suffix; + std::string source; for (auto t(sync_tokens.begin()), t_end(sync_tokens.end()) ; t != t_end ; ++t) if ((! t->empty()) && (':' == t->at(t->length() - 1))) - suffix = t->substr(0, t->length() - 1); + source = t->substr(0, t->length() - 1); else { std::string v; - if (sync->end() != sync->find(suffix)) - v = sync->find(suffix)->second + " "; - sync->erase(suffix); - sync->insert(suffix, v + *t); + if (sync->end() != sync->find(source)) + v = sync->find(source)->second + " "; + sync->erase(source); + sync->insert(source, v + *t); } auto sync_options(std::make_shared<Map<std::string, std::string> >()); std::vector<std::string> sync_options_tokens; tokenise_whitespace(f("sync_options"), std::back_inserter(sync_options_tokens)); - suffix = ""; + source = ""; for (auto t(sync_options_tokens.begin()), t_end(sync_options_tokens.end()) ; t != t_end ; ++t) if ((! t->empty()) && (':' == t->at(t->length() - 1))) - suffix = t->substr(0, t->length() - 1); + source = t->substr(0, t->length() - 1); else { std::string v; - if (sync_options->end() != sync_options->find(suffix)) - v = sync_options->find(suffix)->second + " "; - sync_options->erase(suffix); - sync_options->insert(suffix, v + *t); + if (sync_options->end() != sync_options->find(source)) + v = sync_options->find(source)->second + " "; + sync_options->erase(source); + sync_options->insert(source, v + *t); } return std::make_shared<UnwrittenRepository>( diff --git a/paludis/repository.hh b/paludis/repository.hh index 02b7562ec..a86386db5 100644 --- a/paludis/repository.hh +++ b/paludis/repository.hh @@ -425,11 +425,11 @@ namespace paludis * * \return True if we synced successfully, false if we skipped sync. * \since 0.42 (previously in an interface) - * \since 0.55 takes a suffix (may be empty) + * \since 0.55 takes a source (may be empty) * \since 0.61 takes a revision (may be empty) */ virtual bool sync( - const std::string & suffix, + const std::string & source, const std::string & revision, const std::shared_ptr<OutputManager> &) const = 0; diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc index a12f060ce..2ed725899 100644 --- a/src/clients/cave/cmd_sync.cc +++ b/src/clients/cave/cmd_sync.cc @@ -67,7 +67,8 @@ namespace args::SwitchArg a_sequential; args::ArgsGroup g_sync_options; - args::StringArg a_suffix; + args::StringArg a_source; + args::AliasArg a_suffix; args::StringArg a_revision; virtual std::string app_name() const @@ -91,7 +92,8 @@ namespace a_sequential(&g_job_options, "sequential", '\0', "Only perform one sync at a time.", false), g_sync_options(main_options_section(), "Sync Options", "Sync options."), - a_suffix(&g_sync_options, "suffix", 's', "Use the specified suffix for syncing."), + a_source(&g_sync_options, "source", 's', "Use the specified source for syncing."), + a_suffix(&a_source, "suffix", true), a_revision(&g_sync_options, "revision", 'r', "Sync to the specified revision. Not supported by all " "syncers. Probably doesn't make sense when not specified with a repository parameter.") { @@ -144,8 +146,8 @@ namespace if (r->sync_host_key()) { auto sync_host(r->sync_host_key()->parse_value()); - if (sync_host->end() != sync_host->find(cmdline.a_suffix.argument())) - return sync_host->find(cmdline.a_suffix.argument())->second; + if (sync_host->end() != sync_host->find(cmdline.a_source.argument())) + return sync_host->find(cmdline.a_source.argument())->second; } return ""; @@ -207,7 +209,7 @@ namespace { const std::shared_ptr<Repository> repo(env->fetch_repository(name)); - if (! repo->sync(cmdline.a_suffix.argument(), cmdline.a_revision.argument(), output_manager)) + if (! repo->sync(cmdline.a_source.argument(), cmdline.a_revision.argument(), output_manager)) skipped = true; success = true; } diff --git a/zsh-completion/_cave b/zsh-completion/_cave index 01db27b9a..ba8f5f262 100644 --- a/zsh-completion/_cave +++ b/zsh-completion/_cave @@ -833,7 +833,7 @@ _cave_cmd_sync() _arguments -s : \ '(--help -h)'{--help,-h}'[Display help messsage]' \ '--sequential[Only perform one sync at a time]' \ - '(--suffix -s)'{--suffix,-s}'[Use the specified suffix for syncing]:Suffix: ' \ + '(--source -s)'{--source,-s}'[Use the specified source for syncing]:Source: ' \ '(--revision -r)'{--revision,-r}'[Sync to the specified revision]:Revision: ' \ '*:repository:_cave_repositories' && return 0 } |