Parcourir la source

libdpkg, scripts: Change default color behavior to auto

Our test run with the setting activated by apt, has not shown any signs
of pitch forks nor angry mobs. Let's switch this by default to auto, so
that the more clear but still hopefully unobtrusive colors can help
people deal with interesting messages, warnings or error conditions.
Guillem Jover il y a 9 ans
Parent
commit
a50ea56e8a
5 fichiers modifiés avec 7 ajouts et 6 suppressions
  1. 1 0
      debian/changelog
  2. 1 1
      lib/dpkg/color.c
  3. 2 2
      man/dpkg-buildpackage.man
  4. 2 2
      man/dpkg.man
  5. 1 1
      scripts/Dpkg/ErrorHandling.pm

+ 1 - 0
debian/changelog

@@ -11,6 +11,7 @@ dpkg (1.18.14) UNRELEASED; urgency=medium
     had already been freed as part of the database memory pool, causing in
     had already been freed as part of the database memory pool, causing in
     some cases segfaults when reporting the error summary at the end.
     some cases segfaults when reporting the error summary at the end.
     Regression introduced in dpkg 1.18.11. Closes: #843874
     Regression introduced in dpkg 1.18.11. Closes: #843874
+  * Change default color behavior to auto.
   * Test suite:
   * Test suite:
     - Do not fail tests on missing fakeroot, just skip them.
     - Do not fail tests on missing fakeroot, just skip them.
   * Build system:
   * Build system:

+ 1 - 1
lib/dpkg/color.c

@@ -59,7 +59,7 @@ color_enabled(void)
 
 
 	mode = getenv("DPKG_COLORS");
 	mode = getenv("DPKG_COLORS");
 	if (mode == NULL)
 	if (mode == NULL)
-		mode = "never";
+		mode = "auto";
 
 
 	return color_set_mode(mode);
 	return color_set_mode(mode);
 }
 }

+ 2 - 2
man/dpkg-buildpackage.man

@@ -482,8 +482,8 @@ Overridden by the \fB\-P\fP option.
 .TP
 .TP
 .B DPKG_COLORS
 .B DPKG_COLORS
 Sets the color mode (since dpkg 1.18.5).
 Sets the color mode (since dpkg 1.18.5).
-The currently accepted values are: \fBauto\fP, \fBalways\fP and
-\fBnever\fP (default).
+The currently accepted values are: \fBauto\fP (default), \fBalways\fP and
+\fBnever\fP.
 
 
 .SS Internal environment
 .SS Internal environment
 Even if \fBdpkg\-buildpackage\fP exports some variables, \fBdebian/rules\fP
 Even if \fBdpkg\-buildpackage\fP exports some variables, \fBdebian/rules\fP

+ 2 - 2
man/dpkg.man

@@ -866,8 +866,8 @@ Currently only used by \fB\-\-list\fP.
 .TP
 .TP
 .B DPKG_COLORS
 .B DPKG_COLORS
 Sets the color mode (since dpkg 1.18.5).
 Sets the color mode (since dpkg 1.18.5).
-The currently accepted values are: \fBauto\fP, \fBalways\fP and
-\fBnever\fP (default).
+The currently accepted values are: \fBauto\fP (default), \fBalways\fP and
+\fBnever\fP.
 .SS Internal environment
 .SS Internal environment
 .TP
 .TP
 .B DPKG_ROOT
 .B DPKG_ROOT

+ 1 - 1
scripts/Dpkg/ErrorHandling.pm

@@ -54,7 +54,7 @@ my $use_color = 0;
 
 
 sub setup_color
 sub setup_color
 {
 {
-    my $mode = $ENV{'DPKG_COLORS'} // 'never';
+    my $mode = $ENV{'DPKG_COLORS'} // 'auto';
 
 
     if ($mode eq 'auto') {
     if ($mode eq 'auto') {
         ## no critic (InputOutput::ProhibitInteractiveTest)
         ## no critic (InputOutput::ProhibitInteractiveTest)