view debian/postinst @ 23510:a6c619ee9d30

Teletext support for tv:// (v4l and v4l2 only) modified patch from Otvos Attila oattila at chello dot hu Module uses zvbi library for all low-level VBI operations (like I/O with vbi device, converting vbi pages into usefull vbi_page stuctures, rendering them into RGB32 images). All teletext related stuff (except properties, slave commands and rendering osd in text mode or RGB32 rendered teletext pages in spu mode) is implemented in tvi_vbi.c New properties: teletext_page - switching between pages teletext_mode - switch between on/off/opaque/transparent modes teletext_format - (currently read-only) allows to get format info (black/white,gray,text) teletext_half_page - trivial zooming (displaying top/bottom half of teletext page) New slave commands: teletext_add_dec - user interface for jumping to any page by editing page number interactively teletext_go_link - goes though links, specified on current page
author voroshil
date Sun, 10 Jun 2007 00:06:12 +0000
parents a5bef61f49bf
children
line wrap: on
line source

#!/usr/bin/perl -w

# mplayer postinst

require ConfHelper;

use Debconf::Client::ConfModule qw(:all);
use IO::Handle;
use Fcntl;
my $version = version(2.0);
my $didupgrade = 0;

dealwithupgrades();

my $mcfg = new ConfHelper('mplayer', "/etc/mplayer/mplayer.conf");



my $dcarea = "" ;
my $font =  scalar(get("mplayer/ttfont"))  ;
  $dcarea .= "#truetype font\nfont=" . $font . "\n"   if $font;
$mcfg->setconfarea($dcarea);



sub dealwithupgrades {
  open(OLDCONF, "</etc/mplayer/mplayer.conf") || return 1;
  close OLDCONF;

  my $mconf = new ConfHelper("mplayer", "/etc/mplayer/mplayer.conf");
  return 1 if ($mconf->hasconfarea());
  undef $mconf;

  if ((get('mplayer/replace-existing-files') eq 'true') &&
      (fget('mplayer/replace-existing-files', 'isdefault') eq 'false')) {
    $didupgrade = 1;
    for my $file ("/etc/mplayer/mplayer.conf"    ) {
      debug("Moving away $file");
      rename($file,$file . ".old");
    }
  } else {
    debug("Upgrade refused, exiting");
    exit 0;
  }
}

sub debug {
  print STDERR @_, "\n";
}


# pass control to debhelper scripts..
#
my $temp="set -e\nset -- @ARGV\n" . << 'DEBHELPER_EOF_';
#DEBHELPER#
DEBHELPER_EOF_
system ($temp) / 256 == 0
   or die "Problem with debhelper scripts: $!";