Changeset 1314

Show
Ignore:
Timestamp:
02/07/07 12:35:30 (2 years ago)
Author:
jm3
Message:

added shell and Perl as config output targets so that configs are now readable by all maintenance scripts that need them (meaning we can finally take those pesky passwords out of the straggler scripts that still don't user config)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/_config/parse-config.xsl

    r927 r1314  
    11<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
    2  
     2<!--  
     3        Reads in a servers.xml config file and spits out application server configs  
     4        in formats that all the different rube-goldberg-esque spinning gears need: 
     5                perl,  
     6                sh,  
     7                php,  
     8                etc. 
     9-->  
    310<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    411        <xsl:output method="text" /> 
     
    815                <xsl:choose> 
    916                        <xsl:when test="$mode = 'php'">&lt;% 
    10                                        function get_env() { 
    11                                                return "<xsl:value-of select="$server-name" />"; 
    12                                        
     17function get_env() { 
     18        return "<xsl:value-of select="$server-name" />"; 
     19
    1320                                <xsl:for-each select="/servers/server[@name=$server-name]/@*"> 
    14                                        function get_<xsl:value-of select="translate(name(.), '-', '_')" />() { 
    15                                                return "<xsl:value-of select="." />"; 
    16                                        
     21function get_<xsl:value-of select="translate(name(.), '-', '_')" />() { 
     22        return "<xsl:value-of select="." />"; 
     23
    1724                                </xsl:for-each> 
    1825                                <xsl:call-template name="CRLF" /> 
    1926%&gt;</xsl:when> 
     27 
     28                        <xsl:when test="$mode = 'sh'"> 
     29# This file is autogenerated by _config/parse-config.xsl 
     30# DO NOT EDIT! or your changes will be blown away the next time someone runs bin/configure.sh 
     31 
     32function get_env () { 
     33        echo "<xsl:value-of select="$server-name" />" 
     34} 
     35                                <xsl:for-each select="/servers/server[@name=$server-name]/@*"> 
     36function get_<xsl:value-of select="translate(name(.), '-', '_')" /> () { 
     37        echo "<xsl:value-of select="." />"; 
     38} 
     39                                </xsl:for-each> 
     40                        </xsl:when> 
     41 
     42                        <xsl:when test="$mode = 'perl'"> 
     43sub get_env { 
     44        return "<xsl:value-of select="$server-name" />" 
     45} 
     46                                <xsl:for-each select="/servers/server[@name=$server-name]/@*"> 
     47sub get_<xsl:value-of select="translate(name(.), '-', '_')" /> { 
     48        return "<xsl:value-of select="." />"; 
     49} 
     50                                </xsl:for-each> 
     511; # modules must return a true value 
     52                        </xsl:when> 
    2053 
    2154                        <xsl:when test="$mode = 'htaccess'"> 
  • feedmelinks/bin/.cvsignore

    r751 r1314  
    11test-mail.txt 
     2env.sh 
  • feedmelinks/bin/configure.sh

    r1032 r1314  
    4242echo $domain > $root/_config/domain.txt 
    4343 
    44 echo 3. Saving your configurations in env.inc.php 
     44echo "3. Saving your configurations in env.inc.php (for site application to read)" 
    4545xsltproc --$sp server-name $s --$sp mode php $xsl $xml > $root/modules/env.inc.php 
    4646 
    47 echo 4. FIXME: need to ALSO save these to a perl and/or sh-readable format for the maintenance scripts to read 
    48 echo 5. FIXME: need to ALSO build the crontab with the right paths 
     47echo "4. ...and in shell-script format (for maintenance scripts to read)..." 
     48xsltproc --$sp server-name $s --$sp mode sh $xsl $xml > $root/bin/env.sh 
     49 
     50echo "5. ...and as a perl modules format (for other maintenance scripts to read)..." 
     51cp $root/lib/FeedMeLinks/Environment-template.pm $root/lib/FeedMeLinks/Environment.pm 
     52xsltproc --$sp server-name $s --$sp mode perl $xsl $xml >> $root/lib/FeedMeLinks/Environment.pm 
     53 
     54echo 6. FIXME: need to ALSO build a crontab file with the correct paths 
    4955 
    5056exit 0