I was getting errors while executing the bash script taht sets up
autoloading after svn checkout and after some discussion with the guys
at #bash i re-wrote the script to:

#!/bin/bash

cd trunk

echo "Creating autoload environment for 'trunk':";
if test -d autoload; then
        echo "Autoload directory exists."
else
        echo "Creating missing 'autoload' directory."
        mkdir autoload
fi

for i in */src/*autoload.php; do
        p=`echo $i | cut -d / -f 1`;
        r=`echo $i | cut -d / -f 2`;
        b=`echo $i | cut -d / -f 3`;

#       if test ! $p == "autoload"; then
#               if test ! $r == "releases"; then
#                       if test -L autoload/$b; then
#                               echo "Symlink for $b to $i exists."
#                       else
#                               echo "Creating symlink from $i to autoload/$b."
#                               ln -s "../$i" "autoload/$b"
#                       fi
#               fi
#       fi

        if [ "$p" != "autoload" ]; then
                if [ "$r" != "releases" ] ; then
                        if [ -L autoload/$b ]; then
                                echo "Symlink for $b to $i exists."
                        else
                                echo "Creating symlink from $i to autoload/$b."
                                ln -s "../$i" "autoload/$b"
                        fi
                fi
        fi

done

cd -

if test -d stable; then
        echo "Setting up environment for 'stable'"

        if test -d stable/autoload; then
                echo "Autoload directory exists."
        else
                echo "Creating missing 'autoload' directory."
                mkdir stable/autoload
        fi

        if ! test -L stable/autoload/base_autoload.php; then
                ln -s ../../trunk/Base/src/base_autoload.php 
stable/autoload/base_autoload.php
        fi

        if ! test -L stable/autoload/test_autoload.php; then
                ln -s ../../trunk/UnitTest/src/test_autoload.php
stable/autoload/test_autoload.php
        fi

        for i in Base UnitTest; do
                if ! test -L stable/$i; then
                        ln -s ../trunk/$i stable/$i
                fi
        done

        echo "- Creating autoload files:"

        for i in `cat stable/branch-info`; do
                componentName=`echo $i | cut -d / -f 1`;
                componentVersion=`echo $i | cut -d / -f 2`;
                echo '  - ' $componentName
                for j in stable/$i/src/*_autoload.php; do
                        targetFile='stable/autoload/'`echo $j | cut -d / -f 5`;
                        cat $j | sed
"s/$componentName\//$componentName\/$componentVersion\//g" >
$targetFile
                done
        done
fi




and it works now (for me)


-- 
José Moreira
* http://pt.linkedin.com/in/josemoreira
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to