Changeset 4431

Show
Ignore:
Timestamp:
04/14/09 23:32:57 (4 years ago)
Author:
jow
Message:

build/mklar.pl:

  • fix heisenbug with file list padding
  • call luac if available
  • include non-lua files
  • include cbi models and controllers
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/build/mklar.pl

    r4430 r4431  
    4040 
    4141    # Skip .svn foo 
    42     ( $File::Find::name !~ m{/\.svn\z} ) || return; 
    43  
    44     # Skip non-lua files 
    45     ( $File::Find::name =~ m{\.lua\z} ) || return; 
    46  
    47     # Skip i18n files 
    48     ( $File::Find::name !~ m{/i18n/} ) || return; 
    49      
    50     # Exclude cbi models and controllers for now 
    51     ( $File::Find::name !~ m{/controller/} && $File::Find::name !~ m{/model/cbi/} ) || return; 
     42    ( $File::Find::name !~ m{/\.svn\b} ) || return; 
    5243 
    5344    # Exclude luci-statistics and lucittpd for now 
     
    5849    $file =~ s{^.+/luasrc/}{luci/}; 
    5950 
    60     if( open F, "< $_" ) 
     51    my $command = ( $File::Find::name =~ m{\.lua\z} && $ENV{LUAC} ) 
     52        ? "$ENV{LUAC} -o - $_ |" : "< $_"; 
     53 
     54    if( open F, $command ) 
    6155    { 
    6256        warn sprintf "Member at 0x%08X: %s\n", $offset, $file; 
     
    6761 
    6862        $index[-1][0] = $offset; 
    69          
     63 
    7064        while( read F, my $buffer, 4096 ) { 
    7165            $size += length $buffer; 
     
    9892my $listsize = length $filelist; 
    9993push @index, [ $offset, $listsize, "", 0xFFFF, undef ]; 
    100 warn sprintf "Filelist at 0x%08X\n", $offset; 
     94 
     95warn sprintf "Filelist at 0x%08X, length 0x%08X\n", $offset, $listsize; 
     96 
     97print $filelist; 
     98$offset += $listsize; 
    10199 
    102100if( $listsize % 4 ) 
    103101{ 
    104     $listsize += ( 4 - ($listsize % 4) ); 
    105     $filelist .= "\0" x ( 4 - ($listsize % 4) ); 
     102    $offset += ( 4 - ($listsize % 4) ); 
     103    print "\0" x ( 4 - ($listsize % 4) ); 
    106104} 
    107  
    108 print $filelist; 
    109 $offset += $listsize; 
    110105 
    111106