- Timestamp:
- 2019-06-20T22:39:48+12:00 (5 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/buildcol.pl
r31753 r33171 91 91 use FileUtils; 92 92 use util; 93 use doc; # for the variable our $cmd_line_mode ($doc::cmd_line_mode) 93 94 94 95 # Globals … … 304 305 sub main 305 306 { 307 $doc::cmd_line_mode = "buildcol"; 308 306 309 # Dynamically include arguments from any subclasses of buildcolutils we find 307 310 # in the extensions directory -
main/trunk/greenstone2/bin/script/export.pl
r28704 r33171 69 69 #no strict 'subs'; # allow barewords (eg STDERR) as function arguments 70 70 use inexport; 71 use doc; # for the variable our $cmd_line_mode ($doc::cmd_line_mode) 71 72 72 73 … … 147 148 sub main 148 149 { 150 $doc::cmd_line_mode = "export"; 151 149 152 my $inexport = new inexport("export",\@ARGV,$options,$listall_options); 150 153 -
main/trunk/greenstone2/bin/script/import.pl
r32541 r33171 80 80 use util; 81 81 use gsprintf 'gsprintf'; 82 use doc; # for the variable our $cmd_line_mode ($doc::cmd_line_mode) 82 83 83 84 … … 170 171 sub main 171 172 { 173 $doc::cmd_line_mode = "import"; 174 172 175 # Dynamically include arguments from any subclasses of inexport we find 173 176 # in the extensions directory -
main/trunk/greenstone2/perllib/doc.pm
r33139 r33171 52 52 53 53 our $OIDcount = 0; 54 55 56 # Declare the Package (level) Variable that will tell us whether we're in the import or buildcol phase. 57 # This var will be set by import.pl, buildcol.pl and export.pl to the then appropriate value. 58 # https://perlmaven.com/package-variables-and-lexical-variables-in-perl 59 # But: https://stackoverflow.com/questions/7542120/perl-how-to-make-variables-from-requiring-script-available-in-required-script 60 # https://stackoverflow.com/questions/33230015/how-do-i-use-a-variable-in-another-perl-script 61 #$doc::cmd_line_mode = undef; 62 # Decided to follow the usage of $OIDcount above to declare the necessary package-level variables 'globally' accessible 63 # actually accessible only for those packages that import this one (with 'use doc') 64 our $cmd_line_mode = undef; 54 65 55 66 # rename_method can be 'url', 'none', 'base64' … … 1067 1078 my ($section, $field, $value) = @_; 1068 1079 1069 1080 # my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(1); 1070 1081 # my ($lcfilename) = ($cfilename =~ m/([^\\\/]*)$/); 1071 1082 # print STDERR "** Calling method: $lcfilename:$cline $cpackage->$csubr\n"; … … 1158 1169 # and therefore skip converting the GPS.mapOverlay meta into Coordinate meta! What to dooooo? 1159 1170 # So the return statement immediately below is a temporary solution, until we find a better one that will always work. 1160 my $metaMap = $self->get_metadata_hashmap($section); 1161 if(!$metaMap->{'Coordinate'}) { 1162 1171 if($cmd_line_mode eq "buildcol") { 1172 #my $metaMap = $self->get_metadata_hashmap($section); ## TODO: Check if necessary to avoid duplication of <Coordinate> meta in index\text\<coll>.jdb 1173 1174 #if(!$metaMap->{'Coordinate'}) { 1175 #print STDERR "@@@@@@@@@@@@@@ cmd line mode (build phase) is now: $doc::cmd_line_mode\n"; 1176 1177 1163 1178 print STDERR "GPS.mapOverlay before val: " . $value . "\n"; 1164 1179 … … 1247 1262 elsif ($type eq "rectangle") { 1248 1263 1249 my $bounds = $shape->{"bounds"}; 1250 1264 my $bounds = $shape->{"bounds"}; 1251 1265 $self->processCoordinate($section, $bounds->{"north"}, $bounds->{"east"}); 1252 1266 $self->processCoordinate($section, $bounds->{"south"}, $bounds->{"east"}); … … 1256 1270 1257 1271 } # end for on each shape in GPS.mapOverlay 1272 #} 1258 1273 } 1259 1274 } # end GPS.mapOverlay meta
Note:
See TracChangeset
for help on using the changeset viewer.