summaryrefslogtreecommitdiff
path: root/bin/schroot
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2012-02-27 10:15:14 +0000
committerRoger Leigh <rleigh@debian.org>2012-02-27 10:15:14 +0000
commiteef642dfbb4aaa475d290544fd5ac3d9c002fd0e (patch)
treeead1da1db61b6e35bf0ea4b925ae8b7ccf3b26b6 /bin/schroot
parent66ed29e00c313a17b945e6d80ce57a3cffac31e3 (diff)
downloadschroot-eef642dfbb4aaa475d290544fd5ac3d9c002fd0e.tar.gz
schroot: Add --exclude-aliases option
This removes aliases from the chroot selection.
Diffstat (limited to 'bin/schroot')
-rw-r--r--bin/schroot/schroot-main-base.cc11
-rw-r--r--bin/schroot/schroot-options-base.cc1
-rw-r--r--bin/schroot/schroot-options-base.h2
-rw-r--r--bin/schroot/schroot-options.cc6
4 files changed, 15 insertions, 5 deletions
diff --git a/bin/schroot/schroot-main-base.cc b/bin/schroot/schroot-main-base.cc
index 77fa019e..94826551 100644
--- a/bin/schroot/schroot-main-base.cc
+++ b/bin/schroot/schroot-main-base.cc
@@ -156,7 +156,8 @@ main_base::get_chroot_options ()
if (this->options->all_chroots)
{
sbuild::string_list chroots;
- if (this->options->action == options_base::ACTION_LIST)
+ 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");
@@ -165,7 +166,8 @@ main_base::get_chroot_options ()
if (this->options->all_sessions)
{
sbuild::string_list sessions;
- if (this->options->action == options_base::ACTION_LIST)
+ 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");
@@ -174,7 +176,8 @@ main_base::get_chroot_options ()
if (this->options->all_source_chroots)
{
sbuild::string_list sources;
- if (this->options->action == options_base::ACTION_LIST)
+ 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");
@@ -293,7 +296,7 @@ main_base::run_impl ()
throw error(*pos, CHROOT_NOTFOUND);
}
- /* Print chroot list (including aliases). */
+ /* Print chroot list. */
if (this->options->action == options_base::ACTION_LIST)
{
action_list();
diff --git a/bin/schroot/schroot-options-base.cc b/bin/schroot/schroot-options-base.cc
index 6d17af32..32848cca 100644
--- a/bin/schroot/schroot-options-base.cc
+++ b/bin/schroot/schroot-options-base.cc
@@ -54,6 +54,7 @@ options_base::options_base ():
all_chroots(false),
all_sessions(false),
all_source_chroots(false),
+ exclude_aliases(false),
session_name(),
session_force(false),
chroot(_("Chroot selection")),
diff --git a/bin/schroot/schroot-options-base.h b/bin/schroot/schroot-options-base.h
index c4af6c31..fd568424 100644
--- a/bin/schroot/schroot-options-base.h
+++ b/bin/schroot/schroot-options-base.h
@@ -97,6 +97,8 @@ namespace schroot
bool all_sessions;
/// Use all source_chroots.
bool all_source_chroots;
+ /// Exclude aliases in output.
+ bool exclude_aliases;
/// Load chroots.
bool load_chroots;
/// Load sessions.
diff --git a/bin/schroot/schroot-options.cc b/bin/schroot/schroot-options.cc
index 0814f140..6c451be1 100644
--- a/bin/schroot/schroot-options.cc
+++ b/bin/schroot/schroot-options.cc
@@ -59,7 +59,9 @@ options::add_options ()
("all-sessions",
_("Select all active sessions"))
("all-source-chroots",
- _("Select all source chroots"));
+ _("Select all source chroots"))
+ ("exclude-aliases",
+ _("Do not include aliases"));
chrootenv.add_options()
("directory,d", opt::value<std::string>(&this->directory),
@@ -106,6 +108,8 @@ options::check_options ()
this->all_sessions = true;
if (vm.count("all-source-chroots"))
this->all_source_chroots = true;
+ if (vm.count("exclude-aliases"))
+ this->exclude_aliases = true;
if (vm.count("preserve-environment"))
this->preserve = true;