Blame icu_sources_data-Write-command-output-to-our-stderr.patch

95774b8
From: Simon McVittie <smcv@debian.org>
95774b8
Date: Mon, 9 Oct 2017 09:23:14 +0100
95774b8
Subject: icu_sources_data: Write command output to our stderr
95774b8
95774b8
Saying "See output in /tmp/foobar" is all very well for a developer
95774b8
build, but on a buildd our /tmp is going to get thrown away after
95774b8
the build. Just log the usual way instead.
95774b8
---
95774b8
 intl/icu_sources_data.py | 16 ++++------------
95774b8
 1 file changed, 4 insertions(+), 12 deletions(-)
95774b8
95774b8
diff --git a/intl/icu_sources_data.py b/intl/icu_sources_data.py
95774b8
index 4db52af..d62960d 100644
95774b8
--- a/intl/icu_sources_data.py
95774b8
+++ b/intl/icu_sources_data.py
95774b8
@@ -188,21 +188,13 @@ def update_sources(topsrcdir):
95774b8
95774b8
 def try_run(name, command, cwd=None, **kwargs):
95774b8
     try:
95774b8
-        with tempfile.NamedTemporaryFile(prefix=name, delete=False) as f:
95774b8
-            subprocess.check_call(
95774b8
-                command, cwd=cwd, stdout=f, stderr=subprocess.STDOUT, **kwargs
95774b8
-            )
95774b8
-    except subprocess.CalledProcessError:
95774b8
-        print(
95774b8
-            """Error running "{}" in directory {}
95774b8
-    See output in {}""".format(
95774b8
-                " ".join(command), cwd, f.name
95774b8
-            ),
95774b8
-            file=sys.stderr,
95774b8
+        subprocess.check_call(
95774b8
+            command, cwd=cwd, stdout=sys.stderr, stderr=subprocess.STDOUT, **kwargs
95774b8
         )
95774b8
+    except subprocess.CalledProcessError:
95774b8
+        print('''Error running "{}" in directory {}'''.format(' '.join(command), cwd), file=sys.stderr)
95774b8
         return False
95774b8
     else:
95774b8
-        os.unlink(f.name)
95774b8
         return True
95774b8
95774b8
95774b8
--
95774b8
2.31.1
95774b8