Mercurial > mplayer.hg
annotate debian/postinst @ 23960:0525bd0aed18
r23897: Experimental negative panscan values
r23898: Set -vo gl slice-height default to 0, the current default of 4 seems
r23913: punctuation, new sentences on new lines
r23917: Document -rawvideo format="format string"
r23924: Teletext support
r23926: update man page with v4l2 a/v outputs
r23944: h/w -> hardware
r23962: added missing ':' for separator
r23978: add possibly incorrect subfont entry
author | voroshil |
---|---|
date | Wed, 01 Aug 2007 01:15:26 +0000 |
parents | a5bef61f49bf |
children |
rev | line source |
---|---|
1398 | 1 #!/usr/bin/perl -w |
2 | |
3 # mplayer postinst | |
4 | |
5 require ConfHelper; | |
6 | |
4521
0737156ad1f0
Juergen Kreileder changes, fixing some lintian errors, adding correct manpath and adding
eyck
parents:
1691
diff
changeset
|
7 use Debconf::Client::ConfModule qw(:all); |
1398 | 8 use IO::Handle; |
9 use Fcntl; | |
17346
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
10 my $version = version(2.0); |
1398 | 11 my $didupgrade = 0; |
12 | |
13 dealwithupgrades(); | |
14 | |
7096
6746866a94c6
Use the confdir we compiled with (/etc/mplayer/mplayer.conf instead of
diego
parents:
4521
diff
changeset
|
15 my $mcfg = new ConfHelper('mplayer', "/etc/mplayer/mplayer.conf"); |
1398 | 16 |
17 | |
18 | |
17346
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
19 my $dcarea = "" ; |
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
20 my $font = scalar(get("mplayer/ttfont")) ; |
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
21 $dcarea .= "#truetype font\nfont=" . $font . "\n" if $font; |
1398 | 22 $mcfg->setconfarea($dcarea); |
23 | |
24 | |
25 | |
26 sub dealwithupgrades { | |
7096
6746866a94c6
Use the confdir we compiled with (/etc/mplayer/mplayer.conf instead of
diego
parents:
4521
diff
changeset
|
27 open(OLDCONF, "</etc/mplayer/mplayer.conf") || return 1; |
1398 | 28 close OLDCONF; |
29 | |
7096
6746866a94c6
Use the confdir we compiled with (/etc/mplayer/mplayer.conf instead of
diego
parents:
4521
diff
changeset
|
30 my $mconf = new ConfHelper("mplayer", "/etc/mplayer/mplayer.conf"); |
1398 | 31 return 1 if ($mconf->hasconfarea()); |
32 undef $mconf; | |
33 | |
34 if ((get('mplayer/replace-existing-files') eq 'true') && | |
35 (fget('mplayer/replace-existing-files', 'isdefault') eq 'false')) { | |
36 $didupgrade = 1; | |
17346
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
37 for my $file ("/etc/mplayer/mplayer.conf" ) { |
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
38 debug("Moving away $file"); |
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
39 rename($file,$file . ".old"); |
1398 | 40 } |
41 } else { | |
17346
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
42 debug("Upgrade refused, exiting"); |
1398 | 43 exit 0; |
44 } | |
45 } | |
46 | |
47 sub debug { | |
48 print STDERR @_, "\n"; | |
49 } | |
8909 | 50 |
51 | |
52 # pass control to debhelper scripts.. | |
53 # | |
17346
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
54 my $temp="set -e\nset -- @ARGV\n" . << 'DEBHELPER_EOF_'; |
8909 | 55 #DEBHELPER# |
17346
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
56 DEBHELPER_EOF_ |
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
57 system ($temp) / 256 == 0 |
a5bef61f49bf
Improve the Debian package configuration: Remove the vo module configuration,
diego
parents:
17323
diff
changeset
|
58 or die "Problem with debhelper scripts: $!"; |