~ubuntu-branches/ubuntu/karmic/sbuild/karmic-proposed

« back to all changes in this revision

Viewing changes to bin/sbuild-hold

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh, Roger Leigh
  • Date: 2009-05-19 22:16:46 UTC
  • mfrom: (8.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090519221646-iyxt2sohtaxtwgjr
Tags: 0.58.4-1
[ Roger Leigh ]
* New release. 
* sbuild:
  - A $purge_build_deps configuration option, and --purge-deps
    command-line option have been added to control build-dependency
    removal (Closes: #528312).
  - Use the isin function from the Sbuild module (Closes: #529470).
    Thanks to Gustavo Noronha Silva for spotting this.
* Sbuild:
  - Use Filesys::Df (libfilesys-df-perl) in place of invoking /bin/df
    and parsing its output.  This is more robust and efficient, and
    works whatever the user environment (Closes: #509133).

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
use Getopt::Long;
26
26
use Sbuild qw(help_text version_text usage_error);
27
27
use Sbuild::Utility qw(setup cleanup shutdown);
 
28
use Sbuild::ChrootSetup qw(list_packages set_package_status);
28
29
use Sbuild::Conf;
29
30
use Sbuild::OptionsBase;
30
31
 
41
42
my $session = setup($ARGV[0], $conf) or die "Chroot setup failed for $chroot chroot";
42
43
 
43
44
print STDOUT "Holding packages in $chroot chroot:";
44
 
 
45
 
my $pipe = $session->pipe_command(
46
 
    {COMMAND => [$conf->get('DPKG'), '--set-selections'],
47
 
     PIPE => 'out',
48
 
     USER => 'root',
49
 
     CHROOT => 1,
50
 
     PRIORITY => 0});
51
 
 
52
 
if (!$pipe) {
53
 
    print STDERR "Can't run dpkg --set-selections in chroot\n";
54
 
    shutdown("TERM");
55
 
}
56
 
 
57
45
shift @ARGV;
58
46
foreach (@ARGV) {
59
 
    print $pipe "$_        hold\n";
60
47
    print STDOUT " $_";
61
48
}
62
 
 
63
 
if (!close $pipe) {
64
 
    print STDERR "Can't run dpkg --set-selections in chroot\n";
65
 
    shutdown("TERM");
66
 
}
67
 
 
68
49
print STDOUT ".\n\n";
69
50
 
70
 
$session->run_command(
71
 
    {COMMAND => [$conf->get('DPKG'), '--list', @ARGV],
72
 
     USER => 'root',
73
 
     CHROOT => 1,
74
 
     PRIORITY => 0});
75
 
my $status = $? >> 8;
 
51
my $status = set_package_status($session, $conf, "hold", @ARGV);
 
52
$status >>= 8;
 
53
 
 
54
list_packages($session, $conf, @ARGV);
76
55
 
77
56
cleanup($conf);
78
57