[SCM] Git repository for devscripts branch, master, updated. v2.12.4-176-g7c1cf0d

Benjamin Drung bdrung at debian.org
Mon Mar 18 22:41:40 UTC 2013


The following commit has been merged in the master branch:
commit 7c1cf0df6ee4424d3d2df64f6faa5be0253eca4f
Author: Benjamin Drung <bdrung at debian.org>
Date:   Mon Mar 18 23:41:33 2013 +0100

    Convert Python scripts to python3.
    
    Closes: #680313

diff --git a/README b/README
index 1aacc8c..a52e705 100644
--- a/README
+++ b/README
@@ -208,7 +208,7 @@ And now, in mostly alphabetical order, the scripts:
   [liburi-perl, wget | curl]
 
 - suspicious-source: output a list of files which are not common source
-  files [python-magic]
+  files [python3-magic]
 
 - svnpath: Prints the path to the Subversion repository of a Subversion
   checkout. Also supports calculating the paths for branches and
@@ -248,7 +248,7 @@ And now, in mostly alphabetical order, the scripts:
   intention to package bug for a package [wget | curl]
 
 - wrap-and-sort: wrap long lines and sort items in packaging files
-  [python-debian]
+  [python3-debian]
 
 - /usr/share/doc/devscripts/examples: This directory contains examples of
   procmail and exim scripts for sorting mail arriving to Debian
diff --git a/debian/changelog b/debian/changelog
index eef2324..5688248 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ devscripts (2.13.1) UNRELEASED; urgency=low
   [ Benjamin Drung ]
   * wnpp-check: Correct download links to fix regression from previous release.
   * Switch to debhelper 9.
+  * Convert Python scripts to python3 (Closes: #680313).
 
   [ James McCoy ]
   * debdiff: Handle control files with odd permissions.  Thanks to Julian
diff --git a/debian/control b/debian/control
index 81ae5cf..c0a9d90 100644
--- a/debian/control
+++ b/debian/control
@@ -27,15 +27,13 @@ Build-Depends: debhelper (>= 9),
                perl,
                po4a (>= 0.40),
                pylint,
-               python-all,
-               python-debian (>= 0.1.15),
-               python-magic,
-               python-setuptools,
-               python-unittest2,
+               python3-all,
+               python3-debian (>= 0.1.15),
+               python3-magic,
+               python3-setuptools,
                shunit2 (>= 2.1.6),
                wdiff,
                xsltproc
-X-Python-Version: >= 2.6
 XS-Testsuite: autopkgtest
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=devscripts/devscripts.git
 Vcs-Git: git://anonscm.debian.org/devscripts/devscripts.git
@@ -46,7 +44,7 @@ Multi-Arch: foreign
 Depends: dpkg-dev (>= 1.15.4.1),
          ${misc:Depends},
          ${perl:Depends},
-         ${python:Depends},
+         ${python3:Depends},
          ${shlibs:Depends}
 Recommends: at,
             dctrl-tools,
@@ -62,8 +60,8 @@ Recommends: at,
             man-db,
             patch,
             patchutils,
-            python-debian (>= 0.1.15),
-            python-magic,
+            python3-debian (>= 0.1.15),
+            python3-magic,
             sensible-utils,
             strace,
             unzip,
@@ -87,7 +85,7 @@ Suggests: bsd-mailx | mailx,
           svn-buildpackage,
           w3m,
           ${vendor:Suggests}
-Breaks: ubuntu-dev-tools (<< 0.124~)
+Breaks: ubuntu-dev-tools (<< 0.147~)
 Replaces: ubuntu-dev-tools (<< 0.124~)
 Description: scripts to make the life of a Debian Package maintainer easier
  Contains the following scripts, dependencies/recommendations shown in
@@ -184,7 +182,7 @@ Description: scripts to make the life of a Debian Package maintainer easier
   - rmadison: remotely query the Debian archive database about packages
     [liburi-perl, wget | curl]
   - suspicious-source: output a list of files which are not common source
-    files [python-magic]
+    files [python3-magic]
   - svnpath: print Subversion repository paths [subversion]
   - tagpending: run from a Debian source tree and tag bugs that are to be
     closed in the latest changelog as pending [libsoap-lite-perl]
@@ -204,7 +202,7 @@ Description: scripts to make the life of a Debian Package maintainer easier
   - wnpp-check: check whether there is an open request for packaging or
     intention to package bug for a package [wget | curl]
   - wrap-and-sort: wrap long lines and sort items in packaging files
-    [python-debian]
+    [python3-debian]
  .
  Also included are a set of example mail filters for filtering mail
  from Debian mailing lists using exim, procmail, etc.
diff --git a/debian/rules b/debian/rules
index 1491f02..09cfe55 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 UBU_SUGGESTS=debian-keyring, equivs, libcrypt-ssleay-perl, libsoap-lite-perl
 
 %:
-	dh $@ --with python2
+	dh $@ --with python3
 
 override_dh_gencontrol:
 ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo ubuntu),ubuntu)
diff --git a/scripts/Makefile b/scripts/Makefile
index 99ed05e..e05ff5e 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -80,7 +80,7 @@ libvfork.so.0: libvfork.o
 	$(CC) $(LDFLAGS) -shared $< -lc -Wl,-soname -Wl,libvfork.so.0 -o $@
 
 clean:
