Control: tags 938722 + patch
Control: tags 938722 + pending

Dear maintainer,

I've prepared an NMU for tsung (versioned as 1.7.0-3.1) and
uploaded it to DELAYED/7. Please feel free to tell me if I
should delay it longer.

Regards.

diff -Nru tsung-1.7.0/debian/changelog tsung-1.7.0/debian/changelog
--- tsung-1.7.0/debian/changelog	2017-11-16 00:55:06.000000000 -0500
+++ tsung-1.7.0/debian/changelog	2019-09-23 20:42:10.000000000 -0400
@@ -1,3 +1,12 @@
+tsung (1.7.0-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * debian/patches/tsung-python3.patch.txt
+    - support Python3
+  * switch to use Python3, dropping python2 support; Closes: #938722
+
+ -- Sandro Tosi <mo...@debian.org>  Mon, 23 Sep 2019 20:42:10 -0400
+
 tsung (1.7.0-3) unstable; urgency=medium
 
   * debian/patches:
diff -Nru tsung-1.7.0/debian/control tsung-1.7.0/debian/control
--- tsung-1.7.0/debian/control	2017-11-14 21:54:06.000000000 -0500
+++ tsung-1.7.0/debian/control	2019-09-23 20:24:54.000000000 -0400
@@ -8,7 +8,7 @@
  erlang-dev (>= 1:13.b.1-dfsg-3),
  erlang-nox,
  erlang-src,
- python (>= 2.6.6-3~),
+ python3,
  dh-python,
  python3-sphinx
 Homepage: http://tsung.erlang-projects.org/
@@ -18,10 +18,10 @@
 Architecture: any
 Depends: gnuplot,
  libtemplate-perl,
- python-matplotlib,
+ python3-matplotlib,
  ${erlang:Depends},
  ${misc:Depends},
- ${python:Depends},
+ ${python3:Depends},
  libjs-jquery,
  libjs-underscore
 Recommends: openssh-client
diff -Nru tsung-1.7.0/debian/patches/series tsung-1.7.0/debian/patches/series
--- tsung-1.7.0/debian/patches/series	2017-11-16 00:44:36.000000000 -0500
+++ tsung-1.7.0/debian/patches/series	2019-09-23 20:20:10.000000000 -0400
@@ -1,3 +1,4 @@
 03_correct_lib_path.diff
 02_tsplot_manpage_typo.diff
 01_correct_share_path.diff
+tsung-python3.patch.txt
diff -Nru tsung-1.7.0/debian/patches/tsung-python3.patch.txt tsung-1.7.0/debian/patches/tsung-python3.patch.txt
--- tsung-1.7.0/debian/patches/tsung-python3.patch.txt	1969-12-31 19:00:00.000000000 -0500
+++ tsung-1.7.0/debian/patches/tsung-python3.patch.txt	2019-09-23 20:37:40.000000000 -0400
@@ -0,0 +1,125 @@
+# https://github.com/processone/tsung/issues/351#issuecomment-493781199
+
+--- a/src/tsung-plotter/tsplot.py.in
++++ b/src/tsung-plotter/tsplot.py.in
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#! /usr/bin/env python3
+ # -*- Mode: python -*-
+ # -*- coding: utf-8 -*-
+ 
+@@ -41,7 +41,7 @@ SYS_STATS_CONF = os.path.join(SHAREDIR,
+ sys.path.append(LIBDIR)
+ 
+ from tsung_plotter.tsung import TsungLog
+-from ConfigParser import ConfigParser
++from configparser import ConfigParser
+ 
+ # Prevents pylab from requiring a X Server to run
+ import matplotlib
+@@ -204,7 +204,7 @@ def main(conffile, logs, legends, outdir
+             stats = [x.strip().rsplit('.', 1)
+                      for x in config.get(s, 'stats').split(' ')]
+         except:
+-            print 'error: unable to read plot "%s" stats' % s
++            print('error: unable to read plot "%s" stats' % s)
+             continue
+ 
+         if config.has_option(s, 'styles'):
+@@ -235,8 +235,8 @@ def main(conffile, logs, legends, outdir
+             try:
+                 p.__dict__['yfactor'] = map(float,config.get(s, 'yfactor').decode(encoding).split(','))
+             except ValueError:
+-                print 'warning: %s yfactor not a number: %s' \
+-                    % (p.name, config.get(s, yfactor))
++                print('warning: %s yfactor not a number: %s' \
++                    % (p.name, config.get(s, yfactor)))
+         # Text parameters - to decode into specified encoding
+         for attr in ['title', 'xlabel', 'ylabel', 'plottype', 'yscale']:
+             if config.has_option(s, attr):
+@@ -249,13 +249,13 @@ def main(conffile, logs, legends, outdir
+                 try:
+                     p.__dict__[attr] = config.getfloat(s, attr)
+                 except ValueError:
+-                    print 'warning: %s %s not a number: %s' \
+-                          % (p.name, attr, config.get(s, attr))
++                    print('warning: %s %s not a number: %s' \
++                          % (p.name, attr, config.get(s, attr)))
+ 
+         outfile = p.plot(stats, dataset)
+ 
+         if verbose:
+-            print 'Generated plot %s' % outfile
++            print('Generated plot %s' % outfile)
+ 
+ if __name__ == "__main__":
+     from optparse import OptionParser
+@@ -280,10 +280,10 @@ if __name__ == "__main__":
+         config = options.config
+ 
+     if options.verbose:
+-        print 'Using %s configuration file' % config
++        print('Using %s configuration file' % config)
+ 
+     if not os.access(config, os.R_OK):
+-        print "can't read configuration file: %s" % config
++        print("can't read configuration file: %s" % config)
+         sys.exit(1)
+ 
+     # FIXME: error control
+@@ -295,7 +295,7 @@ if __name__ == "__main__":
+ 
+     # args are legend then file, any times wanted by user
+     if len(args) % 2 != 0:
+-        print "error: please provide legend and tsung log filename"
++        print("error: please provide legend and tsung log filename")
+         sys.exit(3)
+ 
+     count   = 0
+@@ -311,21 +311,21 @@ if __name__ == "__main__":
+         count += 1
+ 
+     if options.verbose:
+-        print 'Using %s stats configuration file' % SYS_STATS_CONF
++        print('Using %s stats configuration file' % SYS_STATS_CONF)
+ 
+     logs = []
+     for logfile in files:
+         if not os.access(logfile, os.R_OK):
+-            print "error: unable to read file %s" % logfile
++            print("error: unable to read file %s" % logfile)
+ 
+         else:
+             if options.verbose:
+-                print 'Parsing Tsung log file', logfile
++                print('Parsing Tsung log file', logfile)
+             logs.append((logfile, TsungLog(SYS_STATS_CONF, logfile)))
+ 
+     if len(logs) != len(args) / 2:
+-        print 'error while parsing files (%d != %d)' % (len(logs),
+-                                                        len(args)/2)
++        print('error while parsing files (%d != %d)' % (len(logs),
++                                                        len(args)/2))
+         sys.exit(2)
+ 
+     main(config, logs, legends, options.outdir, options.verbose)
+--- a/src/tsung-plotter/tsung/tsung.py
++++ b/src/tsung-plotter/tsung/tsung.py
+@@ -38,7 +38,7 @@ This package has its own configuration f
+ stats names with tsung stat type.
+ """
+ 
+-from ConfigParser import ConfigParser
++from configparser import ConfigParser
+ 
+ # data are produced every 10 seconds, by default
+ # we read real used interval in log file (deduced from timestamps)
+@@ -204,7 +204,7 @@ class TsungLog:
+                                 break
+ 
+                     if name not in self.unknown and not is_re:
+-                        print 'WARNING: tsung %s data is not configured' % name
++                        print('WARNING: tsung %s data is not configured' % name)
+                         self.unknown.append(name)
+ 
+     def stat(self, name, stat):
diff -Nru tsung-1.7.0/debian/rules tsung-1.7.0/debian/rules
--- tsung-1.7.0/debian/rules	2017-11-14 20:31:01.000000000 -0500
+++ tsung-1.7.0/debian/rules	2019-09-23 20:25:05.000000000 -0400
@@ -2,7 +2,7 @@
 # -*- makefile -*-
 
 %:
-	dh $@ --with python2
+	dh $@ --with python3
 
 override_dh_auto_clean:
 	dh_auto_clean

Reply via email to