Subversion Repositories DevTools

Rev

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

Rev 1123 Rev 1125
Line 27... Line 27...
27
 
27
 
28
#
28
#
29
#   Globals
29
#   Globals
30
#
30
#
31
my @Manifests;                      # Manifest entries
31
my @Manifests;                      # Manifest entries
-
 
32
my $Manifest_has_version = 1;       # Create Manifest_xxxx by default
32
my %package_dirs;                   # Package dirs discovered and used
33
my %package_dirs;                   # Package dirs discovered and used
-
 
34
my $pkg_subdir;                     # Alternate packaging
33
 
35
 
34
#-------------------------------------------------------------------------------
36
#-------------------------------------------------------------------------------
35
# Function        : BEGIN
37
# Function        : BEGIN
36
#
38
#
37
# Description     : Setup directive hooks
39
# Description     : Setup directive hooks
Line 60... Line 62...
60
#                       --Architecture=xxxx     - Default actitecture is the current target
62
#                       --Architecture=xxxx     - Default actitecture is the current target
61
#                       --Product=yyyy          - Product Family
63
#                       --Product=yyyy          - Product Family
62
#                       --Debian=BaseName[,--Prod,--Debug,--Arch=xxxx,--Product=yyyy]
64
#                       --Debian=BaseName[,--Prod,--Debug,--Arch=xxxx,--Product=yyyy]
63
#                       --MugPackage=Package[,--Subdir=subdir[,subdir]+]
65
#                       --MugPackage=Package[,--Subdir=subdir[,subdir]+]
64
#                       --SrcFile=xxx
66
#                       --SrcFile=xxx
-
 
67
#                       --SrcFileNoCopy=xxx
65
#                       --Comment=xxx           - Add comment to Manifst
68
#                       --Comment=xxx           - Add comment to Manifst
-
 
69
#                       --NoManifestVersion     - Create unversioned Manifest File
-
 
70
#                       --PkgSubdir=xxx         - Specifies packaging subdir
66
#
71
#
67
# Returns         : Nothing
72
# Returns         : Nothing
68
#
73
#
69
sub ManifestFiles
74
sub ManifestFiles
70
{
75
{
Line 110... Line 115...
110
            push @files, {'file' => LocateDebianFile($1, $default_arch, $default_prod)};
115
            push @files, {'file' => LocateDebianFile($1, $default_arch, $default_prod)};
111
 
116
 
112
        } elsif ( m~^--SrcFile=(.+)~ ) {
117
        } elsif ( m~^--SrcFile=(.+)~ ) {
113
            push @files, {'file' => LocatePreReq($1)};
118
            push @files, {'file' => LocatePreReq($1)};
114
            
119
            
-
 
120
        } elsif ( m~^--SrcFileNoCopy=(.+)~ ) {
-
 
121
            push @files, {'filenocopy' => $1};
-
 
122
            
115
        } elsif ( m~^--MugPackage=(.+)~ ) {
123
        } elsif ( m~^--MugPackage=(.+)~ ) {
116
            if ( $mug_dir )
124
            if ( $mug_dir )
117
            {
125
            {
118
                ReportError ("ManifestFiles:--MugPackage option is only allowed once");
126
                ReportError ("ManifestFiles:--MugPackage option is only allowed once");
119
                next;
127
                next;
Line 124... Line 132...
124
            $default_arch = $2;
132
            $default_arch = $2;
125
 
133
 
126
        } elsif ( m/^--Product=(.+)/ ) {
134
        } elsif ( m/^--Product=(.+)/ ) {
127
            $default_prod = $1;
135
            $default_prod = $1;
128
 
136
 
-
 
137
        } elsif ( m/^--NoManifestVersion/i ) {
-
 
138
            $Manifest_has_version = 0;
-
 
139
 
-
 
140
        } elsif ( m/^--PkgSubdir=(.+)/i ) {
-
 
141
            if ( $pkg_subdir )
129
            
142
            {
-
 
143
                ReportError ("ManifestFiles:--MugPackage option is only allowed once");
-
 
144
                next;
-
 
145
            }
-
 
146
            $pkg_subdir = $1;
-
 
147
 
130
        } else {
148
        } else {
131
            ReportError ("ManifestFiles: Unknown option or argument: $_");
149
            ReportError ("ManifestFiles: Unknown option or argument: $_");
132
 
150
 
133
        }
151
        }
134
    }
152
    }
Line 154... Line 172...
154
    my %data;
172
    my %data;
155
    $data{tier} = $tier;
173
    $data{tier} = $tier;
156
    $data{name} = $name;
174
    $data{name} = $name;
157
    $data{files} = \@files;
175
    $data{files} = \@files;
158
    $data{mugdir} = $mug_dir;
176
    $data{mugdir} = $mug_dir;
-
 
177
    $data{pkgsubdir} = $pkg_subdir;
159
 
178
 
160
    push @Manifests, \%data;
179
    push @Manifests, \%data;
161
    return;
180
    return;
162
 
181
 
163
    #-------------------------------------------------------------------------------
