Changeset 28395 for main/trunk/greenstone2/perllib/dbutil/jdbm.pm
- Timestamp:
- 2013-10-14T09:59:05+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/dbutil/jdbm.pm
r28126 r28395 50 50 my $classpath = &util::pathname_cat($jdbmwrap_jar,$jdbm_jar); 51 51 52 if ($^O eq "cygwin") { 53 # Away to run a java program, using a binary that is native to Windows, so need 54 # Windows directory and path separators 55 56 $classpath = `cygpath -wp "$classpath"`; 57 chomp($classpath); 58 $classpath =~ s%\\%\\\\%g; 59 } 60 52 61 my $infodb_file_handle = undef; 53 62 my $txt2jdb_cmd = "java -cp \"$classpath\" Txt2Jdb"; … … 64 73 $infodb_file_path =~ s/\.jdb$//; 65 74 75 if ($^O eq "cygwin") { 76 $infodb_file_path = `cygpath -w "$infodb_file_path"`; 77 chomp($infodb_file_path); 78 $infodb_file_path =~ s%\\%\\\\%g; 79 } 80 66 81 $txt2jdb_cmd .= " \"$infodb_file_path\""; 67 68 ## print STDERR "**** txt2jdbm cmd = $txt2jdb_cmd\n\n";69 82 70 83 if (!open($infodb_file_handle, "| $txt2jdb_cmd")) … … 109 122 110 123 my $classpath = &util::pathname_cat($jdbmwrap_jar,$jdbm_jar); 124 125 if ($^O eq "cygwin") { 126 # Away to run a java program, using a binary that is native to Windows, so need 127 # Windows directory and path separators 128 129 $classpath = `cygpath -wp "$classpath"`; 130 chomp($classpath); 131 $classpath =~ s%\\%\\\\%g; 132 133 $infodb_file_path = `cygpath -w "$infodb_file_path"`; 134 chomp($infodb_file_path); 135 $infodb_file_path =~ s%\\%\\\\%g; 136 } 111 137 112 138 my $jdb2txt_cmd = "java -cp \"$classpath\" Jdb2Txt"; … … 119 145 while (defined ($infodb_line = <PIPEIN>)) 120 146 { 147 $infodb_line =~ s/(\r\n)+$//; # more general than chomp 148 121 149 if ($infodb_line =~ /^\[([^\]]+)\]$/) 122 150 { … … 157 185 while (defined ($infodb_line = <PIPEIN>)) 158 186 { 159 chomp $infodb_line; # remove end of line 187 # chomp $infodb_line; # remove end of line 188 $infodb_line =~ s/(\r\n)+$//; # more general than chomp 160 189 161 190 $infodb_map->{$infodb_line} = 1; … … 173 202 my $infodb_key = shift(@_); 174 203 my $infodb_map = shift(@_); 175 204 176 205 print $infodb_handle "[$infodb_key]\n"; 177 206 foreach my $infodb_value_key (keys(%$infodb_map)) … … 240 269 $infodb_file_path =~ s/\.jdb$//; 241 270 271 if ($^O eq "cygwin") { 272 # Away to run a java program, using a binary that is native to Windows, so need 273 # Windows directory and path separators 274 275 $classpath = `cygpath -wp "$classpath"`; 276 chomp($classpath); 277 $classpath =~ s%\\%\\\\%g; 278 279 $infodb_file_path = `cygpath -w "$infodb_file_path"`; 280 chomp($infodb_file_path); 281 $infodb_file_path =~ s%\\%\\\\%g; 282 } 283 242 284 my $cmd = "java -cp \"$classpath\" Txt2Jdb -append \"$infodb_file_path\""; 243 285
Note:
See TracChangeset
for help on using the changeset viewer.