-	python setup.py clean -a
+	python3 setup.py clean -a
 	find -name '*.pyc' -delete
 	rm -rf devscripts.egg-info
 	rm -f $(SCRIPTS) $(patsubst %,%.tmp,$(SCRIPTS)) \
@@ -88,10 +88,10 @@ clean:
 		libvfork.o libvfork.so.0 $(COMPLETION)
 
 test:
-	$(foreach python,$(shell pyversions -r ../debian/control),$(python) setup.py test$(\n))
+	$(foreach python,$(shell py3versions -r ../debian/control),$(python) setup.py test$(\n))
 
 install: all
-	python setup.py install --root="$(DESTDIR)" --no-compile --install-layout=deb
+	python3 setup.py install --root="$(DESTDIR)" --no-compile --install-layout=deb
 	install -dD $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR)
 	cp $(SCRIPTS) $(DESTDIR)$(BINDIR)
 	ln -sf edit-patch $(DESTDIR)$(BINDIR)/add-patch
diff --git a/scripts/devscripts/control.py b/scripts/devscripts/control.py
index e7c5d09..8dbff26 100644
--- a/scripts/devscripts/control.py
+++ b/scripts/devscripts/control.py
@@ -24,7 +24,7 @@ from devscripts.logger import Logger
 try:
     import debian.deb822
 except ImportError:
-    Logger.error("Please install 'python-debian' in order to use this utility.")
+    Logger.error("Please install 'python3-debian' in order to use this utility.")
     sys.exit(1)
 
 def _insert_after(paragraph, item_before, new_item, new_value):
@@ -65,8 +65,8 @@ class Control(object):
         """Saves the control file."""
         if filename:
             self.filename = filename
-        content = u"\n".join([x.dump() for x in self.paragraphs])
-        control_file = open(self.filename, "w")
+        content = "\n".join([x.dump() for x in self.paragraphs])
+        control_file = open(self.filename, "wb")
         control_file.write(content.encode("utf-8"))
         control_file.close()
 
diff --git a/scripts/devscripts/test/test_logger.py b/scripts/devscripts/test/test_logger.py
index 8f68c03..d0275fb 100644
--- a/scripts/devscripts/test/test_logger.py
+++ b/scripts/devscripts/test/test_logger.py
@@ -14,7 +14,7 @@
 # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-import StringIO
+import io
 import sys
 
 from devscripts.logger import Logger
@@ -23,8 +23,8 @@ from devscripts.test import unittest
 
 class LoggerTestCase(unittest.TestCase):
     def setUp(self):
-        Logger.stdout = StringIO.StringIO()
-        Logger.stderr = StringIO.StringIO()
+        Logger.stdout = io.StringIO()
+        Logger.stderr = io.StringIO()
         self._script_name = Logger.script_name
         Logger.script_name = 'test'
         self._verbose = Logger.verbose
diff --git a/scripts/setup.py b/scripts/setup.py
index cc21c60..5ac3992 100755
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 from setuptools import setup
 import glob
@@ -8,7 +8,7 @@ import re
 # look/set what version we have
 changelog = "../debian/changelog"
 if os.path.exists(changelog):
-    head=open(changelog).readline()
+    head = open(changelog, encoding="utf8").readline()
     match = re.compile(".*\((.*)\).*").match(head)
     if match:
         version = match.group(1)
diff --git a/scripts/suspicious-source b/scripts/suspicious-source
index a41220b..77ef98a 100755
--- a/scripts/suspicious-source
+++ b/scripts/suspicious-source
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2010-2013, Benjamin Drung <bdrung at debian.org>
 #
@@ -109,7 +109,7 @@ def suspicious_source(whitelisted_mimetypes, whitelisted_extensions, directory,
                     output = os.path.join(root, f)
                     if verbose:
                         output += " (" + mimetype + ")"
-                    sys.stdout.write(output + "\n")
+                    print(output)
         for vcs_dir in (".bzr", "CVS", ".git", ".svn", ".hg", "_darcs"):
             if vcs_dir in dirs:
                 dirs.remove(vcs_dir)
diff --git a/scripts/wrap-and-sort b/scripts/wrap-and-sort
index 1843ea6..fdff65f 100755
--- a/scripts/wrap-and-sort
+++ b/scripts/wrap-and-sort
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 #
 # Copyright (C) 2010-2013, Benjamin Drung <bdrung at debian.org>
 #               2010, Stefano Rivera <stefanor at ubuntu.com>
@@ -137,7 +137,7 @@ def wrap_and_sort(options):
     control_files = [f for f in options.files if re.search("/control[^/]*$", f)]
     for control_file in control_files:
         if options.verbose:
-            sys.stdout.write(control_file + "\n")
+            print(control_file)
         control = WrapAndSortControl(control_file)
         if options.cleanup:
             control.strip_trailing_spaces()
@@ -149,13 +149,13 @@ def wrap_and_sort(options):
                        if re.search("/copyright[^/]*$", f)]
     for copyright_file in copyright_files:
         if options.verbose:
-            sys.stdout.write(copyright_file + "\n")
+            print(copyright_file)
         remove_trailing_whitespaces(copyright_file)
 
     install_files = [f for f in options.files if re.search("install$", f)]
     for install_file in sorted(install_files):
         if options.verbose:
-            sys.stdout.write(install_file + "\n")
+            print(install_file)
         install = Install(install_file)
         install.sort()
         install.save()

-- 
Git repository for devscripts



More information about the devscripts-devel mailing list