summaryrefslogtreecommitdiff
path: root/bin/dchroot
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2012-10-27 12:47:13 +0100
committerRoger Leigh <rleigh@debian.org>2012-10-27 18:44:30 +0100
commit75ca1e5a9167731f4eebf13d1ee7cda5cef9af23 (patch)
treedaedecf596b99aadb255f57fe949ab5e356a58b9 /bin/dchroot
parentbbd6ff3218e604f337e6b35dc75a8806d581f280 (diff)
downloadschroot-75ca1e5a9167731f4eebf13d1ee7cda5cef9af23.tar.gz
sbuild: Correct alias handling
Alias names were being lost before being stored in the session metadata. This has been corrected by using an alias->chroot mapping for the chroots selected by the user; plus keeping a list of alias names (to preserve the ordering). This has required some refactoring to accommodate the changes. The information display functionality previously in sbuild::chroot_config has been moved into the client code. The chroot validation is now also done in a single step, which makes the validation simpler and more robust.
Diffstat (limited to 'bin/dchroot')
-rw-r--r--bin/dchroot/dchroot-main-base.cc14
-rw-r--r--bin/dchroot/dchroot-main-base.h3
-rw-r--r--bin/dchroot/dchroot-main.cc8
-rw-r--r--bin/dchroot/dchroot-main.h3
-rw-r--r--bin/dchroot/dchroot-options.cc6
5 files changed, 5 insertions, 29 deletions
diff --git a/bin/dchroot/dchroot-main-base.cc b/bin/dchroot/dchroot-main-base.cc
index f11f9530..8f09f2aa 100644
--- a/bin/dchroot/dchroot-main-base.cc
+++ b/bin/dchroot/dchroot-main-base.cc
@@ -52,20 +52,6 @@ main_base::~main_base ()
}
void
-main_base::action_config ()
-{
- std::cout << "# "
- // TRANSLATORS: %1% = program name
- // TRANSLATORS: %2% = program version
- // TRANSLATORS: %3% = current date
- << format(_("schroot configuration generated by %1% %2% on %3%"))
- % this->program_name % VERSION % sbuild::date(time(0))
- << endl;
- std::cout << endl;
- this->config->print_chroot_config(this->chroots, std::cout);
-}
-
-void
main_base::action_list ()
{
this->config->print_chroot_list_simple(std::cout);
diff --git a/bin/dchroot/dchroot-main-base.h b/bin/dchroot/dchroot-main-base.h
index b9e87d62..399811dd 100644
--- a/bin/dchroot/dchroot-main-base.h
+++ b/bin/dchroot/dchroot-main-base.h
@@ -47,9 +47,6 @@ namespace dchroot
protected:
virtual void
- action_config ();
-
- virtual void
action_list ();
};
diff --git a/bin/dchroot/dchroot-main.cc b/bin/dchroot/dchroot-main.cc
index a5103224..3206eb54 100644
--- a/bin/dchroot/dchroot-main.cc
+++ b/bin/dchroot/dchroot-main.cc
@@ -52,14 +52,6 @@ main::~main ()
}
void
-main::action_location ()
-{
- sbuild::string_list chroot;
- chroot.push_back(this->options->chroot_path);
- this->config->print_chroot_location(chroot, std::cout);
-}
-
-void
main::create_session (sbuild::session::operation sess_op)
{
sbuild::log_debug(sbuild::DEBUG_INFO) << "Creating dchroot session" << endl;
diff --git a/bin/dchroot/dchroot-main.h b/bin/dchroot/dchroot-main.h
index 8c85168d..99972c65 100644
--- a/bin/dchroot/dchroot-main.h
+++ b/bin/dchroot/dchroot-main.h
@@ -45,9 +45,6 @@ namespace dchroot
protected:
virtual void
- action_location ();
-
- virtual void
create_session (sbuild::session::operation sess_op);
};
diff --git a/bin/dchroot/dchroot-options.cc b/bin/dchroot/dchroot-options.cc
index 7d6ddedb..ec3ae5d8 100644
--- a/bin/dchroot/dchroot-options.cc
+++ b/bin/dchroot/dchroot-options.cc
@@ -69,7 +69,11 @@ options::check_options ()
schroot::options_base::check_options();
if (vm.count("path"))
- this->action = ACTION_LOCATION;
+ {
+ this->action = ACTION_LOCATION;
+ this->chroots.clear();
+ this->chroots.push_back(this->chroot_path);
+ }
if (vm.count("all"))
{