[SCM] pkg-kde-dev-scripts packaging branch, master, updated. 33e10593897096a440dff42719afc98323c8fc9c

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jan 7 15:46:22 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/pkg-kde-dev-scripts.git;a=commitdiff;h=33e1059

The following commit has been merged in the master branch:
commit 33e10593897096a440dff42719afc98323c8fc9c
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date:   Thu Jan 7 16:46:17 2016 +0100

    Python3 version
---
 ddeb_migration.py => ddeb_migration3.py | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/ddeb_migration.py b/ddeb_migration3.py
similarity index 56%
copy from ddeb_migration.py
copy to ddeb_migration3.py
index d308e46..8e9c2dc 100644
--- a/ddeb_migration.py
+++ b/ddeb_migration3.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 import debian.deb822 as deb822
@@ -7,30 +7,30 @@ import re
 import subprocess
 import sys
 
-out = subprocess.check_output(['dh_listpackages'])
+out = subprocess.check_output(['dh_listpackages'], universal_newlines=True)
 
-packages = filter(lambda x: x != '', out.split('
'))
+packages = list(filter(lambda x: x != '', out.split('
')))
 
-dbg_packages = filter(lambda x: x.endswith('-dbg'), packages)
+dbg_packages = list(filter(lambda x: x.endswith('-dbg'), packages))
 
 if len(dbg_packages) == 0:
-    print "No dbg package, nothing to do."
+    print ("No dbg package, nothing to do.")
     sys.exit(0)
 if len(dbg_packages) > 1:
-    print "Too many dbg packages in this package, migrate manually"
+    print ("Too many dbg packages in this package, migrate manually")
     sys.exit(1)
 
 if (len(packages) - len(dbg_packages)) == 1:
-    print "A single binary is produced now, needs to be installed in debian/tmp"
+    print ("A single binary is produced now, needs to be installed in debian/tmp")
 
     with open('debian/rules') as rules_file:
         for line in rules_file:
             m = re.search('--destdir=debian/tmp', line)
             if m:
-                print "Already there."
+                print ("Already there.")
                 break
         else:
-            print "Please add manually."
+            print ("Please add manually.")
             sys.exit(2)
 
 with open('debian/control') as control_file:
@@ -39,7 +39,7 @@ with open('debian/control') as control_file:
 new_control = []
 for block in control:
     if block.get('Package') not in dbg_packages:
-        new_control.append(unicode(block))
+        new_control.append(str(block))
 
 with open('debian/changelog') as changelog_file:
     chlog = changelog.Changelog(changelog_file)
@@ -48,8 +48,9 @@ version = chlog.version
 
 subprocess.call(['sed', '-i', 's/--dbg-package=' + re.escape(dbg_packages[0])
                  + '/--ddeb-migration=\'' + dbg_packages[0] + ' (<= ' +
-                 unicode(version) + '~)\'/', 'debian/rules'])
+                 str(version) + '~)\'/', 'debian/rules'],
+                universal_newlines=True)
 
-with open('debian/control', 'w') as f:
-    b = u'
'.join(new_control).encode('utf-8')
+with open('debian/control', 'w', encoding='utf-8') as f:
+    b = '
'.join(new_control)
     f.write(b)

-- 
pkg-kde-dev-scripts packaging



More information about the pkg-kde-commits mailing list