summaryrefslogtreecommitdiffstats
path: root/source/l/mozjs102/patches/icu_sources_data-Write-command-output-to-our-stderr.patch
blob: 84684250ce4c7ab3b024387e64eec91ad1a596b2 (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
From: Simon McVittie <smcv@debian.org>
Date: Mon, 9 Oct 2017 09:23:14 +0100
Subject: icu_sources_data: Write command output to our stderr

Saying "See output in /tmp/foobar" is all very well for a developer
build, but on a buildd our /tmp is going to get thrown away after
the build. Just log the usual way instead.
---
 intl/icu_sources_data.py | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
index 4db52af..d62960d 100644
--- a/intl/icu_sources_data.py
+++ b/intl/icu_sources_data.py
@@ -188,21 +188,13 @@ def update_sources(topsrcdir):

 def try_run(name, command, cwd=None, **kwargs):
     try:
-        with tempfile.NamedTemporaryFile(prefix=name, delete=False) as f:
-            subprocess.check_call(
-                command, cwd=cwd, stdout=f, stderr=subprocess.STDOUT, **kwargs
-            )
-    except subprocess.CalledProcessError:
-        print(
-            """Error running "{}" in directory {}
-    See output in {}""".format(
-                " ".join(command), cwd, f.name
-            ),
-            file=sys.stderr,
+        subprocess.check_call(
+            command, cwd=cwd, stdout=sys.stderr, stderr=subprocess.STDOUT, **kwargs
         )
+    except subprocess.CalledProcessError:
+        print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), file=sys.stderr)
         return False
     else:
-        os.unlink(f.name)
         return True


--
2.31.1