Changeset 337

Show
Ignore:
Timestamp:
04/17/08 21:31:56 (2 years ago)
Author:
calh
Message:

don't copy the .svn files over - that would be dumb

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/xulrunner_locales/build.pl

    r335 r337  
    3232`rm $dir/??-??.*`; 
    3333 
    34 mkdir "$dir/build"
     34`mkdir $dir/build`
    3535`rm -r $dir/build/*`; 
    3636 
     
    4242        mkdir "$dir/build/locale/$locale"; 
    4343 
    44         `cp -r $dir/locale/en-US/* $dir/build/locale/$locale/`
     44        &copy_files_to("$dir/locale/en-US/", "$dir/build/locale/$locale/")
    4545 
    4646        if ($locale ne 'en-US'){ 
    4747 
    48                 `cp -r $dir/locale/$locale/* $dir/build/locale/$locale/`
     48                &copy_files_to("$dir/locale/$locale/", "$dir/build/locale/$locale/")
    4949        } 
    5050 
     
    8383 
    8484print "ok, all done!\n"; 
     85 
     86 
     87 
     88 
     89sub copy_files_to { 
     90 
     91        my ($src, $dst) = @_; 
     92 
     93        my @lines = split "\n", `find $src | grep -v .svn`; 
     94 
     95        my $src_q = quotemeta $src; 
     96 
     97        for my $file (@lines){ 
     98 
     99                $file =~ s/^$src_q//; 
     100 
     101                if (length $file){ 
     102 
     103                        if (-f "$src$file"){ 
     104 
     105                                `cp $src$file $dst$file`; 
     106                        } 
     107 
     108                        if (-d "$src$file" && !-d "$dst$file"){ 
     109 
     110                                `mkdir $dst$file`; 
     111                        } 
     112                } 
     113        } 
     114}