ownsrc debugging
[hippotat] / hippotatlib / ownsource.py
index 1a294e6..ac467f0 100644 (file)
@@ -5,22 +5,25 @@
 #
 # Copyright 2017 Ian Jackson
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version, with the "CAF Login
-# Exception" as published by Ian Jackson (version 2, or at your option
-# any later version) as an Additional Permission.
+# AGPLv3+ + CAFv2+
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
+#    This program is free software: you can redistribute it and/or
+#    modify it under the terms of the GNU Affero General Public
+#    License as published by the Free Software Foundation, either
+#    version 3 of the License, or (at your option) any later version,
+#    with the "CAF Login Exception" as published by Ian Jackson
+#    (version 2, or at your option any later version) as an Additional
+#    Permission.
 #
-# You should have received a copy of the GNU Affero General Public
-# License and the CAF Login Exception along with this program, in the
-# file AGPLv3+CAFv2.  If not, email Ian Jackson
-# <ijackson@chiark.greenend.org.uk>.
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public
+#    License and the CAF Login Exception along with this program, in
+#    the file AGPLv3+CAFv2.  If not, email Ian Jackson
+#    <ijackson@chiark.greenend.org.uk>.
 
 
 import os
@@ -54,6 +57,8 @@ class SourceShipmentPreparer():
     s.rune_shell = ['/bin/bash', '-ec']
     s.show_pathnames = True
     s.download_packages = True
+    s.stream_stderr = sys.stderr
+    s.stream_debug = open('/dev/null','w')
     s.rune_cpio = r'''
             set -o pipefail
            (
@@ -271,8 +276,8 @@ class SourceShipmentPreparer():
         subprocess.run(cmdl,
                        cwd=s._packages_path,
                        stdin=subprocess.DEVNULL,
-                       stdout=sys.stdout,
-                       stderr=sys.stderr,
+                       stdout=s.stream_debug,
+                       stderr=s.stream_stderr,
                        restore_signals=True,
                        check=True)