Ticket #347: tt347-install_files.patch

File tt347-install_files.patch, 1.8 KB (added by rurban, 13 years ago)
  • tools/dev/install_files.pl

    old new  
    190190        my $copy = $dest; 
    191191        $dest =~ s/^installable_//;            # parrot with different config 
    192192        $dest = File::Spec->catdir( $options{bindir}, $dest ); 
     193        # TODO track bin here to check later below 
    193194        if ( $copy =~ /^installable/ ) { 
    194195            push @installable_exe, [ $src, $dest ]; 
    195196            next; 
     
    246247        } 
    247248    } 
    248249} 
     250# TT #347 
     251# 1. skip build_dir-only binaries for @installable_exe 
     252for (@installable_exe) { 
     253    my ( $i, $dest ) = @$_; 
     254    my ($file) = $i =~ /installable_(.+)$/; 
     255    next unless $file; 
     256    my @f = map { $_ ? $_->[0] : '' } @files; 
     257    if (grep(/^$file$/, @f)) { 
     258        if (-e $file) { 
     259            print "skipping $file, using installable_$file instead\n"; 
     260            @files = map {$_ and $_->[0] !~ /^$file$/ ? $_ : undef} @files; 
     261        } 
     262    } 
     263} 
     264# 2. for every .exe check if there's an installable. fail if not 
     265foreach my $f (@files ) { 
     266    next unless $_; 
     267    my ( $f, $dest ) = @$_; 
     268    # this logic will fail on non-win32 if the generated files 
     269    # are really generated as planned. Here we don't have [main]bin here. 
     270    my $i = "installable_$f" if $f =~ /\.exe$/; 
     271    next unless $i; 
     272    unless (map {$_->[0] =~ /^$i$/} @installable_exe) { 
     273        die "$i is missing in MANIFEST or MANIFEST.generated\n"; 
     274    } 
     275} 
    249276print("Installing ...\n"); 
    250277foreach ( @files, @installable_exe ) { 
     278    next unless $_; 
    251279    my ( $src, $dest ) = @$_; 
    252280    $dest = $options{destdir} . $dest; 
    253281    if ( $options{'dry-run'} ) {