Changeset 1175
- Timestamp:
- 2000-05-19T16:54:39+12:00 (24 years ago)
- Location:
- trunk/gsdl/cgi-bin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/webpage_buildcol.pl
r1145 r1175 32 32 # an already running cgi program. 33 33 34 #use Fcntl ':flock';34 use Fcntl ':flock'; 35 35 use File::Basename; 36 36 use GSDLHOME; … … 61 61 if (open(TMPOUT,">$full_tmpname")) 62 62 { 63 #if (flock(TMPOUT,LOCK_EX))64 #{63 if (flock(TMPOUT,LOCK_EX)) 64 { 65 65 print TMPOUT $text; 66 66 close(TMPOUT); 67 #flock(TMPOUT,LOCK_UN);68 #}69 #else70 #{67 flock(TMPOUT,LOCK_UN); 68 } 69 else 70 { 71 71 # Problem locking file 72 #my $mess = "Unable to lock temporary communication file:";73 #$mess .= " $full_tmpname";74 #print STDERR "$mess\n";75 #return;76 #}72 my $mess = "Unable to lock temporary communication file:"; 73 $mess .= " $full_tmpname"; 74 print STDERR "$mess\n"; 75 return; 76 } 77 77 } 78 78 else … … 117 117 if ($copy_dir =~ m/^yes$/i) 118 118 { 119 my $download_cmd = " ";119 my $download_cmd = "perl " . &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script"); 120 120 my $file_or_url = $building_cfg_text->{'building'}->{'fileorurl'}; 121 121 … … 123 123 { 124 124 # run urlcopy.pl to download files 125 $download_cmd = " urlcopy.pl ";125 $download_cmd = " urlcopy.pl "; 126 126 my @urls = split("\n",$input_dir); 127 127 my $u; … … 138 138 $input_dir =~ s/^\s+//; 139 139 $input_dir =~ s/\s+$//; 140 $download_cmd = " filecopy.pl $input_dir";140 $download_cmd = " filecopy.pl $input_dir"; 141 141 } 142 142 … … 332 332 = &util::filename_cat($full_dirname,"etc","collect.cfg"); 333 333 334 if (open(CFGIN,"<$cfg_filename")) 335 { 336 # if (flock(CFGIN,LOCK_EX)) 337 # { 338 # do requested stages for building 339 my $result = do_build($full_dirname,$dirname,$args); 340 flock(CFGIN,LOCK_UN); 341 close(CFGIN); 342 return if ($result ne "success"); 343 # } 344 # else 345 # { 346 # Problem locking file 347 # my $mess = "Unable to lock configuration file: $cfg_filename"; 348 # print STDERR "$mess\n"; 349 # return; 350 # } 351 } 352 353 # my $mess_url = "$args->{'httpbuild'}&bca=mess&bc1dirname=$dirname"; 354 # print "Location: $mess_url&head=_headdone_&mess=_messdonebuildcol_\n\n"; 355 # print "done\n"; # in tmp file 334 # do requested stages for building 335 my $result = do_build($full_dirname,$dirname,$args); 336 return if ($result ne "success"); 337 338 my $mess_url = "$args->{'httpbuild'}&bca=mess&bc1dirname=$dirname"; 339 print "Location: $mess_url&head=_headdone_&mess=_messdonebuildcol_\n\n"; 340 print "done\n"; # in tmp file 356 341 } 357 342 -
trunk/gsdl/cgi-bin/webpage_buildstatus.pl
r1145 r1175 31 31 use CGI; 32 32 use GSDLHOME; 33 use Fcntl ':flock';34 33 35 34 require util; … … 86 85 $bc1finished = 1 if ($mess eq "Done"); 87 86 $bc1finished = -1 if ($mess =~ m/^Error:/); 87 # escape backslashes so they don't vanish from printed filenames 88 $mess =~ s/\\/\\\\/g; 88 89 &webpageutil::status_location($args,$mess,$tmpname,$bc1finished); 89 90 … … 101 102 102 103 &main(); 103 104 105 106 107 -
trunk/gsdl/cgi-bin/webpage_delcol.pl
r1145 r1175 30 30 use CGI; 31 31 use GSDLHOME; 32 use Fcntl ':flock';33 32 34 33 require util; … … 73 72 &util::rm_r($col_dir); 74 73 75 # delete from collections.txt76 my $collist_filename77 = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");78 if (open(CLIN,"<$collist_filename"))79 {80 if (flock(CLIN,LOCK_EX))81 {82 my @keep_dirnames = ();83 while (defined($line=<CLIN>))84 {85 chop $line;86 push(@keep_dirnames,$line) if ($line ne $dirname);87 }88 close(CLIN);89 90 if (open(CLIN,">$collist_filename"))91 {92 print CLIN join("\n",@keep_dirnames), "\n";93 }94 95 flock(CLIN,LOCK_UN);96 close(CLIN);97 }98 else99 {100 # problem locking file101 my $mess = "Unable to lock collection list configuration";102 $mess .= " file: $collist_filename";103 &webpageutil::error_location($args,$mess);104 return;105 }106 }107 else108 {109 # problem opening file for reading in110 111 my $mess = "Unable to open for input the collection list";112 $mess .= " configuration file: $collist_filename";113 &webpageutil::error_location($args,$mess);114 return;115 }116 74 } 117 75 elsif ($delete_area eq "import") -
trunk/gsdl/cgi-bin/webpage_mkcol.pl
r1171 r1175 30 30 use CGI; 31 31 use GSDLHOME; 32 #use Fcntl ':flock';32 use Fcntl ':flock'; 33 33 34 34 require util; … … 179 179 if (open(CFGAPP,">>$cfg_filename")) 180 180 { 181 #if (flock(CFGAPP,LOCK_EX))182 #{181 if (flock(CFGAPP,LOCK_EX)) 182 { 183 183 print CFGAPP "\n"; 184 184 … … 191 191 print CFGAPP "building\tcopydir\t\t$copy_dir\n"; 192 192 print CFGAPP "building\tingsdlarea\t$in_gsdl_area\n"; 193 #flock(CFGAPP,LOCK_UN);193 flock(CFGAPP,LOCK_UN); 194 194 close(CFGAPP); 195 #}196 #else197 #{195 } 196 else 197 { 198 198 # problem locking file 199 #my $mess = "Unable to lock collection";200 #$mess .= " configuration file: $cfg_filename";201 #&webpageutil::error_location($args,$mess);202 #close(CFGAPP);203 #return;204 #}199 my $mess = "Unable to lock collection"; 200 $mess .= " configuration file: $cfg_filename"; 201 &webpageutil::error_location($args,$mess); 202 close(CFGAPP); 203 return; 204 } 205 205 } 206 206 else … … 212 212 return; 213 213 } 214 215 216 # append dirname to end of collection config file217 my $collist_filename218 = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");219 if (open(CLAPP,">>$collist_filename"))220 {221 # if (flock(CLAPP,LOCK_EX))222 # {223 print CLAPP "$unique_dirname\n";224 # flock(CLAPP,LOCK_UN);225 close(CLAPP);226 # }227 # else228 # {229 # problem locking file230 # my $mess = "Unable to lock collection list";231 # $mess .= " configuration file: $collist_filename";232 # &webpageutil::error_location($args,$mess);233 # close(CLAPP);234 # return;235 # }236 }237 else238 {239 # problem240 my $mess = "Unable to append to collection list";241 $mess .= " configuration file: $collist_filename";242 &webpageutil::error_location($args,$mess);243 return;244 }245 246 214 } 247 215 else
Note:
See TracChangeset
for help on using the changeset viewer.