Subversion Repositories DevTools

Rev

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

Rev 421 Rev 423
Line 71... Line 71...
71
use File::Find;
71
use File::Find;
72
use JatsSystem;
72
use JatsSystem;
73
use FileUtils;
73
use FileUtils;
74
use JatsError;
74
use JatsError;
75
use ReadBuildConfig;
75
use ReadBuildConfig;
-
 
76
use JatsCopy ();                            # Don't import anything
76
 
77
 
77
#
78
#
78
#   Globals
79
#   Globals
79
#
80
#
80
my $DebianWorkDir;                          # Dir to create file system image within
81
my $DebianWorkDir;                          # Dir to create file system image within
Line 728... Line 729...
728
#
729
#
729
# Inputs          : $src_dir    - Local to the user
730
# Inputs          : $src_dir    - Local to the user
730
#                                 Symbolic Name
731
#                                 Symbolic Name
731
#                   $dst_dir    - Within the output workspace
732
#                   $dst_dir    - Within the output workspace
732
#                   Options
733
#                   Options
733
#                       --Merge
734
#                       --Merge             - Don't delete first
734
#                       --
735
#                       --Source=Name       - Source via Symbolic Name
735
#
736
#
736
# Returns         :
737
# Returns         :
737
#
738
#
738
sub CopyDir
739
sub CopyDir
739
{
740
{
Line 796... Line 797...
796
 
797
 
797
    Verbose ("CopyDir: $src_dir, $dst_dir");
798
    Verbose ("CopyDir: $src_dir, $dst_dir");
798
    Error ("CopyDir: Directory not found: $src_dir") unless ( -d $src_dir );
799
    Error ("CopyDir: Directory not found: $src_dir") unless ( -d $src_dir );
799
 
800
 
800
    #
801
    #
801
    #   If not merging then delete the target before copying
802
    #   Setup the copy options
802
    #
803
    #
803
    rmtree( $dst_dir ) unless $opt_merge;
804
    my %copyOpts;
804
    mkpath ( $dst_dir );
805
    $copyOpts{'IgnoreDirs'} = ['.svn'];
805
 
-
 
806
    my $cpflags = '-r';
806
    $copyOpts{'EmptyDirs'} = 1;
807
    $cpflags .= 'L' if ( $from_interface );
807
    $copyOpts{'DeleteFirst'} = 1 unless $opt_merge;
808
    $cpflags .= 'v' if ( $opt_verbose > 1 );
808
    $copyOpts{'Log'} = 1 if ( $opt_verbose > 1 );
-
 
809
    $copyOpts{'DuplicateLinks'} = 1 unless ( $from_interface );
809
 
810
 
810
    #
811
    #
811
    #   Determine the complete list of source files
-
 
812
    #   Need to allow for files begining with a .
812
    #   Transfer the directory
813
    #
813
    #
814
    opendir (DIR, $src_dir ) || Error ("CopyDir: Can't read directory: $src_dir");
814
    JatsCopy::CopyDir ( $src_dir, $dst_dir, \%copyOpts );
815
    my @files = readdir(DIR);
-
 
816
    closedir(DIR);
-
 
817
 
815
 
818
    foreach ( @files  )
-
 
819
    {
-
 
820
        next if ( $_ eq '.' );
-
 
821
        next if ( $_ eq '..' );
-
 
822
        next if ( $_ eq '.svn' );
-
 
823
        System ('cp', $cpflags, "$src_dir/$_", $dst_dir );
-
 
824
    }
-
 
825
    #
816
    #
826
    #   Expand link files that may have been copied in
817
    #   Expand link files that may have been copied in
827
    #
818
    #
828
    Verbose ("Locate LINKFILES in $DebianWorkDir");
819
    Verbose ("Locate LINKFILES in $DebianWorkDir");
829
    ExpandLinkFiles();
820
    ExpandLinkFiles();