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

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 лет назад: 15
Родитель
Сommit
14f134d403
3 измененных файлов с 11 добавлено и 9 удалено
  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
   * Fix a small typo in dpkg-source(1). Closes: #632937
   * Reword the description of dpkg-source --before-build and --after-build
   * Reword the description of dpkg-source --before-build and --after-build
     to be clearer. Closes: #608260
     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 ]
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520
   * 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.
 Show the version and exit.
 .
 .
 .SH ENVIRONMENT
 .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
 should not rely on their presence and should instead use the
 respective interface to retrieve the needed values.
 respective interface to retrieve the needed values.
 .SS Variables set by dpkg-architecture
 .SS Variables set by dpkg-architecture
 \fBdpkg\-architecture\fP is called with the \fB\-a\fP and \fB\-t\fP
 \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
 parameters forwarded. Any variable that is output by its \fB\-s\fP
 option is integrated in the build environment.
 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
 .SH BUGS
 It should be possible to specify spaces and shell metacharacters in
 It should be possible to specify spaces and shell metacharacters in
@@ -252,6 +252,7 @@ and initial arguments for
 .SH "SEE ALSO"
 .SH "SEE ALSO"
 .BR dpkg\-source (1),
 .BR dpkg\-source (1),
 .BR dpkg\-architecture (1),
 .BR dpkg\-architecture (1),
+.BR dpkg\-buildflags (1),
 .BR dpkg\-genchanges (1),
 .BR dpkg\-genchanges (1),
 .BR fakeroot (1),
 .BR fakeroot (1),
 .BR gpg (1).
 .BR gpg (1).

+ 2 - 3
scripts/dpkg-buildpackage.pl

@@ -305,9 +305,8 @@ if (defined $parallel) {
 my $build_flags = Dpkg::BuildFlags->new();
 my $build_flags = Dpkg::BuildFlags->new();
 $build_flags->load_config();
 $build_flags->load_config();
 foreach my $flag ($build_flags->list()) {
 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();
 my $cwd = cwd();