Sfoglia il codice sorgente

Revert "dpkg-buildflags: support debian/buildflags"

This reverts commit 316df0a76f2ef91badbccb6fef0bfa7ae23fac59.
A recent discussion concluded that it was not a proper interface
for maintainers to override/extend build flags.

See http://lists.debian.org/debian-dpkg/2011/07/msg00033.html

Conflicts:

	scripts/Dpkg/BuildFlags.pm
Raphaël Hertzog 15 anni fa
parent
commit
7f4fb8576e
3 ha cambiato i file con 8 aggiunte e 41 eliminazioni
  1. 0 3
      debian/changelog
  2. 0 9
      man/dpkg-buildflags.1
  3. 8 29
      scripts/Dpkg/BuildFlags.pm

+ 0 - 3
debian/changelog

@@ -63,9 +63,6 @@ dpkg (1.16.1) UNRELEASED; urgency=low
     to be clearer. Closes: #608260
     to be clearer. Closes: #608260
   * dpkg-buildpackage no longer exports the compiler flags. Closes: #560070
   * dpkg-buildpackage no longer exports the compiler flags. Closes: #560070
     Packages must directly call dpkg-buildflags to retrieve them.
     Packages must directly call dpkg-buildflags to retrieve them.
-  * dpkg-buildflags parses a supplementary configuration file under the
-    control of the package maintainer: debian/buildflags (or the corresponding
-    architecture/os specific variants).
   * dpkg-buildflags supports a prepend command to modify the build
   * dpkg-buildflags supports a prepend command to modify the build
     flags. Particularly useful for package maintainers who don't want
     flags. Particularly useful for package maintainers who don't want
     their supplementary flags to take precedence over user submitted
     their supplementary flags to take precedence over user submitted

+ 0 - 9
man/dpkg-buildflags.1

@@ -19,12 +19,6 @@ for the current user with \fB$XDG_CONFIG_HOME/dpkg/buildflags.conf\fP
 where \fB$XDG_CONFIG_HOME\fP defaults to \fB$HOME/.config\fP;
 where \fB$XDG_CONFIG_HOME\fP defaults to \fB$HOME/.config\fP;
 .IP 3.
 .IP 3.
 temporarily by the user with environment variables (see section \fBENVIRONMENT\fP).
 temporarily by the user with environment variables (see section \fBENVIRONMENT\fP).
-.IP 4.
-by the package maintainer with one of the following files (the first found
-is used): \fBdebian/buildflags.\fP\fIarch\fP, \fBdebian/buildflags.\fP\fIos\fP,
-\fBdebian/buildflags\fP. The \fIarch\fP substitution corresponds to the
-DEB_HOST_ARCH variable returned by \fBdpkg\-architecture\fP while \fIos\fP
-corresponds to DEB_HOST_ARCH_OS.
 .P
 .P
 The configuration files can contain two types of directives:
 The configuration files can contain two types of directives:
 .TP
 .TP
@@ -122,9 +116,6 @@ System wide configuration file.
 .TP
 .TP
 .BR $XDG_CONFIG_HOME/dpkg/buildflags.conf " or " $HOME/.config/dpkg/buildflags.conf
 .BR $XDG_CONFIG_HOME/dpkg/buildflags.conf " or " $HOME/.config/dpkg/buildflags.conf
 User configuration file.
 User configuration file.
-.TP
-\fBdebian/buildflags.\fIarch\fP, \fBdebian/buildflags.\fIos\fP, \fBdebian/buildflags\fP
-Package maintainer configuration file.
 .SH ENVIRONMENT
 .SH ENVIRONMENT
 Those environment variables should not be set by official packages, they
 Those environment variables should not be set by official packages, they
 are meant for users who are recompiling a Debian package and would like to
 are meant for users who are recompiling a Debian package and would like to

+ 8 - 29
scripts/Dpkg/BuildFlags.pm

