annotate debian/config @ 1433:d2c90f272101

Win32 portability.
author atmos4
date Thu, 02 Aug 2001 07:09:41 +0000
parents 10e236ceac5e
children 0737156ad1f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1398
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
1 #!/usr/bin/perl -w
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
2
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
3 # Script to configure mplayer
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
4 # based on etherconf by John Goerzen <jgoerzen@progenylinux.com>
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
5
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
6 use Debian::DebConf::Client::ConfModule qw(:all);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
7
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
8 my $version = version(2.0);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
9 title('MPlayer Configuration');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
10 my $PRIORITY = 'high';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
11 #TODO: 'medium'
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
12 my $next = 'mainmenu';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
13 my $isediting = 0;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
14
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
15 my @nextargs = ();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
16
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
17 checkupgrade(); # Find out if we have to upgrade.
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
18 mainloop(letsgo());
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
19
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
20 sub checkupgrade {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
21 open(MCFG, "</etc/mplayer.conf") || return 1;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
22 my $line = <MCFG>;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
23 return 1 if ($line =~ /mplayer DEBCONF AREA/);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
24 exit(0) if (input($PRIORITY, 'mplayer/replace-existing-files') eq "question skipped");
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
25 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
26 if (get('mplayer/replace-existing-files') eq 'false') {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
27 input($PRIORITY, 'mplayer/replace-existing-files-bail');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
28 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
29 exit();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
30 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
31 close MCFG;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
32 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
33
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
34 sub mainloop {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
35 $next = shift @_;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
36 do {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
37 my @retval = &$next(@nextargs);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
38 # if ($retval[0] eq 'BACK') {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
39 # $retval[0] = $backups{$next};
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
40 # }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
41 ($next, @nextargs) = @retval;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
42 } while ($next ne 'Exit');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
43 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
44
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
45 sub letsgo {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
46 #useless!
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
47 return "configure";
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
48 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
49
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
50 sub configure {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
51 subst("mplayer/voutput", "vochoices", "xv, xmga, mga, x11, gl, sdl");
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
52 # db_subst mplayer/output vo xc,xmga,mga,x11,gl,sdl
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
53 exit(0) if (input($PRIORITY, "mplayer/voutput") eq "question skipped");
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
54 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
55 exit 0 unless (get("mplayer/voutput") eq 'true');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
56 #return 'audioout';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
57 return 'mainmenu';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
58 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
59
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
60 sub mainmenu {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
61 go(); # To catch spare things from before
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
62 my @choices = (
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
63 'Video Output: ' . scalar(get("mplayer/voutput")));
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
64 #,
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
65 $choices = join(', ', @choices);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
66 $isediting = 1;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
67
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
68 subst('mplayer/mainmenu', 'choices', $choices);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
69 input($PRIORITY, 'mplayer/mainmenu');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
70 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
71
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
72 my $selection = get('mplayer/mainmenu');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
73 if ($selection =~ /^Exit/) {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
74 return 'Exit';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
75 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
76
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
77 # Set to redisplay.
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
78 fset('mplayer/mainmenu', 'isdefault', 'true');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
79
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
80 $_ = $selection;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
81
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
82 return 'configure' if /^Video/;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
83 # return 'aoutput' if /^Aoutput/;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
84 return 'Exit';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
85 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
86
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
87 sub editreturn {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
88 my @args = @_;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
89 return 'mainmenu' if $isediting;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
90 return @args;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
91 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
92
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
93 sub editfix {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
94 my $template = shift @_;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
95 if ($isediting) {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
96 fset($template, 'isdefault', 'true');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
97 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
98 }