Sfoglia il codice sorgente

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 9 anni fa
parent
commit
a50ea56e8a
5 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  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
     some cases segfaults when reporting the error summary at the end.
     Regression introduced in dpkg 1.18.11. Closes: #843874
+  * Change default color behavior to auto.
   * Test suite:
     - Do not fail tests on missing fakeroot, just skip them.
   * Build system:

+ 1 - 1
lib/dpkg/color.c

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

+ 2 - 2
man/dpkg-buildpackage.man

@@ -482,8 +482,8 @@ Overridden by the \fB\-P\fP option.
 .TP
 .B DPKG_COLORS
 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
 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
 .B DPKG_COLORS
 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
 .TP
 .B DPKG_ROOT

+ 1 - 1
scripts/Dpkg/ErrorHandling.pm

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