Procházet zdrojové kódy

dpkg-buildpackage: no longer exports the compiler flags

Packages must directly call dpkg-buildflags to retrieve them.

dpkg-buildpackage still prints the flags that are returned by
dpkg-buildflags because it's useful for debugging purpose and for
identifying an unclean build environment.
Raphaël Hertzog před 15 roky
rodič
revize
14f134d403
3 změnil soubory, kde provedl 11 přidání a 9 odebrání
  1. 2 0
      debian/changelog
  2. 7 6
      man/dpkg-buildpackage.1
  3. 2 3
      scripts/dpkg-buildpackage.pl

+ 2 - 0
debian/changelog

@@ -60,6 +60,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
   * Fix a small typo in dpkg-source(1). Closes: #632937
   * Reword the description of dpkg-source --before-build and --after-build
     to be clearer. Closes: #608260
+  * dpkg-buildpackage no longer exports the compiler flags. Closes: #560070
+    Packages must directly call dpkg-buildflags to retrieve them.
 
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520

+ 7 - 6
man/dpkg-buildpackage.1

@@ -231,18 +231,18 @@ Show the usage message and exit.
 Show the version and exit.
 .
 .SH ENVIRONMENT
-Even if \fBdpkg\-buildpackage\fP export some variables, \fBdebian/rules\fP
+Even if \fBdpkg\-buildpackage\fP exports some variables, \fBdebian/rules\fP
 should not rely on their presence and should instead use the
 respective interface to retrieve the needed values.
 .SS Variables set by dpkg-architecture
 \fBdpkg\-architecture\fP is called with the \fB\-a\fP and \fB\-t\fP
 parameters forwarded. Any variable that is output by its \fB\-s\fP
 option is integrated in the build environment.
-.SS Compiler flags
-The \fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBFFLAGS\fP, \fBCPPFLAGS\fP
-and \fBLDFLAGS\fP environment variables are set to the values
-that \fBdpkg\-buildflags\fP returned. See its manual page for more
-information.
+.SS Compiler flags are no longer exported
+Between versions 1.14.17 and 1.16.1, \fBdpkg\-buildpackage\fP
+exported compiler flags (\fBCFLAGS\fP, \fBCXXFLAGS\fP, \fBFFLAGS\fP,
+\fBCPPFLAGS\fP and \fBLDFLAGS\fP) with values as returned
+by \fBdpkg\-buildflags\fP. This is no longer the case.
 .
 .SH BUGS
 It should be possible to specify spaces and shell metacharacters in
@@ -252,6 +252,7 @@ and initial arguments for
 .SH "SEE ALSO"
 .BR dpkg\-source (1),
 .BR dpkg\-architecture (1),
+.BR dpkg\-buildflags (1),
 .BR dpkg\-genchanges (1),
 .BR fakeroot (1),
 .BR gpg (1).

+ 2 - 3
scripts/dpkg-buildpackage.pl

@@ -305,9 +305,8 @@ if (defined $parallel) {
 my $build_flags = Dpkg::BuildFlags->new();
 $build_flags->load_config();
 foreach my $flag ($build_flags->list()) {
-    $ENV{$flag} = $build_flags->get($flag);
-    printf(_g("%s: export %s from dpkg-buildflags (origin: %s): %s\n"),
-	   $progname, $flag, $build_flags->get_origin($flag), $ENV{$flag});
+    printf(_g("%s: dpkg-buildflags (origin: %s): %s = %s\n"), $progname,
+           $build_flags->get_origin($flag), $flag, $build_flags->get($flag));
 }
 
 my $cwd = cwd();