summaryrefslogtreecommitdiff
path: root/bin/schroot
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2013-01-04 23:02:26 +0000
committerRoger Leigh <rleigh@debian.org>2013-01-05 00:06:39 +0000
commita98b7ebd60032800901163fac9228721868157f8 (patch)
tree4c63c701a5ed6e1da0cd1bce130bdaa606dd2d8c /bin/schroot
parent883f5504e19302a51d474a94efebc3bb7f824ac4 (diff)
downloadschroot-a98b7ebd60032800901163fac9228721868157f8.tar.gz
Replace tabs with spaces in all source code
Diffstat (limited to 'bin/schroot')
-rw-r--r--bin/schroot/schroot-main-base.cc122
-rw-r--r--bin/schroot/schroot-main-base.h14
-rw-r--r--bin/schroot/schroot-main.cc6
-rw-r--r--bin/schroot/schroot-options-base.cc46
4 files changed, 94 insertions, 94 deletions
diff --git a/bin/schroot/schroot-main-base.cc b/bin/schroot/schroot-main-base.cc
index 579ff9eb..b09a83ef 100644
--- a/bin/schroot/schroot-main-base.cc
+++ b/bin/schroot/schroot-main-base.cc
@@ -74,12 +74,12 @@ sbuild::error<main_base::error_code>::error_strings
init_errors + (sizeof(init_errors) / sizeof(init_errors[0])));
main_base::main_base (std::string const& program_name,
- std::string const& program_usage,
- options_base::ptr& options,
- bool use_syslog):
+ std::string const& program_usage,
+ options_base::ptr& options,
+ bool use_syslog):
schroot_base::main(program_name, program_usage,
- std::static_pointer_cast<schroot_base::options>(options),
- use_syslog),
+ std::static_pointer_cast<schroot_base::options>(options),
+ use_syslog),
options(options)
{
}
@@ -96,7 +96,7 @@ main_base::action_version (std::ostream& stream)
format feature(" %1$-12s %2%\n");
stream << '\n'
- << _("Available chroot types:") << '\n';
+ << _("Available chroot types:") << '\n';
#ifdef SBUILD_FEATURE_BLOCKDEV
stream << feature % "BLOCKDEV" % _("Support for ‘block-device’ chroots");
#endif
@@ -130,7 +130,7 @@ main_base::action_info ()
std::cout << c->second;
if (pos + 1 != this->chroot_names.end())
- std::cout << '\n';
+ std::cout << '\n';
}
std::cout << std::flush;
@@ -161,9 +161,9 @@ main_base::action_config ()
// TRANSLATORS: %1% = program name
// TRANSLATORS: %2% = program version
// TRANSLATORS: %3% = current date
- << format(_("schroot configuration generated by %1% %2% on %3%"))
+ << format(_("schroot configuration generated by %1% %2% on %3%"))
% this->program_name % VERSION % sbuild::date(time(0))
- << endl;
+ << endl;
std::cout << endl;
sbuild::keyfile info;
@@ -179,7 +179,7 @@ main_base::action_config ()
// Generated chroots (e.g. source chroots) are not printed.
if (c->second->get_original())
- info << c->second;
+ info << c->second;
}
std::cout << info << std::flush;
@@ -194,35 +194,35 @@ main_base::get_chroot_options ()
this->options->all_source_chroots == true)
{
if (this->options->all_chroots)
- {
- sbuild::string_list chroots;
- if (this->options->action == options_base::ACTION_LIST &&
- !this->options->exclude_aliases)
- chroots = this->config->get_alias_list("chroot");
- else
- chroots = this->config->get_chroot_list("chroot");
- this->chroot_names.insert(this->chroot_names.end(), chroots.begin(), chroots.end());
- }
+ {
+ sbuild::string_list chroots;
+ if (this->options->action == options_base::ACTION_LIST &&
+ !this->options->exclude_aliases)
+ chroots = this->config->get_alias_list("chroot");
+ else
+ chroots = this->config->get_chroot_list("chroot");
+ this->chroot_names.insert(this->chroot_names.end(), chroots.begin(), chroots.end());
+ }
if (this->options->all_sessions)
- {
- sbuild::string_list sessions;
- if (this->options->action == options_base::ACTION_LIST &&
- !this->options->exclude_aliases)
- sessions = this->config->get_alias_list("session");
- else
- sessions = this->config->get_chroot_list("session");
- this->chroot_names.insert(this->chroot_names.end(), sessions.begin(), sessions.end());
- }
+ {
+ sbuild::string_list sessions;
+ if (this->options->action == options_base::ACTION_LIST &&
+ !this->options->exclude_aliases)
+ sessions = this->config->get_alias_list("session");
+ else
+ sessions = this->config->get_chroot_list("session");
+ this->chroot_names.insert(this->chroot_names.end(), sessions.begin(), sessions.end());
+ }
if (this->options->all_source_chroots)
- {
- sbuild::string_list sources;
- if (this->options->action == options_base::ACTION_LIST &&
- !this->options->exclude_aliases)
- sources = this->config->get_alias_list("source");
- else
- sources = this->config->get_chroot_list("source");
- this->chroot_names.insert(this->chroot_names.end(), sources.begin(), sources.end());
- }
+ {
+ sbuild::string_list sources;
+ if (this->options->action == options_base::ACTION_LIST &&
+ !this->options->exclude_aliases)
+ sources = this->config->get_alias_list("source");
+ else
+ sources = this->config->get_chroot_list("source");
+ this->chroot_names.insert(this->chroot_names.end(), sources.begin(), sources.end());
+ }
// Validate and normalise
this->chroots = this->config->validate_chroots("", this->chroot_names);
@@ -232,14 +232,14 @@ main_base::get_chroot_options ()
// Search in the appropriate namespace.
std::string chroot_namespace("chroot");
if (this->options->action == options_base::ACTION_SESSION_RECOVER ||
- this->options->action == options_base::ACTION_SESSION_RUN ||
- this->options->action == options_base::ACTION_SESSION_END)
- chroot_namespace = "session";
+ this->options->action == options_base::ACTION_SESSION_RUN ||
+ this->options->action == options_base::ACTION_SESSION_END)
+ chroot_namespace = "session";
// Validate and normalise
this->chroot_names = this->options->chroots;
this->chroots = this->config->validate_chroots
- (chroot_namespace, this->chroot_names);
+ (chroot_namespace, this->chroot_names);
}
}
@@ -288,21 +288,21 @@ main_base::run_impl ()
if (this->chroots.empty())
{
if (!(this->options->all_chroots == true ||
- this->options->all_sessions == true ||
- this->options->all_source_chroots == true))
- throw error(SCHROOT_CONF, CHROOT_NOTDEFINED);
+ this->options->all_sessions == true ||
+ this->options->all_source_chroots == true))
+ throw error(SCHROOT_CONF, CHROOT_NOTDEFINED);
else
- {
- // If one of the --all options was used, then don't treat
- // the lack of chroots as an error. TODO: Also check if any
- // additional chroots were specified with -c; this needs
- // changes in get_chroot_options.
- if (this->options->verbose)
- log_exception_warning(error((this->options->all_chroots == true) ?
- SCHROOT_CONF : SCHROOT_SESSION_DIR,
- CHROOT_NOTDEFINED));
- return EXIT_SUCCESS;
- }
+ {
+ // If one of the --all options was used, then don't treat
+ // the lack of chroots as an error. TODO: Also check if any
+ // additional chroots were specified with -c; this needs
+ // changes in get_chroot_options.
+ if (this->options->verbose)
+ log_exception_warning(error((this->options->all_chroots == true) ?
+ SCHROOT_CONF : SCHROOT_SESSION_DIR,
+ CHROOT_NOTDEFINED));
+ return EXIT_SUCCESS;
+ }
}
this->chroot_objects.clear();
for(sbuild::string_list::const_iterator pos = this->chroot_names.begin();
@@ -363,18 +363,18 @@ main_base::run_impl ()
add_session_auth();
if (!this->options->command.empty())
- this->session->get_auth()->set_command(this->options->command);
+ this->session->get_auth()->set_command(this->options->command);
if (!this->options->directory.empty())
- this->session->get_auth()->set_wd(this->options->directory);
+ this->session->get_auth()->set_wd(this->options->directory);
if (!this->options->shell.empty())
- this->session->set_shell_override(this->options->shell);
+ this->session->set_shell_override(this->options->shell);
this->session->set_preserve_environment(this->options->preserve);
this->session->set_session_id(this->options->session_name);
this->session->set_force(this->options->session_force);
if (this->options->quiet)
- this->session->set_verbosity("quiet");
+ this->session->set_verbosity("quiet");
else if (this->options->verbose)
- this->session->set_verbosity("verbose");
+ this->session->set_verbosity("verbose");
this->session->set_user_options(this->options->useroptions_map);
/* Run session. */
@@ -383,7 +383,7 @@ main_base::run_impl ()
catch (std::runtime_error const& e)
{
if (!this->options->quiet)
- sbuild::log_exception_error(e);
+ sbuild::log_exception_error(e);
}
if (this->session)
diff --git a/bin/schroot/schroot-main-base.h b/bin/schroot/schroot-main-base.h
index 0e0a9467..49939730 100644
--- a/bin/schroot/schroot-main-base.h
+++ b/bin/schroot/schroot-main-base.h
@@ -39,10 +39,10 @@ namespace schroot
/// Error codes.
enum error_code
{
- CHROOT_FILE, ///< No chroots are defined in ....
- CHROOT_FILE2, ///< No chroots are defined in ... or ....
- CHROOT_NOTDEFINED, ///< The specified chroots are not defined.
- SESSION_INVALID ///< Invalid session name.
+ CHROOT_FILE, ///< No chroots are defined in ....
+ CHROOT_FILE2, ///< No chroots are defined in ... or ....
+ CHROOT_NOTDEFINED, ///< The specified chroots are not defined.
+ SESSION_INVALID ///< Invalid session name.
};
/// Exception type.
@@ -60,9 +60,9 @@ namespace schroot
* logger.
*/
main_base (std::string const& program_name,
- std::string const& program_usage,
- options_base::ptr& options,
- bool use_syslog);
+ std::string const& program_usage,
+ options_base::ptr& options,
+ bool use_syslog);
/// The destructor.
virtual ~main_base ();
diff --git a/bin/schroot/schroot-main.cc b/bin/schroot/schroot-main.cc
index 7c952a31..a90182b4 100644
--- a/bin/schroot/schroot-main.cc
+++ b/bin/schroot/schroot-main.cc
@@ -39,9 +39,9 @@ using namespace schroot;
main::main (options_base::ptr& options):
main_base("schroot",
- _("[OPTION…] [COMMAND] — run command or shell in a chroot"),
- options,
- true)
+ _("[OPTION…] [COMMAND] — run command or shell in a chroot"),
+ options,
+ true)
{
}
diff --git a/bin/schroot/schroot-options-base.cc b/bin/schroot/schroot-options-base.cc
index 4389cc66..39199ea5 100644
--- a/bin/schroot/schroot-options-base.cc
+++ b/bin/schroot/schroot-options-base.cc
@@ -177,16 +177,16 @@ options_base::check_actions ()
if (this->quiet && this->verbose)
{
sbuild::log_warning()
- << _("--quiet and --verbose may not be used at the same time")
- << endl;
+ << _("--quiet and --verbose may not be used at the same time")
+ << endl;
sbuild::log_info() << _("Using verbose output") << endl;
}
if (!this->chroots.empty() && all_used())
{
sbuild::log_warning()
- << _("--chroot and --all may not be used at the same time")
- << endl;
+ << _("--chroot and --all may not be used at the same time")
+ << endl;
sbuild::log_info() << _("Using --chroots only") << endl;
this->all = this->all_chroots = this->all_source_chroots = this->all_sessions = false;
}
@@ -201,7 +201,7 @@ options_base::check_actions ()
// If no chroot was specified, fall back to the "default" chroot.
if (this->chroots.empty() && all_used() == false)
- this->chroots.push_back("default");
+ this->chroots.push_back("default");
}
else if (this->action == ACTION_SESSION_BEGIN)
{
@@ -209,49 +209,49 @@ options_base::check_actions ()
this->load_chroots = true;
this->load_sessions = false;
if (this->chroots.size() != 1 || all_used())
- throw error
- (_("Exactly one chroot must be specified when beginning a session"));
+ throw error
+ (_("Exactly one chroot must be specified when beginning a session"));
this->all = this->all_chroots = this->all_source_chroots = this->all_sessions = false;
}
else if (this->action == ACTION_SESSION_RECOVER ||
- this->action == ACTION_SESSION_RUN ||
- this->action == ACTION_SESSION_END)
+ this->action == ACTION_SESSION_RUN ||
+ this->action == ACTION_SESSION_END)
{
// Session operations work on all chroots.
this->load_chroots = this->load_sessions = true;
if (!this->session_name.empty())
throw error
- (_("--session-name is not permitted for the specified action; did you mean to use --chroot?"));
+ (_("--session-name is not permitted for the specified action; did you mean to use --chroot?"));
}
else if (this->action == ACTION_HELP ||
- this->action == ACTION_VERSION)
+ this->action == ACTION_VERSION)
{
// Chroots don't make sense here.
this->load_chroots = this->load_sessions = false;
this->all = this->all_chroots = this->all_source_chroots = this->all_sessions = false;
}
else if (this->action == ACTION_LIST ||
- this->action == ACTION_INFO ||
- this->action == ACTION_LOCATION ||
- this->action == ACTION_CONFIG)
+ this->action == ACTION_INFO ||
+ this->action == ACTION_LOCATION ||
+ this->action == ACTION_CONFIG)
{
// If not specified otherwise, load normal chroots, but allow
// --all options.
if (!this->chroots.empty()) // chroot specified
- this->load_chroots = this->load_sessions = true;
+ this->load_chroots = this->load_sessions = true;
else if (!all_used()) // no chroots specified
- {
- this->all_chroots = true;
- if (this->action == ACTION_LIST || this->action == ACTION_INFO)
- this->all_source_chroots = true;
- this->load_chroots = true;
- }
+ {
+ this->all_chroots = true;
+ if (this->action == ACTION_LIST || this->action == ACTION_INFO)
+ this->all_source_chroots = true;
+ this->load_chroots = true;
+ }
if (this->all_chroots || this->all_source_chroots)
- this->load_chroots = true;
+ this->load_chroots = true;
if (this->all_sessions)
- this->load_chroots = this->load_sessions = true;
+ this->load_chroots = this->load_sessions = true;
}
else
{