Changeset 1890

Show
Ignore:
Timestamp:
02/06/07 16:29:45 (1 year ago)
Author:
moseley
Message:

Deal with change to how the pod/html destination works.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish_website/bin/build

    r1889 r1890  
    275275# Set defaults 
    276276 
    277 if ( $config->{root} )  { 
    278     my $root = File::Spec->rel2abs( $config->{root} ); 
    279  
    280     for my $option ( keys %default_paths ) { 
    281         next if $config->{$option}; 
    282         my $dir = File::Spec->catfile( $root, $default_paths{$option} ); 
    283  
    284         if ( -d $dir ) { 
    285             $config->{$option} = $dir; 
    286         } else { 
    287             warn "Could not set option '--$option=$dir': $!\n"; 
     277    if ( $config->{root} )  { 
     278        my $root = File::Spec->rel2abs( $config->{root} ); 
     279 
     280        for my $option ( keys %default_paths ) { 
     281            next if $config->{$option}; 
     282            my $dir = File::Spec->catfile( $root, $default_paths{$option} ); 
     283 
     284            if ( -d $dir ) { 
     285                $config->{$option} = $dir; 
     286            } else { 
     287                warn "Could not set option '--$option=$dir': $!\n"; 
     288            } 
    288289        } 
    289290    } 
    290 
    291  
    292  
    293  
    294 $config->{poddest} = File::Spec->catfile( $config->{dest}, 'docs' ) 
    295     unless $config->{poddest}; 
     291 
     292 
     293# The docs to go to the docs sub-directory by default 
     294 
     295    $config->{poddest} = File::Spec->catfile( $config->{dest}, 'docs' ) 
     296        unless $config->{poddest}; 
     297 
     298 
    296299 
    297300 
    298301# Generate apache config 
    299 if ( $config->{apache} ) { 
    300  
    301     my $tt = Template->new( 
    302         INCLUDE_PATH => File::Spec->catfile( $config->{src}, 'etc' ), 
    303     ); 
    304  
    305     my $stash = { 
    306         %$config, 
    307         script      => $0, 
    308         arguments   => join( ' ', @argv ), 
    309     }; 
    310  
    311     my $template = $config->{template} || 'httpd.conf.tt'; 
    312  
    313     $tt->process( $template, $stash ) || die $tt->error; 
    314  
    315     exit 0; 
    316 
     302 
     303    if ( $config->{apache} ) { 
     304 
     305        my $tt = Template->new( 
     306            INCLUDE_PATH => File::Spec->catfile( $config->{src}, 'etc' ), 
     307        ); 
     308 
     309        my $stash = { 
     310            %$config, 
     311            script      => $0, 
     312            arguments   => join( ' ', @argv ), 
     313        }; 
     314 
     315        my $template = $config->{template} || 'httpd.conf.tt'; 
     316 
     317        $tt->process( $template, $stash ) || die $tt->error; 
     318 
     319        exit 0; 
     320    } 
    317321 
    318322 
     
    323327 
    324328 
    325 my $generator = DocBuilder->new( $config ); 
    326  
    327 $generator->pods( \@pod_files, 'swishsrc' ) if $config->swishsrc; 
    328 $generator->website if $config->dest && !$config->podonly; 
    329  
    330 $generator->pods( \@pod_files, 'develsrc' ) 
    331     if $config->dest && $config->develsrc && !$config->podonly; 
    332  
    333  
    334  
    335 exit $exit_value; 
     329    my $generator = DocBuilder->new( $config ); 
     330 
     331    # Generate the pods 
     332    $generator->pods( \@pod_files, 'swishsrc' ) if $config->swishsrc; 
     333 
     334    # Generate the website 
     335    $generator->website if $config->dest && !$config->podonly; 
     336 
     337    # Generate the development docs 
     338    $generator->pods( \@pod_files, 'develsrc' ) 
     339        if $config->dest && $config->develsrc && !$config->podonly; 
     340 
     341 
     342 
     343    exit $exit_value; 
    336344 
    337345 
     
    364372    # Thise have defaults so this should not fail 
    365373    die "Must specify top-level web source directory with -src\n" unless $config->src; 
    366     die "Must specify either -dest or -root\n" unless $config->dest;  # not really true 
    367374 
    368375 
     
    390397    # Validate dest directory 
    391398 
    392     my $dest = File::Spec->rel2abs( $config->dest ); 
    393  
    394     mkdir $dest unless -e $dest; 
    395  
    396     die "destination directory [$dest] does not exist\n" unless -e $dest; 
    397     die "destination directory [$dest] is not a directory\n" unless -d $dest; 
    398     die "destination directory [$dest] is not writable\n" unless -w $dest; 
    399     die "Source and destination cannot be the same\n" if $dest eq $topsrc_abs; 
    400     warn "Destination directory set to [$dest]\n" if $config->verbose; 
    401  
     399    die "Must specify either -dest (or -root) or -poddest\n" 
     400        unless $config->dest || $config->poddest; 
     401 
     402 
     403    my $dest; 
     404 
     405    if ( $config->dest ) { 
     406        $dest = File::Spec->rel2abs( $config->dest ); 
     407 
     408        mkdir $dest unless -e $dest; 
     409 
     410        die "destination directory [$dest] does not exist\n" unless -e $dest; 
     411        die "destination directory [$dest] is not a directory\n" unless -d $dest; 
     412        die "destination directory [$dest] is not writable\n" unless -w $dest; 
     413        die "Source and destination cannot be the same\n" if $dest eq $topsrc_abs; 
     414        warn "Destination directory set to [$dest]\n" if $config->verbose; 
     415    } 
    402416 
    403417 
     
    406420 
    407421 
    408     # Set podonly if pods are writting elsewhere (ie. $dest is not a substring of $poddest) 
    409     # This is a bit important, if just scanning this code. 
    410     # This ends up changing the OUTPUT_PATH 
    411  
    412     if (  index( $poddest, $dest ) == -1 ) { 
     422    # If the (website) dest directory is not set then assume we are 
     423    # writing pods only. 
     424    # Note: Used to check if the poddest was a sub-directory 
     425    # of the dest directory, but that was when dest was automatically 
     426    # set relative to $RealBin. 
     427 
     428    unless ( $config->dest ) { 
    413429        $config->{podonly} = 1;  # Don't write the web site 
    414430        $config->{abslinks} = 1; # Flag to generate absolute links on pod files 
  • swish_website/lib/page/footer.html

    r1889 r1890  
    22<span class="doNotPrint"> 
    33    Swish-e is distributed with <strong>no warranty</strong> under the terms of the <br /> 
    4     <a href='/license.html'>Swish-e License</a>.<br /> 
     4    <a href='http://swish-e.org/license.html'>Swish-e License</a>.<br /> 
    55    Questions may be posted to the  
    66    [% link_to_page('discuss', 'Swish-e Discussion list') %]. 
  • swish_website/lib/page/header.html

    r1885 r1890  
    1313            <a href="http://www.zlib.net/" title="zlib home page">zlib</a> | 
    1414            <a href="http://www.foolabs.com/xpdf/" title="xpdf home page">xpdf</a> | 
    15             <a href="[% site.url.repo_view %]" title="browse source code">Subversion</a> 
     15            <a href="http://dev.swish-e.org/browser" title="browse source code">Subversion</a> 
    1616      </div> 
    1717