annotate debian-build/config @ 10740:0b5748047607

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