Subversion Repositories DevTools

Rev

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

Rev 6992 Rev 7398
Line 40... Line 40...
40
#                   
40
#                   
41
#                   --ZipFile[=TemplateName]            - Create named .zip file, of the data area [not Debian scripts]
41
#                   --ZipFile[=TemplateName]            - Create named .zip file, of the data area [not Debian scripts]
42
#                   --ZipFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
42
#                   --ZipFile                           - Same as --TarFile=PACKAGE_VERSION_PLATFORM_TYPE or PACKAGE_VERSION_PLATFORM
43
#                   --ZipOnly                           - Suppress the Debian Build
43
#                   --ZipOnly                           - Suppress the Debian Build
44
#                   
44
#                   
-
 
45
#                   --ImageOnly                         - Only generate the filesystem image. No Tar, NoZip, NoDebian ...
-
 
46
#                   --DirectPkg                         - Construct directly into the pkg directory within the output . No Tar, NoZip, NoDebian ...
-
 
47
#
45
#
48
#
46
#               Templates may contain:
49
#               Templates may contain:
47
#                   PACKAGE
50
#                   PACKAGE
48
#                   VARIANT
51
#                   VARIANT
49
#                   VERSION
52
#                   VERSION
Line 90... Line 93...
90
    my $tarFileName = '';
93
    my $tarFileName = '';
91
 
94
 
92
    my $zipOnly;
95
    my $zipOnly;
93
    my $zipFileName = '';
96
    my $zipFileName = '';
94
 
97
 
-
 
98
    my $imageOnly;
-
 
99
    my $directPkg;
-
 
100
 
95
    my @outputFiles;
101
    my @outputFiles;
96
    my @optArgs;
102
    my @optArgs;
97
    my $noArch;
103
    my $noArch;
98
 
104
 
99
    my @arglist;
105
    my @arglist;
Line 157... Line 163...
157
        } elsif ( m/^--ZipOnly$/i ) {
163
        } elsif ( m/^--ZipOnly$/i ) {
158
            $zipOnly = 1;
164
            $zipOnly = 1;
159
 
165
 
160
        } elsif ( m/^--ZipFile(=(.*))?/i ) {
166
        } elsif ( m/^--ZipFile(=(.*))?/i ) {
161
            $zipFileName = defined($1) ? $2 : 'DEFAULT';
167
            $zipFileName = defined($1) ? $2 : 'DEFAULT';
-
 
168
 
-
 
169
        } elsif ( m/^--ImageOnly$/i ) {
-
 
170
            $imageOnly = 1;
-
 
171
 
-
 
172
        } elsif ( m/^--DirectPkg$/i ) {
-
 
173
            $directPkg = 1;
162
            
174
            
163
        } elsif ( m/^--/ ) {
175
        } elsif ( m/^--/ ) {
164
            ReportError("MakeDebianPackage. Unknown option: $_");
176
            ReportError("MakeDebianPackage. Unknown option: $_");
165
 
177
 
166
        } else {
178
        } else {
Line 169... Line 181...
169
    }
181
    }
170
 
182
 
171
    #
183
    #
172
    #   Sanity test
184
    #   Sanity test
173
    #
185
    #
174
    ReportError ("MakeDebianPackage: Not supported on a GENERIC target") if ( $ScmPlatform eq 'GENERIC' && !($zipOnly || $tarOnly )  );
186
    ReportError ("MakeDebianPackage: Not supported on a GENERIC target") if ( $ScmPlatform eq 'GENERIC' && !($zipOnly || $tarOnly || $imageOnly )  );
175
    ReportError ("MakeDebianPackage: Script name not defined") unless ( $debianScript || $rpmScript );
187
    ReportError ("MakeDebianPackage: Script name not defined") unless ( $debianScript || $rpmScript );
176
    ReportError ("MakeDebianPackage: --Name option can only be used once") if ( $name_set > 1 );
188
    ReportError ("MakeDebianPackage: --Name option can only be used once") if ( $name_set > 1 );
177
    ReportError ("MakeDebianPackage: --Variant option can only be used once") if ( $variant_set > 1 );
189
    ReportError ("MakeDebianPackage: --Variant option can only be used once") if ( $variant_set > 1 );
178
    ReportError ("MakeDebianPackage: --VersionPrefix option can only be used once") if ( $version_prefix_set > 1 );
190
    ReportError ("MakeDebianPackage: --VersionPrefix option can only be used once") if ( $version_prefix_set > 1 );
179
    ReportError ("MakeDebianPackage: --ExtDesc option can only be used once") if ( $extdesc_set > 1 );
