[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/misc Install.pm,1.19,1.20
From: |
Ambrose Li |
Subject: |
[Koha-cvs] CVS: koha/misc Install.pm,1.19,1.20 |
Date: |
Sat, 25 Jan 2003 09:20:52 -0800 |
Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv15557/misc
Modified Files:
Install.pm
Log Message:
The SWTICH: label is unused; converted it into an if-elsif-else structure
Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** Install.pm 25 Jan 2003 17:10:46 -0000 1.19
--- Install.pm 25 Jan 2003 17:20:50 -0000 1.20
***************
*** 511,575 ****
}
print $message;
! SWITCH: {
! if ($responsetype =~/^restrictchar (.*)/i) {
! my $response='\0';
! my $options=$1;
! until ($options=~/$response/) {
! ($defaultresponse) || ($defaultresponse=substr($options,0,1));
! $response=<STDIN>;
! chomp $response;
! (length($response)) || ($response=$defaultresponse);
! unless ($options=~/$response/) {
! ($noclear) || (system('clear'));
! print "Invalid Response. Choose from [$options].\n\n";
! print $message;
! }
}
- return $response;
}
! if ($responsetype =~/^free$/i) {
! (defined($defaultresponse)) || ($defaultresponse='');
! my $response=<STDIN>;
chomp $response;
($response) || ($response=$defaultresponse);
! return $response;
! }
! if ($responsetype =~/^numerical$/i) {
! (defined($defaultresponse)) || ($defaultresponse='');
! my $response='';
! until ($response=~/^\d+$/) {
! $response=<STDIN>;
! chomp $response;
! ($response) || ($response=$defaultresponse);
! unless ($response=~/^\d+$/) {
! ($noclear) || (system('clear'));
! print "Invalid Response ($response). Response must be a
number.\n\n";
! print $message;
! }
}
- return $response;
}
! if ($responsetype =~/^email$/i) {
! (defined($defaultresponse)) || ($defaultresponse='');
! my $response='';
! until ($response=~/address@hidden/) {
! $response=<STDIN>;
! chomp $response;
! ($response) || ($response=$defaultresponse);
! unless ($response=~/address@hidden/) {
! ($noclear) || (system('clear'));
! print "Invalid Response ($response). Response must be a
valid email address.\n\n";
! print $message;
! }
}
- return $response;
- }
- if ($responsetype =~/^PressEnter$/i) {
- <STDIN>;
- return;
- }
- if ($responsetype =~/^none$/i) {
- return;
}
}
}
--- 511,573 ----
}
print $message;
! if ($responsetype =~/^restrictchar (.*)/i) {
! my $response='\0';
! my $options=$1;
! until ($options=~/$response/) {
! ($defaultresponse) || ($defaultresponse=substr($options,0,1));
! $response=<STDIN>;
! chomp $response;
! (length($response)) || ($response=$defaultresponse);
! unless ($options=~/$response/) {
! ($noclear) || (system('clear'));
! print "Invalid Response. Choose from [$options].\n\n";
! print $message;
}
}
! return $response;
! } elsif ($responsetype =~/^free$/i) {
! (defined($defaultresponse)) || ($defaultresponse='');
! my $response=<STDIN>;
! chomp $response;
! ($response) || ($response=$defaultresponse);
! return $response;
! } elsif ($responsetype =~/^numerical$/i) {
! (defined($defaultresponse)) || ($defaultresponse='');
! my $response='';
! until ($response=~/^\d+$/) {
! $response=<STDIN>;
chomp $response;
($response) || ($response=$defaultresponse);
! unless ($response=~/^\d+$/) {
! ($noclear) || (system('clear'));
! print "Invalid Response ($response). Response must be a
number.\n\n";
! print $message;
}
}
! return $response;
! } elsif ($responsetype =~/^email$/i) {
! (defined($defaultresponse)) || ($defaultresponse='');
! my $response='';
! until ($response=~/address@hidden/) {
! $response=<STDIN>;
! chomp $response;
! ($response) || ($response=$defaultresponse);
! unless ($response=~/address@hidden/) {
! ($noclear) || (system('clear'));
! print "Invalid Response ($response). Response must be a valid
email address.\n\n";
! print $message;
}
}
+ return $response;
+ } elsif ($responsetype =~/^PressEnter$/i) {
+ <STDIN>;
+ return;
+ } elsif ($responsetype =~/^none$/i) {
+ return;
+ } else {
+ # FIXME: There are a few places where we will get an undef as the
+ # response type. Should we thrown an exception here, or should we
+ # legitimize this usage and say "none" is the default if not specified?
+ #die "Illegal response type \"$responsetype\"";
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/misc Install.pm,1.19,1.20,
Ambrose Li <=