comparison debian-build/config @ 9364:33f43b0f24f7

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