=================================================================== RCS file: /cvs/trango/Net-Telnet-Trango/Build.PL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- trango/Net-Telnet-Trango/Build.PL 2007/02/05 21:36:42 1.4 +++ trango/Net-Telnet-Trango/Build.PL 2007/02/05 23:10:37 1.5 @@ -2,7 +2,7 @@ use warnings; use Module::Build; use File::Spec; -# $RedRiver: Build.PL,v 1.3 2007/02/05 19:39:33 andrew Exp $ +# $RedRiver: Build.PL,v 1.4 2007/02/05 21:36:42 andrew Exp $ my $cfg_file = File::Spec->catfile('t', 'tests.cfg'); @@ -38,32 +38,68 @@ }, ); -my %cfg; -get_ap_config(\%cfg); +get_config(); -if (%cfg && open T,">$cfg_file") { - while (my ($key, $value) = each %cfg) { - print T $key, "\t", $value,"\n"; +$builder->create_build_script(); + +sub get_config { + my %cfg; + print <$cfg_file") { + while (my ($key, $value) = each %cfg) { + print T $key, "\t", $value,"\n"; + } + close T; } - close T; + } -$builder->create_build_script(); +sub get_ap_config { + my $cfg = shift; -sub get_ap_config -{ + print 'To run the AP tests, we need an IP and a password for an AP.', "\n"; + + $cfg->{AP} = $builder->prompt("AP IP: ", $cfg->{AP}) || return; + $cfg->{AP_PASSWD} = $builder->prompt("AP Password:", $cfg->{AP_PASSWD}) + || return; +} + +sub get_sudb_config { my $cfg = shift; - print <{SU_ID} = $builder->prompt("SU ID: ", $cfg->{SU_ID}) || return; + $cfg->{SU_MAC} = $builder->prompt("SU MAC:", $cfg->{SU_MAC}) || return; +} -To skip these tests, hit "return". +sub get_su_config { + my $cfg = shift; -EOB + print 'To run the SU tests, we need an IP and a password of an SU.', "\n"; - $cfg->{AP} = $builder->prompt("AP: ", $cfg->{AP}) || return; - $cfg->{AP_PASSWD} = $builder->prompt("Password:", $cfg->{AP_PASSWD}) || return; + $cfg->{SU} = $builder->prompt("SU IP: ", $cfg->{SU}) || return; + $cfg->{SU_PASSWD} = $builder->prompt("SU Password:", $cfg->{SU_PASSWD}) + || return; } +