source: branches/New_Config_Format-branch/gsdl/cgi-bin/GSDLHOME.pm@ 1278

Last change on this file since 1278 was 1278, checked in by (none), 24 years ago

This commit was manufactured by cvs2svn to create branch
'New_Config_Format-branch'.

  • Property svn:keywords set to Author Date Id Revision
File size: 911 bytes
Line 
1package GSDLHOME;
2
3BEGIN {
4
5 if (!defined $ENV{'GSDLHOME'}) {
6 # read gsdlhome from gsdlsite.cfg
7 open (GSDLSITE, "gsdlsite.cfg") || die
8 "GSDLHOME.pm: unable to open gsdlsite.cfg\n";
9 my $line = "";
10 while (defined ($line = <GSDLSITE>)) {
11 if ($line =~ /^gsdlhome\s+(.*?)\s*$/) {
12 $ENV{'GSDLHOME'} = $1;
13 last;
14 }
15 }
16 die "GSDLHOME.pm: couldn't find gsdlhome field in gsdlsite.cfg\n"
17 unless defined $ENV{'GSDLHOME'};
18 }
19
20 # just in case GSDLHOME has a slash on the end which would cause
21 # double slashes below
22 $ENV{'GSDLHOME'} =~ s/[\/\\]+$//;
23
24 $ENV{'GSDLOS'} = $^O;
25
26 if ($ENV{'GSDLOS'} =~ /(win|dos)/i) {
27 $ENV{'GSDLOS'} = 'windows';
28 }
29
30 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/script";
31 $ENV{'PATH'} .= ":$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
32 unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
33 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
34}
35
361;
Note: See TracBrowser for help on using the repository browser.