Subversion Repositories DevTools

Rev

Rev 409 | Rev 415 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 409 Rev 411
Line 59... Line 59...
59
#                        FindFiles              - Find a file
59
#                        FindFiles              - Find a file
60
#                        ResolveFile            - Resolve a 'local' source file
60
#                        ResolveFile            - Resolve a 'local' source file
61
#                        
61
#                        
62
#......................................................................#
62
#......................................................................#
63
 
63
 
64
require 5.6.1;
64
require 5.006_001;
65
use strict;
65
use strict;
66
use warnings;
66
use warnings;
67
 
67
 
68
use Getopt::Long;
68
use Getopt::Long;
69
use File::Path;
69
use File::Path;
Line 729... Line 729...
729
sub CopyDir
729
sub CopyDir
730
{
730
{
731
    my ($src_dir, $dst_dir, @opts) = @_;
731
    my ($src_dir, $dst_dir, @opts) = @_;
732
    my $opt_merge;
732
    my $opt_merge;
733
    my $opt_base;
733
    my $opt_base;
-
 
734
    my $from_interface = 0;
734
 
735
 
735
    $dst_dir = $DebianWorkDir . '/' . $dst_dir;
736
    $dst_dir = $DebianWorkDir . '/' . $dst_dir;
736
    $dst_dir =~ s~//~/~;
737
    $dst_dir =~ s~//~/~;
737
 
738
 
738
    #
739
    #
Line 760... Line 761...
760
            );
761
            );
761
            
762
            
762
            if ( exists $CopyDirSymbolic{$name} )
763
            if ( exists $CopyDirSymbolic{$name} )
763
            {
764
            {
764
                $opt_base = $CopyDirSymbolic{$name};
765
                $opt_base = $CopyDirSymbolic{$name};
-
 
766
 
-
 
767
                #
-
 
768
                #   If sourceing from interface, then follow
-
 
769
                #   symlinks in the copy. All files will be links anyway
-
 
770
                #
-
 
771
                $from_interface = 1
-
 
772
                    if ( $name =~ m~^interface~ );
765
            }
773
            }
766
            else
774
            else
767
            {
775
            {
768
                DebugDumpData ("CopyDirSymbolic", \%CopyDirSymbolic);
776
                DebugDumpData ("CopyDirSymbolic", \%CopyDirSymbolic);
769
                Error ("CopyDir: Unknown Source Name: $name" );
777
                Error ("CopyDir: Unknown Source Name: $name" );
Line 782... Line 790...
782
 
790
 
783
    #
791
    #
784
    #   If not merging then delete the target before copying
792
    #   If not merging then delete the target before copying
785
    #
793
    #
786
    rmtree( $dst_dir ) unless $opt_merge;
794
    rmtree( $dst_dir ) unless $opt_merge;
787
    mkdir ( $dst_dir );
795
    mkpath ( $dst_dir );
788
 
796
 
789
    my $cpflags = '-r';
797
    my $cpflags = '-r';
-
 
798
    $cpflags .= 'L' if ( $from_interface );
790
    $cpflags .= 'v' if ( $opt_verbose > 1 );
799
    $cpflags .= 'v' if ( $opt_verbose > 1 );
791
 
800
 
792
 
-
 
793
    #
801
    #
794
    #   Determine the complete list of source files
802
    #   Determine the complete list of source files
795
    #   Need to allow for files begining with a .
803
    #   Need to allow for files begining with a .
796
    #
804
    #
797
    opendir (DIR, $src_dir ) || Error ("CopyDir: Can't read directory: $src_dir");
805
    opendir (DIR, $src_dir ) || Error ("CopyDir: Can't read directory: $src_dir");
Line 800... Line 808...
800
 
808
 
801
    foreach ( @files  )
809
    foreach ( @files  )
802
    {
810
    {
803
        next if ( $_ eq '.' );
811
        next if ( $_ eq '.' );
804
        next if ( $_ eq '..' );
812
        next if ( $_ eq '..' );
-
 
813
        next if ( $_ eq '.svn' );
805
        System ('cp', $cpflags, "$src_dir/$_", $dst_dir );
814
        System ('cp', $cpflags, "$src_dir/$_", $dst_dir );
806
    }
815
    }
807
    #
816
    #
808
    #   Expand link files that may have been copied in
817
    #   Expand link files that may have been copied in
809
    #
818
    #