~ubuntu-branches/debian/squeeze/sbuild/squeeze

« back to all changes in this revision

Viewing changes to bin/sbuild-shell

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh
  • Date: 2008-08-18 11:15:05 UTC
  • mfrom: (0.1.1 upstream) (3.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080818111505-5j8x6j4d4krxbjdv
Tags: 0.57.7-1
* New release.
* sbuild-checkpackages handles --list and --set options correctly
  (Closes: #495490).
* sbuild-createchroot: Correctly parse --arch option (Closes: #495517).
  Thanks to Cyril Brulebois for this patch.
* sbuild-setup.7.in: Change permissions of /build to 02775
  (Closes: #494076).  Thanks to Lucas Nussbaum for finding this missing
  step.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
#
 
3
# Run a shell in a chroot.
 
4
# Copyright © 2006 Roger Leigh <rleigh@debian.org>
 
5
#
 
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.
 
10
#
 
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.
 
15
#
 
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/>.
 
19
#
 
20
#######################################################################
 
21
 
 
22
use strict;
 
23
use warnings;
 
24
 
 
25
use Getopt::Long;
 
26
use Sbuild qw(help_text version_text usage_error);
 
27
use Sbuild::Utility qw(setup cleanup);
 
28
 
 
29
package main;
 
30
 
 
31
GetOptions (
 
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");
 
35
 
 
36
usage_error("sbuild-shell", "Incorrect number of options") if (@ARGV != 1);
 
37
 
 
38
 
 
39
my $session = setup($ARGV[0]) or die "Chroot setup failed";
 
40
 
 
41
my $status = $session->run_command("/bin/sh", $Sbuild::Conf::username, 1);
 
42
 
 
43
cleanup();
 
44
 
 
45
exit $status;