summaryrefslogtreecommitdiff
path: root/dev-util/watchman/files/watchman-2023.06.19.00-rust-1.70-avoidance.patch
blob: 78c6d139e483e05299a5074cebc9abe351970c2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 625967e8d00a3564ce5c6634b84b0e3b89aa6f4e Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sat, 24 Jun 2023 07:26:10 +0100
Subject: [PATCH] Revert "Replace remaining atty usages with stdlib"

This reverts commit 39290c123d1606e520bbaa1f92737fea010ec278.

This requires Rust 1.70 which is currently masked in Gentoo because
of a bug involving strip.
--- a/watchman/cli/Cargo.toml
+++ b/watchman/cli/Cargo.toml
@@ -9,6 +9,7 @@ edition = "2021"
 [dependencies]
 ahash = "0.8"
 anyhow = "1.0.65"
+atty = "0.2"
 duct = "0.13.6"
 jwalk = "0.6"
 serde = { version = "1.0.136", features = ["derive", "rc"] }
--- a/watchman/cli/src/rage/stream.rs
+++ b/watchman/cli/src/rage/stream.rs
@@ -6,7 +6,6 @@
  */
 
 use std::io;
-use std::io::IsTerminal;
 use std::io::Stdout;
 use std::io::Write;
 
@@ -59,7 +58,7 @@ impl Stream {
     }
 
     pub fn new(hostname: Option<String>) -> Self {
-        if !std::io::stdout().is_terminal() {
+        if atty::isnt(atty::Stream::Stdout) {
             Self::new_stdout()
         } else if let Ok(reporter) = FbReporter::new(hostname) {
             Self::Child(reporter)
@@ -73,7 +72,7 @@ impl Stream {
         if let Self::Child(_) = self {
             true
         } else {
-            !std::io::stdout().is_terminal()
+            atty::isnt(atty::Stream::Stdout)
         }
     }
 
-- 
2.41.0