3
# Run a shell in a chroot.
4
# Copyright © 2006 Roger Leigh <rleigh@debian.org>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 2 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see
18
# <http://www.gnu.org/licenses/>.
20
#######################################################################
26
use Sbuild qw(help_text version_text usage_error);
27
use Sbuild::Utility qw(setup cleanup);
32
"h|help" => sub { help_text("1", "sbuild-shell"); },
33
"V|version" => sub {version_text("sbuild-shell"); })
34
or usage_error("sbuild-shell", "Error parsing command-line options");
36
usage_error("sbuild-shell", "Incorrect number of options") if (@ARGV != 1);
39
my $session = setup($ARGV[0]) or die "Chroot setup failed";
41
my $status = $session->run_command("/bin/sh", $Sbuild::Conf::username, 1);