annotate debian/config @ 7476:059746b0ecae

Fix nick of sbmpost
author lgb
date Sun, 22 Sep 2002 13:14:56 +0000
parents 6746866a94c6
children a5bef61f49bf
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
4521
0737156ad1f0 Juergen Kreileder changes, fixing some lintian errors, adding correct manpath and adding
eyck
parents: 1398
diff changeset
6 use Debconf::Client::ConfModule qw(:all);
0737156ad1f0 Juergen Kreileder changes, fixing some lintian errors, adding correct manpath and adding
eyck
parents: 1398
diff changeset
7
1398
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
8
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
9 my $version = version(2.0);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
10 title('MPlayer Configuration');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
11 my $PRIORITY = 'high';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
12 #TODO: 'medium'
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
13 my $next = 'mainmenu';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
14 my $isediting = 0;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
15
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
16 my @nextargs = ();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
17
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
18 checkupgrade(); # Find out if we have to upgrade.
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
19 mainloop(letsgo());
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
20
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
21 sub checkupgrade {
7096
6746866a94c6 Use the confdir we compiled with (/etc/mplayer/mplayer.conf instead of
diego
parents: 4521
diff changeset
22 open(MCFG, "</etc/mplayer/mplayer.conf") || return 1;
1398
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
23 my $line = <MCFG>;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
24 return 1 if ($line =~ /mplayer DEBCONF AREA/);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
25 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
26 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
27 if (get('mplayer/replace-existing-files') eq 'false') {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
28 input($PRIORITY, 'mplayer/replace-existing-files-bail');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
29 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
30 exit();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
31 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
32 close MCFG;
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
35 sub mainloop {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
36 $next = shift @_;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
37 do {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
38 my @retval = &$next(@nextargs);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
39 # if ($retval[0] eq 'BACK') {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
40 # $retval[0] = $backups{$next};
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
41 # }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
42 ($next, @nextargs) = @retval;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
43 } while ($next ne 'Exit');
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
46 sub letsgo {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
47 #useless!
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
48 return "configure";
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
51 sub configure {
4521
0737156ad1f0 Juergen Kreileder changes, fixing some lintian errors, adding correct manpath and adding
eyck
parents: 1398
diff changeset
52 subst("mplayer/voutput", "vochoices", "xv, xmga, mga, x11, gl, sdl, xvidix");
1398
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
53 # db_subst mplayer/output vo xc,xmga,mga,x11,gl,sdl
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
54 exit(0) if (input($PRIORITY, "mplayer/voutput") eq "question skipped");
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
55 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
56 exit 0 unless (get("mplayer/voutput") eq 'true');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
57 #return 'audioout';
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
58 return 'mainmenu';
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
61 sub mainmenu {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
62 go(); # To catch spare things from before
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
63 my @choices = (
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
64 'Video Output: ' . scalar(get("mplayer/voutput")));
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
65 #,
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
66 $choices = join(', ', @choices);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
67 $isediting = 1;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
68
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
69 subst('mplayer/mainmenu', 'choices', $choices);
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
70 input($PRIORITY, 'mplayer/mainmenu');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
71 go();
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
72
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
73 my $selection = get('mplayer/mainmenu');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
74 if ($selection =~ /^Exit/) {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
75 return 'Exit';
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
78 # Set to redisplay.
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
79 fset('mplayer/mainmenu', 'isdefault', 'true');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
80
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
81 $_ = $selection;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
82
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
83 return 'configure' if /^Video/;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
84 # return 'aoutput' if /^Aoutput/;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
85 return 'Exit';
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
88 sub editreturn {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
89 my @args = @_;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
90 return 'mainmenu' if $isediting;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
91 return @args;
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
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
94 sub editfix {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
95 my $template = shift @_;
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
96 if ($isediting) {
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
97 fset($template, 'isdefault', 'true');
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
98 }
10e236ceac5e update to perl debconf. fixed problem with configure.
eyck
parents:
diff changeset
99 }