config is in kumofs 0.4.13-6.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
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 | #!/usr/bin/perl -w
#
# script to configure kumofs debian package
use Debconf::Client::ConfModule qw(:all);
# constants
my $DEFAULT_FILE = '/etc/default/kumofs';
my $STR_BEGIN = '###DO_NOT_EDIT_BELOW_THIS_LINE_DEBCONF###';
my $STR_END = '###DO_NOT_EDIT_ABOVE_THIS_LINE_DEBCONF###';
# initialize
my $version = version(2.0);
capb("backup");
title("kumofs configuration");
# variables
my $str = '';
# select what components the user want to run
SELECT_COMPONENTS: input('high', 'kumofs/select_components');
if ( (go)[0] == 30 ) {
exit 0;
}
my $components = get('kumofs/select_components');
# prepare option string for selected components
foreach my $com (qw(manager server gateway)) {
next if ($components !~ /\bkumo-$com\b/);
input('high', "kumofs/${com}_options");
if ( (go)[0] == 30 ) {
goto SELECT_COMPONENTS;
}
my $args = get("kumofs/${com}_options");
my $com_uc = uc($com);
$str = <<_EOT;
$str
RUN_KUMO_$com_uc="yes"
KUMO_${com_uc}_ARGS="$args"
_EOT
}
# prepare substitute string
$str = <<_EOT;
$STR_BEGIN
# Run "dpkg-reconfigure kumofs" when you'd like to edit them.
$str
$STR_END
_EOT
# write substitute string to default file
if (! -f $DEFAULT_FILE || -s $DEFAULT_FILE == 0) {
open(my $fh, '>', $DEFAULT_FILE) or die "could not open $DEFAULT_FILE: $!";
print $fh $str;
close($fh);
} else {
my $config = undef;
{
local $/ = undef;
open(my $fh, $DEFAULT_FILE) or die "could not open $DEFAULT_FILE: $!";
$config = <$fh>;
close($fh);
}
$config =~ s/^$STR_BEGIN\n.*^$STR_END\n/$str/sm;
open(my $fh, '>', $DEFAULT_FILE) or die "could not open $DEFAULT_FILE: $!";
print $fh $config;
close($fh);
}
exit 0;
# vim: ts=4 sw=4 et ft=perl:
|