26
26
my $major_version ;
27
27
my $include_path ;
28
28
29
+ my $num_errors = 0;
30
+
29
31
GetOptions(
30
32
' output:s' => \$output_path ,
31
33
' set-version:s' => \$major_version ,
796
798
Catalog::RenameTempFile($fk_info_file , $tmpext );
797
799
Catalog::RenameTempFile($constraints_file , $tmpext );
798
800
799
- exit 0 ;
801
+ exit ( $num_errors != 0 ? 1 : 0) ;
800
802
801
803
# ################### Subroutines ########################
802
804
@@ -1024,8 +1026,7 @@ sub morph_row_for_schemapg
1024
1026
# Perform OID lookups on an array of OID names.
1025
1027
# If we don't have a unique value to substitute, warn and
1026
1028
# leave the entry unchanged.
1027
- # (A warning seems sufficient because the bootstrap backend will reject
1028
- # non-numeric values anyway. So we might as well detect multiple problems
1029
+ # (We don't exit right away so that we can detect multiple problems
1029
1030
# within this genbki.pl run.)
1030
1031
sub lookup_oids
1031
1032
{
@@ -1045,16 +1046,20 @@ sub lookup_oids
1045
1046
push @lookupoids , $lookupname ;
1046
1047
if ($lookupname eq ' -' or $lookupname eq ' 0' )
1047
1048
{
1048
- warn sprintf
1049
- " invalid zero OID reference in %s .dat field %s line %s \n " ,
1050
- $catname , $attname , $bki_values -> {line_number }
1051
- if !$lookup_opt ;
1049
+ if (!$lookup_opt )
1050
+ {
1051
+ warn sprintf
1052
+ " invalid zero OID reference in %s .dat field %s line %s \n " ,
1053
+ $catname , $attname , $bki_values -> {line_number };
1054
+ $num_errors ++;
1055
+ }
1052
1056
}
1053
1057
else
1054
1058
{
1055
1059
warn sprintf
1056
1060
" unresolved OID reference \" %s \" in %s .dat field %s line %s \n " ,
1057
1061
$lookupname , $catname , $attname , $bki_values -> {line_number };
1062
+ $num_errors ++;
1058
1063
}
1059
1064
}
1060
1065
}
0 commit comments