Просмотр исходного кода

Dpkg::Build::Types: Remove BUILD_SOURCE composite constants

These are very specialized and not used often, let's compose them from
basic types when needed.
Guillem Jover лет назад: 10
Родитель
Сommit
9c9fc468fe
4 измененных файлов с 11 добавлено и 26 удалено
  1. 2 18
      scripts/Dpkg/Build/Types.pm
  2. 2 2
      scripts/dpkg-buildpackage.pl
  3. 2 2
      scripts/dpkg-genchanges.pl
  4. 5 4
      scripts/t/Dpkg_Build_Types.t

+ 2 - 18
scripts/Dpkg/Build/Types.pm

@@ -26,8 +26,6 @@ our @EXPORT = qw(
     BUILD_ARCH_DEP
     BUILD_ARCH_DEP
     BUILD_ARCH_INDEP
     BUILD_ARCH_INDEP
     BUILD_BINARY
     BUILD_BINARY
-    BUILD_SOURCE_DEP
-    BUILD_SOURCE_INDEP
     BUILD_FULL
     BUILD_FULL
     build_has
     build_has
     build_has_not
     build_has_not
@@ -78,14 +76,6 @@ This build includes architecture independent binary artifacts.
 
 
 This build includes binary artifacts.
 This build includes binary artifacts.
 
 
-=item BUILD_SOURCE_DEP
-
-This build includes source and architecture dependent binary artifacts.
-
-=item BUILD_SOURCE_INDEP
-
-This build includes source and architecture independent binary artifacts.
-
 =item BUILD_FULL
 =item BUILD_FULL
 
 
 This build includes source and binary artifacts.
 This build includes source and binary artifacts.
@@ -101,14 +91,8 @@ use constant {
 };
 };
 
 
 # Composed types.
 # Composed types.
-use constant {
-    BUILD_BINARY       => BUILD_ARCH_DEP | BUILD_ARCH_INDEP,
-    BUILD_SOURCE_DEP   => BUILD_SOURCE | BUILD_ARCH_DEP,
-    BUILD_SOURCE_INDEP => BUILD_SOURCE | BUILD_ARCH_INDEP,
-};
-use constant {
-    BUILD_FULL         => BUILD_BINARY | BUILD_SOURCE,
-};
+use constant BUILD_BINARY => BUILD_ARCH_DEP | BUILD_ARCH_INDEP;
+use constant BUILD_FULL   => BUILD_BINARY | BUILD_SOURCE;
 
 
 my $current_type = BUILD_FULL | BUILD_DEFAULT;
 my $current_type = BUILD_FULL | BUILD_DEFAULT;
 my $current_option = undef;
 my $current_option = undef;

+ 2 - 2
scripts/dpkg-buildpackage.pl

@@ -278,10 +278,10 @@ while (@ARGV) {
 	set_build_type(BUILD_SOURCE, $_);
 	set_build_type(BUILD_SOURCE, $_);
 	push @changes_opts, '-S';
 	push @changes_opts, '-S';
     } elsif (/^-G$/) {
     } elsif (/^-G$/) {
-	set_build_type(BUILD_SOURCE_DEP, $_);
+	set_build_type(BUILD_SOURCE | BUILD_ARCH_DEP, $_);
 	push @changes_opts, '-G';
 	push @changes_opts, '-G';
     } elsif (/^-g$/) {
     } elsif (/^-g$/) {
-	set_build_type(BUILD_SOURCE_INDEP, $_);
+	set_build_type(BUILD_SOURCE | BUILD_ARCH_INDEP, $_);
 	push @changes_opts, '-g';
 	push @changes_opts, '-g';
     } elsif (/^-F$/) {
     } elsif (/^-F$/) {
 	set_build_type(BUILD_FULL, $_);
 	set_build_type(BUILD_FULL, $_);

+ 2 - 2
scripts/dpkg-genchanges.pl

@@ -134,9 +134,9 @@ while (@ARGV) {
     } elsif (m/^-S$/) {
     } elsif (m/^-S$/) {
 	set_build_type(BUILD_SOURCE, $_);
 	set_build_type(BUILD_SOURCE, $_);
     } elsif (m/^-G$/) {
     } elsif (m/^-G$/) {
-	set_build_type(BUILD_SOURCE_DEP, $_);
+	set_build_type(BUILD_SOURCE | BUILD_ARCH_DEP, $_);
     } elsif (m/^-g$/) {
     } elsif (m/^-g$/) {
-	set_build_type(BUILD_SOURCE_INDEP, $_);
+	set_build_type(BUILD_SOURCE | BUILD_ARCH_INDEP, $_);
     } elsif (m/^-s([iad])$/) {
     } elsif (m/^-s([iad])$/) {
         $sourcestyle= $1;
         $sourcestyle= $1;
     } elsif (m/^-q$/) {
     } elsif (m/^-q$/) {

+ 5 - 4
scripts/t/Dpkg_Build_Types.t

@@ -28,16 +28,17 @@ set_build_type(BUILD_DEFAULT | BUILD_BINARY, '--default-binary');
 
 
 ok(build_is(BUILD_DEFAULT | BUILD_BINARY), 'build is default binary');
 ok(build_is(BUILD_DEFAULT | BUILD_BINARY), 'build is default binary');
 
 
-set_build_type(BUILD_SOURCE_INDEP, '--source-indep');
+set_build_type(BUILD_SOURCE | BUILD_ARCH_INDEP, '--build=source,all');
 
 
-ok(build_is(BUILD_SOURCE_INDEP), 'build is source indep');
-ok(!build_is(BUILD_SOURCE_DEP), 'build is not source dep');
+ok(build_is(BUILD_SOURCE | BUILD_ARCH_INDEP), 'build source,all is source,all');
+ok(!build_is(BUILD_SOURCE | BUILD_ARCH_DEP), 'build source,all is not source,any');
 ok(build_has(BUILD_SOURCE), 'build source indep has source');
 ok(build_has(BUILD_SOURCE), 'build source indep has source');
 ok(build_has(BUILD_ARCH_INDEP), 'build source indep has arch indep');
 ok(build_has(BUILD_ARCH_INDEP), 'build source indep has arch indep');
 ok(build_has_not(BUILD_DEFAULT), 'build source indep has not default');
 ok(build_has_not(BUILD_DEFAULT), 'build source indep has not default');
 ok(build_has_not(BUILD_ARCH_DEP), 'build source indep has not arch dep');
 ok(build_has_not(BUILD_ARCH_DEP), 'build source indep has not arch dep');
 ok(build_has_not(BUILD_BINARY), 'build source indep has not binary');
 ok(build_has_not(BUILD_BINARY), 'build source indep has not binary');
-ok(build_has_not(BUILD_SOURCE_DEP), 'build source indep has not source dep');
+ok(build_has_not(BUILD_SOURCE | BUILD_ARCH_DEP),
+   'build source,all has_not source,any');
 ok(build_has_not(BUILD_FULL), 'build source indep has not full');
 ok(build_has_not(BUILD_FULL), 'build source indep has not full');
 
 
 1;
 1;