]> git.proxmox.com Git - debcargo-conf.git/commitdiff
concolor - switch back to atty.
authorPeter Michael Green <plugwash@debian.org>
Tue, 27 Dec 2022 10:19:27 +0000 (10:19 +0000)
committerPeter Michael Green <plugwash@debian.org>
Tue, 27 Dec 2022 10:19:27 +0000 (10:19 +0000)
src/concolor/debian/changelog
src/concolor/debian/patches/series
src/concolor/debian/patches/switch-back-to-atty.patch [new file with mode: 0644]

index 02648172ad17f3a97642456223156e1d78eb381b..8b07da05ef8c659bfe244c48ae7c98287927cf66 100644 (file)
@@ -2,6 +2,8 @@ rust-concolor (0.0.11-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
 
   * Team upload.
   * Package concolor 0.0.11 from crates.io using debcargo 2.6.0
+  * Revert upstream switch from atty to is-terminal, because
+    is-terminal is not in Debian.
 
  -- Peter Michael Green <plugwash@debian.org>  Tue, 27 Dec 2022 09:39:45 +0000
 
index cbd69707c92f4eb24a1829de4bf2e81f22b5679d..cdf0759277cb5c90742736a44cbca832b259b5e0 100644 (file)
@@ -1 +1,2 @@
 avoid-doctest-breakage.patch
+switch-back-to-atty.patch
diff --git a/src/concolor/debian/patches/switch-back-to-atty.patch b/src/concolor/debian/patches/switch-back-to-atty.patch
new file mode 100644 (file)
index 0000000..5a67ae3
--- /dev/null
@@ -0,0 +1,47 @@
+This patch is based on a revert of upstream commmit 
+df9a851260f7178ba7c0886641cd73a76dde7a62 adapted for use in the Debian package
+by Peter Michael Green.
+
+Index: concolor/src/color/mod.rs
+===================================================================
+--- concolor.orig/src/color/mod.rs
++++ concolor/src/color/mod.rs
+@@ -111,12 +111,10 @@ fn init() -> usize {
+     #[cfg(feature = "interactive")]
+     {
+-        use is_terminal::IsTerminal;
+-        use std::io::{stderr, stdout};
+-        if stdout().is_terminal() {
++        if atty::is(atty::Stream::Stdout) {
+             flags |= InternalFlags::TTY_STDOUT;
+         }
+-        if stderr().is_terminal() {
++        if atty::is(atty::Stream::Stderr) {
+             flags |= InternalFlags::TTY_STDERR;
+         }
+     }
+Index: concolor/Cargo.toml
+===================================================================
+--- concolor.orig/Cargo.toml
++++ concolor/Cargo.toml
+@@ -48,8 +48,8 @@ optional = true
+ version = "^0.1.0"
+ optional = true
+-[dependencies.is-terminal]
+-version = "0.4"
++[dependencies.atty]
++version = "0.2.14"
+ optional = true
+ [features]
+@@ -71,7 +71,7 @@ core = [
+ ]
+ interactive = [
+     "core",
+-    "dep:is-terminal",
++    "dep:atty",
+ ]
+ no_color = [
+     "core",