@@ -23,7 +23,6 @@ our $VERSION = "1.01";
 use Dpkg::Gettext;
 use Dpkg::Gettext;
 use Dpkg::BuildOptions;
 use Dpkg::BuildOptions;
 use Dpkg::ErrorHandling;
 use Dpkg::ErrorHandling;
-use Dpkg::Path qw(find_build_file);
 use Dpkg::Vendor qw(run_vendor_hook);
 use Dpkg::Vendor qw(run_vendor_hook);
 
 
 =encoding utf8
 =encoding utf8
@@ -139,26 +138,11 @@ sub load_environment_config {
     }
     }
 }
 }
 
 
-=item $bf->load_package_config()
-
-Update flags based on directives stored in debian/buildflags
-and associated arch-specific variants.
-
-=cut
-
-sub load_package_config {
-    my ($self) = @_;
-    my $config = find_build_file("debian/buildflags");
-    if (defined $config) {
-        $self->update_from_conffile($config, undef);
-    }
-}
-
 =item $bf->load_config()
 =item $bf->load_config()
 
 
-Call successively load_system_config(), load_user_config(),
-load_environment_config() and load_package_config() to update the default
-build flags defined by the vendor.
+Call successively load_system_config(), load_user_config() and
+load_environment_config() to update the default build flags
+defined by the vendor.
 
 
 =cut
 =cut
 
 
@@ -167,26 +151,24 @@ sub load_config {
     $self->load_system_config();
     $self->load_system_config();
     $self->load_user_config();
     $self->load_user_config();
     $self->load_environment_config();
     $self->load_environment_config();
-    $self->load_package_config();
 }
 }
 
 
 =item $bf->set($flag, $value, $source)
 =item $bf->set($flag, $value, $source)
 
 
-Update the build flag $flag with value $value and record its origin as
-$source (if defined).
+Update the build flag $flag with value $value and record its origin as $source.
 
 
 =cut
 =cut
 
 
 sub set {
 sub set {
     my ($self, $flag, $value, $src) = @_;
     my ($self, $flag, $value, $src) = @_;
     $self->{flags}->{$flag} = $value;
     $self->{flags}->{$flag} = $value;
-    $self->{origin}->{$flag} = $src if defined $src;
+    $self->{origin}->{$flag} = $src;
 }
 }
 
 
 =item $bf->append($flag, $value, $source)
 =item $bf->append($flag, $value, $source)
 
 
 Append the options listed in $value to the current value of the flag $flag.
 Append the options listed in $value to the current value of the flag $flag.
-Record its origin as $source (if defined).
+Record its origin as $source.
 
 
 =cut
 =cut
 
 
@@ -197,7 +179,7 @@ sub append {
     } else {
     } else {
         $self->{flags}->{$flag} = $value;
         $self->{flags}->{$flag} = $value;
     }
     }
-    $self->{origin}->{$flag} = $src if defined $src;
+    $self->{origin}->{$flag} = $src;
 }
 }
 
 
 =item $bf->prepend($flag, $value, $source)
 =item $bf->prepend($flag, $value, $source)
@@ -223,7 +205,7 @@ sub prepend {
 Update the current build flags based on the configuration directives
 Update the current build flags based on the configuration directives
 contained in $file. See dpkg-buildflags(1) for the format of the directives.
 contained in $file. See dpkg-buildflags(1) for the format of the directives.
 
 
-If defined, $source is the origin recorded for any build flag set or modified.
+$source is the origin recorded for any build flag set or modified.
 
 
 =cut
 =cut
 
 
@@ -307,9 +289,6 @@ sub list {
 
 
 =head2 Version 1.01
 =head2 Version 1.01
 
 
-New method: $bf->load_package_config(). This method is called last as part
-of load_config().
-
 New method: $bf->prepend() very similar to append(). Implement support of
 New method: $bf->prepend() very similar to append(). Implement support of
 the prepend operation everywhere.
 the prepend operation everywhere.