191
    ReportError ("MakeDebianPackage: --ExtDesc option can only be used once") if ( $extdesc_set > 1 );
-
 
192
    ReportError ("MakeDebianPackage: --DirectPkg cannot be used with Tar options") if ( $directPkg && ($tarOnly || $tarFileName)  );
-
 
193
    ReportError ("MakeDebianPackage: --DirectPkg cannot be used with Zip options") if ( $directPkg && ($zipOnly || $zipFileName)  );
-
 
194
    ReportError ("MakeDebianPackage: --ImageOnly cannot be used with Tar options") if ( $imageOnly && ($tarOnly || $tarFileName)  );
-
 
195
    ReportError ("MakeDebianPackage: --ImageOnly cannot be used with Zip options") if ( $imageOnly && ($zipOnly || $zipFileName)  );
-
 
196
    ReportError ("MakeDebianPackage: --ZipOnly used without --ZipFile") if ( ($zipOnly && ! $zipFileName)  );
-
 
197
    ReportError ("MakeDebianPackage: --TarOnly used without --TarFile") if ( ($tarOnly && ! $tarFileName)  );
-
 
198
    ReportError ("MakeDebianPackage: --DirectPkg cannot be used with --ImageOnly") if ( $directPkg && $imageOnly );
180
    ErrorDoExit();
199
    ErrorDoExit();
181
 
200
 
182
    #
201
    #
183
    #   Determine what we are really doing
202
    #   Determine what we are really doing
184
    #       Under Redhat we will generate an RPM
203
    #       Under Redhat we will generate an RPM
Line 270... Line 289...
270
            push @optArgs, "-NoArch";
289
            push @optArgs, "-NoArch";
271
        }
290
        }
272
 
291
 
273
    my $PkgName = "${build_name}_${build_version}_${Platform}${PkgType}.deb";
292
    my $PkgName = "${build_name}_${build_version}_${Platform}${PkgType}.deb";
274
    push @optArgs, "-PkgArch=$PkgArch";
293
    push @optArgs, "-PkgArch=$PkgArch";
275
    unless ($tarOnly || $zipOnly) {
294
    unless ($tarOnly || $zipOnly || $imageOnly || $directPkg) {
276
        push (@outputFiles, $PkgName);
295
        push (@outputFiles, $PkgName);
277
        push @optArgs, "-Output=--GeneratedProg{$PkgName}";
296
        push @optArgs, "-Output=--GeneratedProg{$PkgName}";
278
    }
297
    }
279
 
298
 
280
    #
299
    #
Line 332... Line 351...
332
        $zipFileName =~ s~TYPE~\$(GBE_TYPE)~;
351
        $zipFileName =~ s~TYPE~\$(GBE_TYPE)~;
333
        $zipFileName .= '.zip' unless $zipFileName =~ m~\.zip$~;
352
        $zipFileName .= '.zip' unless $zipFileName =~ m~\.zip$~;
334
        push @outputFiles,  $zipFileName;
353
        push @outputFiles,  $zipFileName;
335
 
354
 
336
        push @optArgs, "-ZipFile=--GeneratedProg{$zipFileName}";
355
        push @optArgs, "-ZipFile=--GeneratedProg{$zipFileName}";
337
#        push @optArgs, "-TarFile=$zipFileName";
-
 
338
        push (@optArgs, '-ZipOnly' ) if $zipOnly;
356
        push (@optArgs, '-ZipOnly' ) if $zipOnly;
339
    }
357
    }
340
 
358
 
341
    #
359
    #
-
 
360
    #   Only generating an image
-
 
361
    #   No output files created
-
 
362
    #   
-
 
363
    if ($imageOnly) {
-
 
364
        push (@optArgs, '-ImageOnly' );
-
 
365
        push (@optArgs, '--NoGenerate' );
-
 
366
    }
-
 
367
    if ($directPkg) {
-
 
368
        push (@optArgs, '-DirectPkg' );
-
 
369
        push (@optArgs, '--NoGenerate' );
-
 
370
    }
-
 
371
 
-
 
372
    #
342
    #   Simply use Generate Files
373
    #   Simply use Generate Files
343
    #       With lots of options
374
    #       With lots of options
344
    #
375
    #
345
    Src ( '*', $script );
376
    Src ( '*', $script );
346
    GenerateFiles ('*', "--Tool=DebianPackager.pl",               # Associated tool
377
    GenerateFiles ('*', "--Tool=DebianPackager.pl",               # Associated tool