Changeset 1145


Ignore:
Timestamp:
2000-05-04T17:14:00+12:00 (24 years ago)
Author:
sjboddie
Message:

attempting to get end-user collection building working under windows

Location:
trunk/gsdl/cgi-bin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/GSDLHOME.pm

    r1143 r1145  
    33BEGIN {
    44
    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'};
    236
    247    # just in case GSDLHOME has a slash on the end which would cause
     
    3114    $ENV{'GSDLOS'} = 'windows';
    3215    }
    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");
    4521}
    4622
  • trunk/gsdl/cgi-bin/gsdlsite.cfg

    r1135 r1145  
    33
    44# points to the GSDLHOME directory
    5 gsdlhome    /home/gsdl
     5gsdlhome    d:/home/dl/gsdl
    66
    77# this is the http address of GSDLHOME
    88# if your webservers DocumentRoot is set to gsdlhome
    99# then httpprefix will be blank
    10 httpprefix  /gsdl
     10httpprefix 
    1111
    1212# this is the http address of the directory which
     
    1414# if your webservers DocumentRoot is set to gsdlhome
    1515# then httpimg will be /images
    16 httpimg     /gsdl/images
     16httpimg     /images
    1717
    1818# should contain the http address of this cgi script. This
  • trunk/gsdl/cgi-bin/webpage_buildcol.pl

    r1129 r1145  
    1 #!/usr/bin/perl -w
     1#!perl -w
    22
    33###########################################################################
     
    3232#   an already running cgi program.
    3333
    34 use Fcntl ':flock';
     34#use Fcntl ':flock';
    3535use File::Basename;
     36use GSDLHOME;
    3637
    3738my $args;
     
    4647        my ($variable,$assignment) = ($1,$3);
    4748        $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    }
    7350    }
    7451}
     
    8461    if (open(TMPOUT,">$full_tmpname"))
    8562    {
    86     if (flock(TMPOUT,LOCK_EX))
    87     {
     63#   if (flock(TMPOUT,LOCK_EX))
     64#   {
    8865        print TMPOUT $text;
    8966        close(TMPOUT);
    90         flock(TMPOUT,LOCK_UN);
    91     }
    92     else
    93     {
     67#       flock(TMPOUT,LOCK_UN);
     68#   }
     69#   else
     70#   {
    9471        # 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#   }
    10077    }
    10178    else
     
    221198    {
    222199    # 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";
    224203   
    225204    if(!open(IMPORTOUT,"$import_cmd 2>&1 |"))
     
    254233
    255234    # Build operation
    256     my $build_cmd = "";
     235    my $build_cmd = "perl " .
     236        &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "buildcol.pl");
    257237    if (($do_import eq "true")
    258238        || (($do_import eq "false") && (-e $full_archivename)))
    259239    {
    260         $build_cmd = "buildcol.pl $dirname";
     240        $build_cmd .= " $dirname";
    261241    }
    262242    else
    263243    {
    264 
    265         $build_cmd = "buildcol.pl";
    266244        $build_cmd .= " -archivedir $full_importname";
    267245        $build_cmd .= " -cachedir $full_archivename";
     
    356334    if (open(CFGIN,"<$cfg_filename"))
    357335    {
    358     if (flock(CFGIN,LOCK_EX))
    359     {
     336#   if (flock(CFGIN,LOCK_EX))
     337#   {
    360338        # do requested stages for building
    361339        my $result = do_build($full_dirname,$dirname,$args);
     
    363341        close(CFGIN);
    364342        return if ($result ne "success");
    365     }
    366     else
    367     {
     343#   }
     344#   else
     345#   {
    368346        # 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#   }
    373351    }
    374352
     
    379357
    380358&main();
    381 
    382 
    383 
    384 
    385 
  • trunk/gsdl/cgi-bin/webpage_buildstatus.pl

    r1129 r1145  
    1 #!/usr/bin/perl -w
     1#!perl -w
    22
    33###########################################################################
     
    6666    }
    6767
    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);
    7075
    7176    if (open(TMPIN,"<$full_tmpname"))
  • trunk/gsdl/cgi-bin/webpage_delcol.pl

    r1129 r1145  
    1 #!/usr/bin/perl -w
     1#!perl -w
    22
    33###########################################################################
  • trunk/gsdl/cgi-bin/webpage_editcol.pl

    r1129 r1145  
    1 #!/usr/bin/perl -w
     1#!perl -w
    22
    33###########################################################################
  • trunk/gsdl/cgi-bin/webpage_mkcol.pl

    r1129 r1145  
    1 #!/usr/bin/perl -w
     1#!perl -w
    22
    33###########################################################################
     
    149149    my $acronyms      = $args->{'bc1acronyms'};
    150150
    151     my $cmd = "mkcol.pl";
     151    my $cmd = "perl ";
     152    $cmd .= &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script", "mkcol.pl");
    152153    $cmd .= " -title   \"$fullname\"";
    153154    $cmd .= " -creator $contact_email";
     
    257258
    258259&main();
    259 
    260 
    261 
    262 
    263 
Note: See TracChangeset for help on using the changeset viewer.