7 use Debconf
::Client
::ConfModule
qw(:all);
10 my $version = version
(2.0);
15 my $mcfg = new ConfHelper
('mplayer', "/etc/mplayer/mplayer.conf");
20 my $font = scalar(get
("mplayer/ttfont")) ;
21 $dcarea .= "#truetype font\nfont=" . $font . "\n" if $font;
22 $mcfg->setconfarea($dcarea);
26 sub dealwithupgrades
{
27 open(OLDCONF
, "</etc/mplayer/mplayer.conf") || return 1;
30 my $mconf = new ConfHelper
("mplayer", "/etc/mplayer/mplayer.conf");
31 return 1 if ($mconf->hasconfarea());
34 if ((get
('mplayer/replace-existing-files') eq 'true') &&
35 (fget
('mplayer/replace-existing-files', 'isdefault') eq 'false')) {
37 for my $file ("/etc/mplayer/mplayer.conf" ) {
38 debug
("Moving away $file");
39 rename($file,$file . ".old");
42 debug
("Upgrade refused, exiting");
48 print STDERR
@_, "\n";
52 # pass control to debhelper scripts..
54 my $temp="set -e\nset -- @ARGV\n" . << 'DEBHELPER_EOF_';
57 system ($temp) / 256 == 0
58 or die "Problem with debhelper scripts: $!";