[linux] 01/02: debian/patches/features/all/rt/genpatch.py: Fix support for git repositories

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Thu Dec 8 21:08:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 465cba954c1d25812f53ad45255c4798adbf4d09
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Thu Dec 8 19:19:03 2016 +0000

    debian/patches/features/all/rt/genpatch.py: Fix support for git repositories
    
    - Wrap UTF-8 decoder around pipe from git, since pipes produce bytes in
      Python 3
    - Correct condition on number of arguments
---
 debian/patches/features/all/rt/genpatch.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/patches/features/all/rt/genpatch.py b/debian/patches/features/all/rt/genpatch.py
index 740780f..a917c94 100755
--- a/debian/patches/features/all/rt/genpatch.py
+++ b/debian/patches/features/all/rt/genpatch.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python3
 
-import errno, os, os.path, re, shutil, subprocess, sys, tempfile
+import errno, io, os, os.path, re, shutil, subprocess, sys, tempfile
 
 def main(source, version=None):
     patch_dir = 'debian/patches'
@@ -52,7 +52,7 @@ def main(source, version=None):
             child = subprocess.Popen(args,
                                      cwd=os.path.join(patch_dir, rt_patch_dir),
                                      env=env, stdout=subprocess.PIPE)
-            with child.stdout as pipe:
+            with io.open(child.stdout.fileno(), encoding='utf-8') as pipe:
                 for line in pipe:
                     name = line.strip('\n')
                     with open(os.path.join(patch_dir, rt_patch_dir, name)) as \
@@ -104,7 +104,7 @@ def main(source, version=None):
         print('Obsoleted patch', os.path.join(patch_dir, name))
 
 if __name__ == '__main__':
-    if not (1 <= len(sys.argv) <= 2):
+    if not (1 <= len(sys.argv) <= 3):
         print('Usage: %s {TAR [RT-VERSION] | REPO RT-VERSION}' % sys.argv[0], file=sys.stderr)
         print('TAR is a tarball of patches.', file=sys.stderr)
         print('REPO is a git repo containing the given RT-VERSION.', file=sys.stderr)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list