[med-svn] [Git][med-team/blasr][master] 2 commits: Use 2to3 to port to Python3

Andreas Tille gitlab at salsa.debian.org
Sun Sep 1 06:57:50 BST 2019



Andreas Tille pushed to branch master at Debian Med / blasr


Commits:
906ae6f1 by Andreas Tille at 2019-09-01T05:52:04Z
Use 2to3 to port to Python3

- - - - -
e7d12371 by Andreas Tille at 2019-09-01T05:56:48Z
Upload to unstable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/2to3.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+blasr (5.3.3+dfsg-2) unstable; urgency=medium
+
+  * Use 2to3 to port to Python3
+    Closes: #936213
+
+ -- Andreas Tille <tille at debian.org>  Sun, 01 Sep 2019 07:52:40 +0200
+
 blasr (5.3.3+dfsg-1) unstable; urgency=medium
 
   * Afif removed himself from Uploaders (thanks for your work on this)


=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,119 @@
+Description: Use 2to3 to port to Python3
+Bug-Debian: https://bugs.debian.org/936213
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Sun, 01 Sep 2019 07:49:53 +0200
+
+--- a/tools/git-clang-format
++++ b/tools/git-clang-format
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ #
+ #===- git-clang-format - ClangFormat Git Integration ---------*- python -*--===#
+ #
+@@ -128,15 +128,15 @@ def main():
+   if opts.verbose >= 1:
+     ignored_files.difference_update(changed_lines)
+     if ignored_files:
+-      print 'Ignoring changes in the following files (wrong extension):'
++      print('Ignoring changes in the following files (wrong extension):')
+       for filename in ignored_files:
+-        print '   ', filename
++        print('   ', filename)
+     if changed_lines:
+-      print 'Running clang-format on the following files:'
++      print('Running clang-format on the following files:')
+       for filename in changed_lines:
+-        print '   ', filename
++        print('   ', filename)
+   if not changed_lines:
+-    print 'no modified files to format'
++    print('no modified files to format')
+     return
+   # The computed diff outputs absolute paths, so we must cd before accessing
+   # those files.
+@@ -146,20 +146,20 @@ def main():
+                                                binary=opts.binary,
+                                                style=opts.style)
+   if opts.verbose >= 1:
+-    print 'old tree:', old_tree
+-    print 'new tree:', new_tree
++    print('old tree:', old_tree)
++    print('new tree:', new_tree)
+   if old_tree == new_tree:
+     if opts.verbose >= 0:
+-      print 'clang-format did not modify any files'
++      print('clang-format did not modify any files')
+   elif opts.diff:
+     print_diff(old_tree, new_tree)
+   else:
+     changed_files = apply_changes(old_tree, new_tree, force=opts.force,
+                                   patch_mode=opts.patch)
+     if (opts.verbose >= 0 and not opts.patch) or opts.verbose >= 1:
+-      print 'changed files:'
++      print('changed files:')
+       for filename in changed_files:
+-        print '   ', filename
++        print('   ', filename)
+ 
+ 
+ def load_git_config(non_string_options=None):
+@@ -298,7 +298,7 @@ def filter_by_extension(dictionary, allo
+   `allowed_extensions` must be a collection of lowercase file extensions,
+   excluding the period."""
+   allowed_extensions = frozenset(allowed_extensions)
+-  for filename in dictionary.keys():
++  for filename in list(dictionary.keys()):
+     base_ext = filename.rsplit('.', 1)
+     if len(base_ext) == 1 or base_ext[1].lower() not in allowed_extensions:
+       del dictionary[filename]
+@@ -323,7 +323,7 @@ def run_clang_format_and_save_to_tree(ch
+ 
+   Returns the object ID (SHA-1) of the created tree."""
+   def index_info_generator():
+-    for filename, line_ranges in changed_lines.iteritems():
++    for filename, line_ranges in changed_lines.items():
+       mode = oct(os.stat(filename).st_mode)
+       blob_id = clang_format_to_blob(filename, line_ranges, binary=binary,
+                                      style=style)
+@@ -431,10 +431,10 @@ def apply_changes(old_tree, new_tree, fo
+   if not force:
+     unstaged_files = run('git', 'diff-files', '--name-status', *changed_files)
+     if unstaged_files:
+-      print >>sys.stderr, ('The following files would be modified but '
+-                           'have unstaged changes:')
+-      print >>sys.stderr, unstaged_files
+-      print >>sys.stderr, 'Please commit, stage, or stash them first.'
++      print(('The following files would be modified but '
++                           'have unstaged changes:'), file=sys.stderr)
++      print(unstaged_files, file=sys.stderr)
++      print('Please commit, stage, or stash them first.', file=sys.stderr)
+       sys.exit(2)
+   if patch_mode:
+     # In patch mode, we could just as well create an index from the new tree
+@@ -464,20 +464,20 @@ def run(*args, **kwargs):
+   if p.returncode == 0:
+     if stderr:
+       if verbose:
+-        print >>sys.stderr, '`%s` printed to stderr:' % ' '.join(args)
+-      print >>sys.stderr, stderr.rstrip()
++        print('`%s` printed to stderr:' % ' '.join(args), file=sys.stderr)
++      print(stderr.rstrip(), file=sys.stderr)
+     if strip:
+       stdout = stdout.rstrip('\r\n')
+     return stdout
+   if verbose:
+-    print >>sys.stderr, '`%s` returned %s' % (' '.join(args), p.returncode)
++    print('`%s` returned %s' % (' '.join(args), p.returncode), file=sys.stderr)
+   if stderr:
+-    print >>sys.stderr, stderr.rstrip()
++    print(stderr.rstrip(), file=sys.stderr)
+   sys.exit(2)
+ 
+ 
+ def die(message):
+-  print >>sys.stderr, 'error:', message
++  print('error:', message, file=sys.stderr)
+   sys.exit(2)
+ 
+ 


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 # disable-gtest.patch
 # cmake-utils.patch
 use_debian_packaged_pblibs.patch
+2to3.patch



View it on GitLab: https://salsa.debian.org/med-team/blasr/compare/869b0124b6fbcd97ca482f5daad79319485f584d...e7d123719953098811a9a622d310ef77ce5ed1f7

-- 
View it on GitLab: https://salsa.debian.org/med-team/blasr/compare/869b0124b6fbcd97ca482f5daad79319485f584d...e7d123719953098811a9a622d310ef77ce5ed1f7
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190901/38650b50/attachment-0001.html>


More information about the debian-med-commit mailing list