/usr/share/perl5/DebAux/Debconf.pm is in debaux-debconf 0.1.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | # Debconf.pm - utility functions for DebAux scripts
# Copyright (C) 2002,2007 Stefan Hornburg (Racke) <racke@linuxia.de>
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
# This file is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this file; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
package DebAux::Debconf;
use strict;
use Debconf::Client::ConfModule;
=head1 NAME
DebAux::Debconf - easy interface to Debconf::Client::ConfModule
=head1 SYNOPSIS
use DebAux::Debconf;
DebAux::Debconf::get('package/name');
DebAux::Debconf::set('package/name','value');
DebAux::Debconf::ask('medium','package/name');
=head1 DESCRIPTION
This module provides an easy interface to Debconf::Client::Module
which does the error handling for you.
=head1 FUNCTIONS
=over 4
=item get I<name>
Get the value for I<name>. Dies on any error.
=back
=cut
sub get {
my ($name) = @_;
my ($status, $value) = Debconf::Client::ConfModule::get($name);
if ($status) {
die ("Couldn't get debconf value for $name (Status: $status)\n");
}
$value;
}
=over 4
=item set I<name> I<value>
Set the value for I<name>. Dies on any error.
=back
=cut
sub set {
my ($name, $value) = @_;
my $status = Debconf::Client::ConfModule::set($name, $value);
if ($status ne 'value set') {
die ("Couldn't set debconf value $value for $name (Status: $status)\n");
}
$value;
}
=over 4
=item ask I<priority> I<name>
Asks for the value for I<name> with the priority I<priority>.
Combines the debconf commands INPUT and GO.
Dies on any error.
=back
=cut
sub ask {
my ($priority, $name) = @_;
my ($status, $value);
($status, $value) = Debconf::Client::ConfModule::input($priority, $name);
if ($status && $status != 30) {
die "Configuration of $name failed with status $status ($value)\n";
}
Debconf::Client::ConfModule::go();
}
1;
|