classes/BuildTasks.php
static function run_generate_package_filelist( $task=null, $args=array(), $cliopts=array() )
    {
        $opts = self::getOpts( @$args[0], @$args[1], $cliopts );
        if ( $opts['create']['ezpackage'] || $opts['create']['pearpackage'] )
        {
            if ( !SharedLock::acquire( $opts['extension']['name'], LOCK_EX, $opts ) )
                throw new PakeException( "Source code locked by another process" );

            $doc = new DOMDocument( '1.0', 'utf-8' );
            $doc->formatOutput = true;

            $packageRoot = $doc->createElement( 'extension' );
            $packageRoot->setAttribute( 'name', $opts['extension']['name'] );

            $rootpath =  pakeFinder::type( 'directory' )->name( $opts['extension']['name'] )->in( self::getBuildDir( $opts ) );
            $dirs =  pakeFinder::type( 'directory' )->in( self::getBuildDir( $opts ) . '/' . $opts['extension']['name'] );
            foreach( $dirs as $dir )
            {
                $name = basename( $dir );
                $path = dirname( $dir );
                $path = str_replace( array( $rootpath[0], '\\' ), array( '', '/' ), $path );
                $fileNode = $doc->createElement( 'file' );
                $fileNode->setAttribute( 'name', $name );
                if ( $path )
                    $fileNode->setAttribute( 'path', $path );
                $fileNode->setAttribute( 'type', 'dir' );
                $packageRoot->appendChild( $fileNode );
            }
            $files =  pakeFinder::type( 'file' )->in( self::getBuildDir( $opts ) . '/' . $opts['extension']['name'] );
            foreach( $files as $file )
            {
                //$dir = ;
                $name = basename( $file );
                $path = dirname( $file );
                $path = str_replace( array( $rootpath[0], '\\' ), array( '', '/' ), $path );
                $fileNode = $doc->createElement( 'file' );
                $fileNode->setAttribute( 'name', $name );
                if ( $path )
                    $fileNode->setAttribute( 'path', $path );
                $fileNode->setAttribute( 'md5sum', md5_file( $file ) );
                $packageRoot->appendChild( $fileNode );
            }
            $doc->appendChild( $packageRoot );

            $doc->save( self::getBuildDir( $opts ) . '/extension-' . $opts['extension']['name'] . '.xml' );
            pake_echo_action( 'file+', self::getBuildDir( $opts ) . '/extension-' . $opts['extension']['name'] . '.xml' );

            SharedLock::release( $opts['extension']['name'], LOCK_EX, $opts );
        }
    }
static function run_generate_package_filelist( $task=null, $args=array(), $cliopts=array() )
    {
        $opts = self::getOpts( @$args[0], @$args[1], $cliopts );
        if ( $opts['create']['ezpackage'] || $opts['create']['pearpackage'] )
        {
            if ( !SharedLock::acquire( $opts['extension']['name'], LOCK_EX, $opts ) )
                throw new PakeException( "Source code locked by another process" );

            $doc = new DOMDocument( '1.0', 'utf-8' );
            $doc->formatOutput = true;

            $packageRoot = $doc->createElement( 'extension' );
            $packageRoot->setAttribute( 'name', $opts['extension']['name'] );

            $rootpath =  pakeFinder::type( 'directory' )->name( $opts['extension']['name'] )->in( self::getBuildDir( $opts ) );
            $dirs =  pakeFinder::type( 'directory' )->in( self::getBuildDir( $opts ) . '/' . $opts['extension']['name'] );
            foreach( $dirs as $dir )
            {
                $name = basename( $dir );
                $path = dirname( $dir );
                $path = str_replace( array( $rootpath[0], '\\' ), array( '', '/' ), $path );
                $fileNode = $doc->createElement( 'file' );
                $fileNode->setAttribute( 'name', $name );
                if ( $path )
                    $fileNode->setAttribute( 'path', $path );
                $fileNode->setAttribute( 'type', 'dir' );
                $packageRoot->appendChild( $fileNode );
            }
            $files =  pakeFinder::type( 'file' )->in( self::getBuildDir( $opts ) . '/' . $opts['extension']['name'] );
            foreach( $files as $file )
            {
                //$dir = ;
                $name = basename( $file );
                $path = dirname( $file );
                $path = str_replace( array( $rootpath[0], '\\' ), array( '', '/' ), $path );
                $fileNode = $doc->createElement( 'file' );
                $fileNode->setAttribute( 'name', $name );
                if ( $path )
                    $fileNode->setAttribute( 'path', $path );
                $fileNode->setAttribute( 'md5sum', md5_file( $file ) );
                $packageRoot->appendChild( $fileNode );
            }
            $doc->appendChild( $packageRoot );

            $doc->save( self::getBuildDir( $opts ) . '/extension-' . $opts['extension']['name'] . '.xml' );
            pake_echo_action( 'file+', self::getBuildDir( $opts ) . '/extension-' . $opts['extension']['name'] . '.xml' );

            SharedLock::release( $opts['extension']['name'], LOCK_EX, $opts );
        }
    }
Generates the xml file listing all the files in the extension that is used as
part of an eZ Package description.

This task is only run if in the configuration file package creation is specified.