Changeset 1145
- Timestamp:
- 2000-05-04T17:14:00+12:00 (24 years ago)
- Location:
- trunk/gsdl/cgi-bin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/GSDLHOME.pm
r1143 r1145 3 3 BEGIN { 4 4 5 # get arguments 6 my $cgi = new CGI; 7 8 $ENV{'GSDLHOME'} = $cgi->param("gsdlhome") if (!defined $ENV{'GSDLHOME'}); 9 10 # delete this line once _gsdlhome macro is fixed 11 $ENV{'GSDLHOME'} =~ s/d:gsdl/d:\\gsdl/i; 12 13 unless (defined $ENV{'GSDLHOME'}) 14 { 15 print "Content-type: text/html\n\n"; 16 my $title = "Greenstone Software: Web Error Encountered"; 17 print "<html><title>$title</title>\n"; 18 print "<body bgcolor=\"#ffffff\"><h3>$title</h3>\n"; 19 print "<p> GSDLHOME not set.\n"; 20 print "</body>\n</html>\n"; 21 exit(0); 22 } 5 $ENV{'GSDLHOME'} = 'd:/home/dl/gsdl' unless defined $ENV{'GSDLHOME'}; 23 6 24 7 # just in case GSDLHOME has a slash on the end which would cause … … 31 14 $ENV{'GSDLOS'} = 'windows'; 32 15 } 33 34 if ($ENV{'GSDLOS'} eq "windows") { 35 $ENV{'PATH'} .= ':' . $ENV{'GSDLHOME'} . '\bin\script'; 36 $ENV{'PATH'} .= ':' . $ENV{'GSDLHOME'} . '\bin\windows'; 37 unshift (@INC, $ENV{'GSDLHOME'} . '\perllib'); 38 unshift (@INC, $ENV{'GSDLHOME'} . '\perllib\cpan'); 39 } else { 40 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/script"; 41 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 42 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 43 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 44 } 16 17 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/script"; 18 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 19 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 20 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 45 21 } 46 22 -
trunk/gsdl/cgi-bin/gsdlsite.cfg
r1135 r1145 3 3 4 4 # points to the GSDLHOME directory 5 gsdlhome /home/gsdl5 gsdlhome d:/home/dl/gsdl 6 6 7 7 # this is the http address of GSDLHOME 8 8 # if your webservers DocumentRoot is set to gsdlhome 9 9 # then httpprefix will be blank 10 httpprefix /gsdl10 httpprefix 11 11 12 12 # this is the http address of the directory which … … 14 14 # if your webservers DocumentRoot is set to gsdlhome 15 15 # then httpimg will be /images 16 httpimg / gsdl/images16 httpimg /images 17 17 18 18 # should contain the http address of this cgi script. This -
trunk/gsdl/cgi-bin/webpage_buildcol.pl
r1129 r1145 1 #! /usr/bin/perl -w1 #!perl -w 2 2 3 3 ########################################################################### … … 32 32 # an already running cgi program. 33 33 34 use Fcntl ':flock';34 #use Fcntl ':flock'; 35 35 use File::Basename; 36 use GSDLHOME; 36 37 37 38 my $args; … … 46 47 my ($variable,$assignment) = ($1,$3); 47 48 $args->{$variable} = $assignment; 48 49 $ENV{'GSDLHOME'} = $assignment if ($variable eq "gsdlhome"); 50 $ENV{'GSDLOS'} = $assignment if ($variable eq "gsdlos"); 51 } 52 } 53 54 if (defined($ENV{'GSDLHOME'})) 55 { 56 if (!defined($ENV{'GSDLOS'})) 57 { 58 $ENV{'GSDLOS'} = $^O; # special perl variable set to OS 59 ##### Need to check to see what this is set to 60 ##### under Windows 61 } 62 63 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/script"; 64 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 65 66 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 67 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 68 } 69 else 70 { 71 print STDERR "Environment variable GSDLHOME not set\n"; 72 exit 1; 49 } 73 50 } 74 51 } … … 84 61 if (open(TMPOUT,">$full_tmpname")) 85 62 { 86 if (flock(TMPOUT,LOCK_EX))87 {63 # if (flock(TMPOUT,LOCK_EX)) 64 # { 88 65 print TMPOUT $text; 89 66 close(TMPOUT); 90 flock(TMPOUT,LOCK_UN);91 }92 else93 {67 # flock(TMPOUT,LOCK_UN); 68 # } 69 # else 70 # { 94 71 # Problem locking file 95 my $mess = "Unable to lock temporary communication file:";96 $mess .= " $full_tmpname";97 print STDERR "$mess\n";98 return;99 }72 # my $mess = "Unable to lock temporary communication file:"; 73 # $mess .= " $full_tmpname"; 74 # print STDERR "$mess\n"; 75 # return; 76 # } 100 77 } 101 78 else … … 221 198 { 222 199 # Import operation 223 my $import_cmd = "import.pl -removeold $dirname"; 200 my $import_cmd = "perl "; 201 $import_cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "import.pl"); 202 $import_cmd .= " -removeold $dirname"; 224 203 225 204 if(!open(IMPORTOUT,"$import_cmd 2>&1 |")) … … 254 233 255 234 # Build operation 256 my $build_cmd = ""; 235 my $build_cmd = "perl " . 236 &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "buildcol.pl"); 257 237 if (($do_import eq "true") 258 238 || (($do_import eq "false") && (-e $full_archivename))) 259 239 { 260 $build_cmd = "buildcol.pl$dirname";240 $build_cmd .= " $dirname"; 261 241 } 262 242 else 263 243 { 264 265 $build_cmd = "buildcol.pl";266 244 $build_cmd .= " -archivedir $full_importname"; 267 245 $build_cmd .= " -cachedir $full_archivename"; … … 356 334 if (open(CFGIN,"<$cfg_filename")) 357 335 { 358 if (flock(CFGIN,LOCK_EX))359 {336 # if (flock(CFGIN,LOCK_EX)) 337 # { 360 338 # do requested stages for building 361 339 my $result = do_build($full_dirname,$dirname,$args); … … 363 341 close(CFGIN); 364 342 return if ($result ne "success"); 365 }366 else367 {343 # } 344 # else 345 # { 368 346 # Problem locking file 369 my $mess = "Unable to lock configuration file: $cfg_filename";370 print STDERR "$mess\n";371 return;372 }347 # my $mess = "Unable to lock configuration file: $cfg_filename"; 348 # print STDERR "$mess\n"; 349 # return; 350 # } 373 351 } 374 352 … … 379 357 380 358 &main(); 381 382 383 384 385 -
trunk/gsdl/cgi-bin/webpage_buildstatus.pl
r1129 r1145 1 #! /usr/bin/perl -w1 #!perl -w 2 2 3 3 ########################################################################### … … 66 66 } 67 67 68 my $full_tmpname 69 = &util::filename_cat($ENV{'GSDLHOME'},"tmp",$tmpname); 68 my $full_tmpname = &util::filename_cat($ENV{'GSDLHOME'},"tmp"); 69 70 if (!-d $full_tmpname) { 71 mkdir ($full_tmpname, 0777); 72 } 73 74 $full_tmpname = &util::filename_cat($full_tmpname, $tmpname); 70 75 71 76 if (open(TMPIN,"<$full_tmpname")) -
trunk/gsdl/cgi-bin/webpage_delcol.pl
r1129 r1145 1 #! /usr/bin/perl -w1 #!perl -w 2 2 3 3 ########################################################################### -
trunk/gsdl/cgi-bin/webpage_editcol.pl
r1129 r1145 1 #! /usr/bin/perl -w1 #!perl -w 2 2 3 3 ########################################################################### -
trunk/gsdl/cgi-bin/webpage_mkcol.pl
r1129 r1145 1 #! /usr/bin/perl -w1 #!perl -w 2 2 3 3 ########################################################################### … … 149 149 my $acronyms = $args->{'bc1acronyms'}; 150 150 151 my $cmd = "mkcol.pl"; 151 my $cmd = "perl "; 152 $cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "mkcol.pl"); 152 153 $cmd .= " -title \"$fullname\""; 153 154 $cmd .= " -creator $contact_email"; … … 257 258 258 259 &main(); 259 260 261 262 263
Note:
See TracChangeset
for help on using the changeset viewer.