Subversion Repositories DevTools

Rev

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

Rev 423 Rev 425
Line 76... Line 76...
76
use JatsCopy ();                            # Don't import anything
76
use JatsCopy ();                            # Don't import anything
77
 
77
 
78
#
78
#
79
#   Globals
79
#   Globals
80
#
80
#
-
 
81
my $DebianWorkDirBase;                      # Workspace
81
my $DebianWorkDir;                          # Dir to create file system image within
82
my $DebianWorkDir;                          # Dir to create file system image within
82
 
83
 
83
#
84
#
84
#   Command line options
85
#   Command line options
85
#
86
#
Line 209... Line 210...
209
    ReadBuildConfig ($opt_interfacedir, $opt_platform, '--NoTest' );
210
    ReadBuildConfig ($opt_interfacedir, $opt_platform, '--NoTest' );
210
 
211
 
211
    #
212
    #
212
    #   Build the package image in a directory based on the target being created
213
    #   Build the package image in a directory based on the target being created
213
    #
214
    #
214
    $DebianWorkDir = "$opt_platform$opt_type.image/$opt_name";
215
    $DebianWorkDirBase = "$opt_platform$opt_type.image";
-
 
216
    $DebianWorkDir = "$DebianWorkDirBase/$opt_name";
215
 
217
 
216
    #
218
    #
217
    #   Configure the System command to fail on any error
219
    #   Configure the System command to fail on any error
218
    #
220
    #
219
    SystemConfig ( ExitOnError => 1 );
221
    SystemConfig ( ExitOnError => 1 );
Line 244... Line 246...
244
    #   Invoked during "make clean" or "make clobber"
246
    #   Invoked during "make clean" or "make clobber"
245
    #
247
    #
246
    if ( $opt_clean )
248
    if ( $opt_clean )
247
    {
249
    {
248
        Message ("Remove packaging directory: $DebianWorkDir");
250
        Message ("Remove packaging directory: $DebianWorkDir");
-
 
251
 
-
 
252
        #
-
 
253
        #   Remove the directory for this package
-
 
254
        #   Remove the general work dir - if all packages have been cleaned
-
 
255
        #
249
        rmtree( $DebianWorkDir );
256
        rmtree( $DebianWorkDir );
-
 
257
        rmdir( $DebianWorkDirBase );
250
        rmtree ($opt_output) if ( -f $opt_output );
258
        rmtree ($opt_output) if ( -f $opt_output );
251
        exit;
259
        exit;
252
    }
260
    }
253
 
261
 
254
    #
262
    #
Line 731... Line 739...
731
#                                 Symbolic Name
739
#                                 Symbolic Name
732
#                   $dst_dir    - Within the output workspace
740
#                   $dst_dir    - Within the output workspace
733
#                   Options
741
#                   Options
734
#                       --Merge             - Don't delete first
742
#                       --Merge             - Don't delete first
735
#                       --Source=Name       - Source via Symbolic Name
743
#                       --Source=Name       - Source via Symbolic Name
-
 
744
#                       --FromPackage       - Souve via package roots
736
#
745
#
737
# Returns         :
746
# Returns         :
738
#
747
#
739
sub CopyDir
748
sub CopyDir
740
{
749
{
Line 752... Line 761...
752
    foreach  ( @opts )
761
    foreach  ( @opts )
753
    {
762
    {
754
        if ( m/^--Merge/ ) {
763
        if ( m/^--Merge/ ) {
755
            $opt_merge = 1;
764
            $opt_merge = 1;
756
        } elsif ( m/^--Source=(.+)/ ) {
765
        } elsif ( m/^--Source=(.+)/ ) {
757
            my $name = lc($1);
766
            my $name = $1;
-
 
767
            Verbose2 ("CopyDir: Source: $name");
-
 
768
            Error ("Source directory can only be specified once")
-
 
769
                if ( defined $opt_base );
-
 
770
 
-
 
771
            $name = lc($name);
758
            my %CopyDirSymbolic = (
772
            my %CopyDirSymbolic = (
759
                'interfaceincdir'   => $opt_interfaceincdir,
773
                'interfaceincdir'   => $opt_interfaceincdir,
760
                'interfacelibdir'   => $opt_interfacelibdir,
774
                'interfacelibdir'   => $opt_interfacelibdir,
761
                'interfacebindir'   => $opt_interfacebindir,
775
                'interfacebindir'   => $opt_interfacebindir,
762
                'libdir'            => $opt_libdir,
776
                'libdir'            => $opt_libdir,
Line 784... Line 798...
784
            else
798
            else
785
            {
799
            {
786
                DebugDumpData ("CopyDirSymbolic", \%CopyDirSymbolic);
800
                DebugDumpData ("CopyDirSymbolic", \%CopyDirSymbolic);
787
                Error ("CopyDir: Unknown Source Name: $name" );
801
                Error ("CopyDir: Unknown Source Name: $name" );
788
            }
802
            }
-
 
803
 
-
 
804
        } elsif ( m/^--FromPackage/ ) {
-
 
805
            Verbose2 ("CopyDir: FromPackage: $src_dir");
-
 
806
            Error ("Source directory can only be specified once")
-
 
807
                if ( defined $opt_base );
-
 
808
 
-
 
809
            my @path;
-
 
810
            foreach my $entry ( getPackageList() )
-
 
811
            {
-
 
812
                my $base = $entry->getBase(3);
-
 
813
                next unless ( defined $base );
-
 
814
                if ( -d $base . '/' . $src_dir )
-
 
815
                {
-
 
816
                    push @path, $base;
-
 
817
                }
-
 
818
            }
-
 
819
 
-
 
820
            Error ("CopyDir: Cannot find source dir in any package: $src_dir")
-
 
821
                if ( $#path < 0 );
-
 
822
            Error ("CopyDir: Requested path found in mutiple packages: $src_dir",
-
 
823
                    @path ) if ( $#path > 0 );
-
 
824
            $opt_base = pop @path;
-
 
825
 
-
 
826
            #
-
 
827
            #   If sourceing from interface, then follow symlinks in the copy.
-
 
828
            #   All files will be links anyway
-
 
829
            #
-
 
830
            #   This is a very ugly test for 'interface'
-
 
831
            #
-
 
832
            $from_interface = 1
-
 
833
                if ( $opt_base =~ m~/interface/~ );
-
 
834
 
789
        } else {
835
        } else {
790
            Error ("CopyDir: Unknown option: $_" );
836
            Error ("CopyDir: Unknown option: $_" );
791
        }
837
        }
792
    }
838
    }
793
 
839