182
    #-------------------------------------------------------------------------------
Line 328... Line 347...
328
    #
347
    #
329
    return unless ( @Manifests );
348
    return unless ( @Manifests );
330
#DebugDumpData ( "Manifests", \@Manifests );
349
#DebugDumpData ( "Manifests", \@Manifests );
331
 
350
 
332
    #
351
    #
-
 
352
    #   Determine the target packaging directory
-
 
353
    #   Default is .../mug
-
 
354
    #
-
 
355
    my $pkgdir = 'mug';
-
 
356
    if ( exists $Manifests[0]->{pkgsubdir} )
-
 
357
    {
-
 
358
        my $subdir = $Manifests[0]->{pkgsubdir};
-
 
359
        $pkgdir .= '/' . $subdir;
-
 
360
        $pkgdir =~ s~^mug/mug~mug~;
-
 
361
    }
-
 
362
 
-
 
363
    #
333
    #   Create the Manifest File as we process the lists
364
    #   Create the Manifest File as we process the lists
334
    #   Place this in the local directory:
365
    #   Place this in the 'lib' directory:
335
    #       - So that it will be deleted on clobber
366
    #       - So that it will be deleted on clobber
336
    #       - So that it can be placed in a target-specific subdir
367
    #       - So that it can be placed in a target-specific subdir
-
 
368
    #       - So that we can have one per makefile.pl
337
    #
369
    #
338
    Error ("ManifestFiles: Needs local directory specified in build.pl") unless ( $::ScmLocal );
370
    Error ("ManifestFiles: Needs local directory specified in build.pl") unless ( $::ScmLocal );
339
 
371
 
340
    my $manifest_dir = "$::ScmRoot/$::ScmLocal/Manifest/$::ScmPlatform";
372
    my $manifest_dir = "$::ScmPlatform.LIB";
341
    System( "$::GBE_BIN/mkdir -p $manifest_dir" );
373
    System( "$::GBE_BIN/mkdir -p $manifest_dir" );
342
 
374
 
343
    my $manifest_file = $manifest_dir . '/Manifest_' . $::ScmBuildVersion;
375
    my $manifest_file = $manifest_dir . '/Manifest';
-
 
376
    $manifest_file .= '_' . $::ScmBuildVersion if ( $Manifest_has_version );
-
 
377
    ToolsetGenerate( $manifest_file );
344
    Verbose ("ManifestFiles_Generate: File: $manifest_file");
378
    Verbose ("ManifestFiles_Generate: File: $manifest_file");
345
    
379
    
346
    PackageFile ('*', $manifest_file, '--Subdir=mug', '--Strip' );
380
    PackageFile ('*', $manifest_file, '--Subdir=' . $pkgdir, '--Strip' );
347
 
381
 
348
    open (MF, '>', $manifest_file ) || Error ("Cannot create the Manifest file: $manifest_file");
382
    open (MF, '>', $manifest_file ) || Error ("Cannot create the Manifest file: $manifest_file");
349
 
383
 
350
    print_mf ("# PackageName: $::ScmBuildPackage");
384
    print_mf ("# PackageName: $::ScmBuildPackage");
351
    print_mf ("# PackageVersion: $::ScmBuildVersion");
385
    print_mf ("# PackageVersion: $::ScmBuildVersion");
Line 353... Line 387...
353
    print_mf ("#");
387
    print_mf ("#");
354
    print_mf ("[Version],$::ScmBuildVersion");
388
    print_mf ("[Version],$::ScmBuildVersion");
355
    print_mf ("#");
389
    print_mf ("#");
356
 
390
 
357
    #
391
    #
358
    #   Process each tire in the order presented in the source file
392
    #   Process each tier in the order presented in the source file
359
    #
393
    #
360
    my $last_was_comment = 0;
394
    my $last_was_comment = 0;
361
    foreach my $entry ( @Manifests )
395
    foreach my $entry ( @Manifests )
362
    {
396
    {
363
    print_mf ("#");
397
    print_mf ("#");
Line 389... Line 423...
389
            print_mf ('#') if ( $last_was_comment );
423
            print_mf ('#') if ( $last_was_comment );
390
            if ( my $file = $fentry->{'file'} )
424
            if ( my $file = $fentry->{'file'} )
391
            {
425
            {
392
                my $base_file = StripDir( $file );
426
                my $base_file = StripDir( $file );
393
                print_mf ("$name,$tier,$base_file");
427
                print_mf ("$name,$tier,$base_file");
394
                PackageFile ('*', $file, '--Subdir=mug', '--Strip' );
428
                PackageFile ('*', $file, '--Subdir=' . $pkgdir, '--Strip' );
-
 
429
                $last_was_comment = 0;
-
 
430
            }
-
 
431
 
-
 
432
            if ( my $file = $fentry->{'filenocopy'} )
-
 
433
            {
-
 
434
                print_mf ("$name,$tier,$file");
395
                $last_was_comment = 0;
435
                $last_was_comment = 0;
396
            }
436
            }
397
        }
437
        }
398
 
438
 
399
        #
439
        #