Mercurial > mplayer.hg
annotate debian/postinst @ 20194:10cebc4e94ae
code simplification and minor bug fix for files restarting rather than moving to the next file within the playlist.
author | vayne |
---|---|
date | Fri, 13 Oct 2006 17:30:41 +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: $!"; |