No subject


Thu Jul 12 09:23:04 CDT 2007


Modified:
    branches/1.2/xpp/init_card_2_30

Modified: branches/1.2/xpp/init_card_2_30
URL: http://svn.digium.com/view/zaptel/branches/1.2/xpp/init_card_2_30?view=diff&rev=4517&r1=4516&r2=4517
==============================================================================
--- branches/1.2/xpp/init_card_2_30 (original)
+++ branches/1.2/xpp/init_card_2_30 Tue Sep  9 07:40:30 2008
@@ -127,9 +127,9 @@
 CANADA         	reg16=00	reg26=C0	reg30=00	reg31=20		
 CHILE          	reg16=00	reg26=C0	reg30=00	reg31=20		
 CHINA          	reg16=00	reg26=30	reg30=0F	reg31=20		
-COLUMBIA       	reg16=00	reg26=C0	reg30=00	reg31=20		
+COLOMBIA       	reg16=00	reg26=C0	reg30=00	reg31=20		
 CROATIA        	reg16=00	reg26=C2	reg30=02	reg31=20		
-CYRPUS         	reg16=00	reg26=C2	reg30=02	reg31=20		
+CYPRUS         	reg16=00	reg26=C2	reg30=02	reg31=20		
 CZECH          	reg16=00	reg26=C2	reg30=02	reg31=20		
 DENMARK        	reg16=00	reg26=C2	reg30=02	reg31=28		
 ECUADOR        	reg16=00	reg26=C0	reg30=00	reg31=20		
@@ -263,6 +263,8 @@
 sub opermode_verify($) {
 	my $input = shift or die;
 	my %verification_table;
+	my %location_lines;
+	my $status = 0;
 
 	open(F, $input) or die "$0: Failed opening '$input': $!\n";
 	while(<F>) {
@@ -275,22 +277,25 @@
 			my ($key, $val) = split(/=/, $p, 2);
 			$verification_table{$location}{$key} = $val;
 		}
+		$location_lines{$location} = $.;
 	}
 	close F;
 	# First test: check for missing data in our program
 	foreach my $location (sort keys %verification_table) {
 		my $mode = $opermode_table{$location};
 		if(! defined $mode) {
-			printf STDERR  "Missing $location\n";
+			printf STDERR  "Missing $location at $input:$location_lines{$location}\n";
+			$status = 1;
 			next;
 		}
 		my $verify_mode = $verification_table{$location};
 		my $str1 = opermode_to_string($mode);
 		my $str2 = opermode_to_string($verify_mode);
 		if($str1 ne $str2) {
-			print STDERR  "DIFF: $location:\n";
+			print STDERR  "DIFF: $location at $input:$location_lines{$location}\n";
 			printf STDERR  "\t%-20s: %s\n", "program", $str1;
 			printf STDERR  "\t%-20s: %s\n", "verify", $str2;
+			$status = 1;
 		}
 	}
 	# Second test: check for extra data in our program
@@ -298,9 +303,11 @@
 		my $mode = $verification_table{$location};
 		if(! defined $mode) {
 			printf STDERR  "Extra $location\n";
+			$status = 1;
 			next;
 		}
 	}
+	return $status;
 }
 
 sub read_defaults() {
@@ -335,8 +342,7 @@
 	my $verify_file = $1;
 	die "Usage: $0 verify=filename\n" unless $verify_file =~ s/^=//;
 	main::debug "$0: opermode verification (input='$verify_file')";
-	FXO::opermode_verify($verify_file);
-	exit 0;
+	exit FXO::opermode_verify($verify_file);
 }
 
 main::logit "Starting";




More information about the zaptel-commits mailing list