2
# changes the dpkg status of a package in a chroot to "hold"
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
#######################################################################
24
use Sbuild::Utility qw(setup cleanup shutdown);
29
print STDERR "Usage: $0 <chroot> package [package ...]\n";
33
usage() if (@ARGV < 2);
35
my $chroot = Sbuild::Utility::get_dist($ARGV[0]);
37
!setup($ARGV[0]) or die "Chroot setup failed for $chroot chroot";
39
print STDOUT "Holding packages in $chroot chroot:";
41
my $command = get_command("$Sbuild::Conf::dpkg --set-selections", "root", 1);
42
if (!open(SELECTIONS, "| $command")) {
43
print STDERR "Can't run dpkg --set-selections in chroot\n";
49
print SELECTIONS "$_ hold\n";
53
if (!close SELECTIONS) {
54
print STDERR "Can't run dpkg --set-selections in chroot\n";
60
my $packages = join(" ", @ARGV);
61
my $status = run_command("$Sbuild::Conf::dpkg --list $packages", "root", 1, 0);