Changeset 22485 for main/trunk
- Timestamp:
- 2010-07-22T18:55:18+12:00 (14 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/buildConfigxml.pm
r21822 r22485 331 331 332 332 333 &write_line('COLCFG', ["<defaultIndex shortname=\"", $defaultindex, "\" />"]); 333 #$defaultindex = "ZZ" if (!$defaultindex); # index allfields by default 334 if($defaultindex) { 335 &write_line('COLCFG', ["<defaultIndex shortname=\"", $defaultindex, "\" />"]); 336 } 334 337 335 338 -
main/trunk/greenstone2/perllib/collConfigxml.pm
r22456 r22485 152 152 } 153 153 154 &Display;154 #&Display; 155 155 return $data; 156 156 } -
main/trunk/greenstone2/perllib/dbutil.pm
r22121 r22485 144 144 } 145 145 146 # This function, conceptually, would be better structured if it didn't 147 # use return statements, as the database methods it calls do not 148 # themselves return anything. 149 # Note: if doing this, then the GDBM lines of code should be moved into 150 # an 'else' clause 146 151 147 152 sub read_infodb_file … … 177 182 } 178 183 184 sub read_infodb_keys 185 { 186 my $infodb_type = shift(@_); 187 my $infodb_file_path = shift(@_); 188 my $infodb_map = shift(@_); 189 190 if ($infodb_type eq "sqlite") 191 { 192 require dbutil::sqlite; 193 &dbutil::sqlite::read_infodb_keys($infodb_file_path, $infodb_map, @_); 194 } 195 elsif ($infodb_type eq "gdbm-txtgz") 196 { 197 require dbutil::gdbmtxtgz; 198 &dbutil::gdbmtxtgz::read_infodb_keys($infodb_file_path, $infodb_map, @_); 199 } 200 elsif ($infodb_type eq "jdbm") 201 { 202 require dbutil::jdbm; 203 &dbutil::jdbm::read_infodb_keys($infodb_file_path, $infodb_map, @_); 204 } 205 elsif ($infodb_type eq "mssql") 206 { 207 require dbutil::mssql; 208 &dbutil::mssql::read_infodb_keys($infodb_file_path, $infodb_map, @_); 209 } 210 else { 211 # Use GDBM if the infodb type is empty or not one of the values above 212 require dbutil::gdbm; 213 &dbutil::gdbm::read_infodb_keys($infodb_file_path, $infodb_map, @_); 214 } 215 } 179 216 180 217 sub read_infodb_entry -
main/trunk/greenstone2/perllib/dbutil/gdbmtxtgz.pm
r22076 r22485 114 114 } 115 115 116 117 sub read_infodb_keys 118 { 119 my $infodb_file_path = shift(@_); 120 my $infodb_map = shift(@_); 121 122 my $cmd = "gzip --decompress \"$infodb_file_path\""; 123 124 open (PIPEIN, "$cmd |") 125 || die "Error: Couldn't open pipe from gzip: $!\n $cmd\n"; 126 127 my $infodb_line = ""; 128 my $infodb_key = ""; 129 while (defined ($infodb_line = <PIPEIN>)) 130 { 131 if ($infodb_line =~ /^\[([^\]]+)\]$/) 132 { 133 $infodb_key = $1; 134 } 135 elsif ($infodb_line =~ /^-{70}$/) 136 { 137 $infodb_map->{$infodb_key} = 1; 138 $infodb_key = ""; 139 } 140 } 141 142 close (PIPEIN); 143 } 144 116 145 117 146 sub write_infodb_entry -
main/trunk/greenstone2/perllib/dbutil/mssql.pm
r21856 r22485 141 141 142 142 print STDERR "******* mssql::read_infodb_file() TO BE IMPLEMENTED!\n"; 143 print STDERR "******* See sqlite.pm for comparable implementation that has been coded up!\n"; 144 } 145 146 sub read_infodb_keys 147 { 148 my $infodb_file_path = shift(@_); 149 my $infodb_map = shift(@_); 150 151 print STDERR "******* mssql::read_infodb_keys() TO BE IMPLEMENTED!\n"; 143 152 print STDERR "******* See sqlite.pm for comparable implementation that has been coded up!\n"; 144 153 } -
main/trunk/greenstone2/perllib/dbutil/sqlite.pm
r22076 r22485 141 141 } 142 142 143 } 144 145 146 sub read_infodb_keys 147 { 148 my $infodb_file_path = shift(@_); 149 my $infodb_map = shift(@_); 150 151 152 my $keys_str = read_infodb_cmd($infodb_file_path,"SELECT key FROM data;"); 153 154 my @keys = split(/\n/,$keys_str); 155 156 foreach my $key (@keys) 157 { 158 $infodb_map->{$key} = 1; 159 } 143 160 } 144 161
Note:
See TracChangeset
for help on using the changeset viewer.