From fb99ab9130534388949b172ea65b907f67f2d279 Mon Sep 17 00:00:00 2001 From: eulerstorage Date: Wed, 18 Mar 2020 19:33:45 +0800 Subject: [PATCH 1/4] modify python2 function to python3 --- blktrace.spec | 9 ++- modify-python2-expression-to-python3.patch | 90 ++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 modify-python2-expression-to-python3.patch diff --git a/blktrace.spec b/blktrace.spec index 18d48fc..8cab730 100644 --- a/blktrace.spec +++ b/blktrace.spec @@ -1,6 +1,6 @@ Name: blktrace Version: 1.2.0 -Release: 12 +Release: 13 Summary: Block IO tracer in the Linux kernel License: GPLv2+ Source: http://brick.kernel.dk/snaps/blktrace-%{version}.tar.bz2 @@ -13,6 +13,7 @@ Requires: python3 Patch0: blktrace-fix-btt-overflow.patch Patch1: remove-python2-dependency.patch +Patch2: modify-python2-expression-to-python3.patch %description blktrace is a block layer IO tracing mechanism which provides detailed @@ -47,6 +48,12 @@ make dest=%{buildroot} prefix=%{buildroot}/%{_prefix} mandir=%{buildroot}/%{_man %{_mandir}/man8/* %changelog +* Wed Mar 18 2020 sunshihao - 1.2.0-13 +- Type:enhancemnet +- ID:NA +- SUG:restart +- DESCi:modify python2 expression to python3 + * Tue Feb 25 2020 hy-euler - 1.2.0-12 - Type:enhancemnet - ID:NA diff --git a/modify-python2-expression-to-python3.patch b/modify-python2-expression-to-python3.patch new file mode 100644 index 0000000..abfb156 --- /dev/null +++ b/modify-python2-expression-to-python3.patch @@ -0,0 +1,90 @@ +From 0a4798b479a46c1f804901fd227fbd9bd84da32e Mon Sep 17 00:00:00 2001 +From: eulerstorage +Date: Wed, 18 Mar 2020 18:31:54 +0800 +Subject: [PATCH] 456 + +--- + btt/bno_plot.py | 14 +++++++------- + btt/btt_plot.py | 8 ++++---- + 2 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/btt/bno_plot.py b/btt/bno_plot.py +index aa92480..3506f33 100644 +--- a/btt/bno_plot.py ++++ b/btt/bno_plot.py +@@ -60,14 +60,14 @@ def parse_args(in_args): + + try: + (opts, args) = getopt.getopt(in_args, s_opts, l_opts) +- except getopt.error, msg: ++ except getopt.error as msg: + print >>sys.stderr, msg + print >>sys.stderr, __doc__ + sys.exit(1) + + for (o, a) in opts: + if o in ('-h', '--help'): +- print __doc__ ++ print (__doc__) + sys.exit(0) + elif o in ('-v', '--verbose'): + verbose += 1 +@@ -84,10 +84,10 @@ if __name__ == '__main__': + (bnos, keys_below) = parse_args(sys.argv[1:]) + + if verbose: +- print 'Using files:', +- for bno in bnos: print bno, +- if keys_below: print '\nKeys are to be placed below graph' +- else: print '' ++ print ('Using files:'), ++ for bno in bnos: print (bno), ++ if keys_below: print ('\nKeys are to be placed below graph') ++ else: print ('') + + tmpdir = tempfile.mktemp() + os.mkdir(tmpdir) +@@ -116,7 +116,7 @@ if __name__ == '__main__': + if pid == 0: + cmd = 'gnuplot %s/plot.cmds -' % tmpdir + +- if verbose: print 'Executing %s' % cmd ++ if verbose: print ('Executing %s' % cmd) + + os.chdir(tmpdir) + os.system(cmd) +diff --git a/btt/btt_plot.py b/btt/btt_plot.py +index b81dad5..6e403ef 100755 +--- a/btt/btt_plot.py ++++ b/btt/btt_plot.py +@@ -163,7 +163,7 @@ def get_data(files): + if not os.path.exists(file): + fatal('%s not found' % file) + elif verbose: +- print 'Processing %s' % file ++ print ('Processing %s' % file) + + xs = [] + ys = [] +@@ -214,7 +214,7 @@ def parse_args(args): + + try: + (opts, args) = getopt.getopt(args[1:], s_opts, l_opts) +- except getopt.error, msg: ++ except getopt.error as msg: + print >>sys.stderr, msg + fatal(__doc__) + + for (o, a) in opts: +@@ -314,7 +314,7 @@ def generate_output(type, db): + ofile = '%s.png' % type + + if verbose: +- print 'Generating plot into %s' % ofile ++ print ('Generating plot into %s' % ofile) + + fig = plt.figure(figsize=plot_size) + ax = fig.add_subplot(111) +-- +1.8.3.1 + -- Gitee From f2d14546aee36634067d904c41de202a1c42baab Mon Sep 17 00:00:00 2001 From: eulerstorage Date: Wed, 18 Mar 2020 19:33:45 +0800 Subject: [PATCH 2/4] modify python2 function to python3 --- blktrace.spec | 9 ++- modify-python2-expression-to-python3.patch | 90 ++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 modify-python2-expression-to-python3.patch diff --git a/blktrace.spec b/blktrace.spec index 18d48fc..8cab730 100644 --- a/blktrace.spec +++ b/blktrace.spec @@ -1,6 +1,6 @@ Name: blktrace Version: 1.2.0 -Release: 12 +Release: 13 Summary: Block IO tracer in the Linux kernel License: GPLv2+ Source: http://brick.kernel.dk/snaps/blktrace-%{version}.tar.bz2 @@ -13,6 +13,7 @@ Requires: python3 Patch0: blktrace-fix-btt-overflow.patch Patch1: remove-python2-dependency.patch +Patch2: modify-python2-expression-to-python3.patch %description blktrace is a block layer IO tracing mechanism which provides detailed @@ -47,6 +48,12 @@ make dest=%{buildroot} prefix=%{buildroot}/%{_prefix} mandir=%{buildroot}/%{_man %{_mandir}/man8/* %changelog +* Wed Mar 18 2020 sunshihao - 1.2.0-13 +- Type:enhancemnet +- ID:NA +- SUG:restart +- DESCi:modify python2 expression to python3 + * Tue Feb 25 2020 hy-euler - 1.2.0-12 - Type:enhancemnet - ID:NA diff --git a/modify-python2-expression-to-python3.patch b/modify-python2-expression-to-python3.patch new file mode 100644 index 0000000..fefcb6c --- /dev/null +++ b/modify-python2-expression-to-python3.patch @@ -0,0 +1,90 @@ +From 0a4798b479a46c1f804901fd227fbd9bd84da32e Mon Sep 17 00:00:00 2001 +From: eulerstorage +Date: Wed, 18 Mar 2020 18:31:54 +0800 +Subject: [PATCH] 456 + +--- + btt/bno_plot.py | 14 +++++++------- + btt/btt_plot.py | 6 ++++---- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/btt/bno_plot.py b/btt/bno_plot.py +index aa92480..3506f33 100644 +--- a/btt/bno_plot.py ++++ b/btt/bno_plot.py +@@ -60,14 +60,14 @@ def parse_args(in_args): + + try: + (opts, args) = getopt.getopt(in_args, s_opts, l_opts) +- except getopt.error, msg: ++ except getopt.error as msg: + print >>sys.stderr, msg + print >>sys.stderr, __doc__ + sys.exit(1) + + for (o, a) in opts: + if o in ('-h', '--help'): +- print __doc__ ++ print (__doc__) + sys.exit(0) + elif o in ('-v', '--verbose'): + verbose += 1 +@@ -84,10 +84,10 @@ if __name__ == '__main__': + (bnos, keys_below) = parse_args(sys.argv[1:]) + + if verbose: +- print 'Using files:', +- for bno in bnos: print bno, +- if keys_below: print '\nKeys are to be placed below graph' +- else: print '' ++ print ('Using files:'), ++ for bno in bnos: print (bno), ++ if keys_below: print ('\nKeys are to be placed below graph') ++ else: print ('') + + tmpdir = tempfile.mktemp() + os.mkdir(tmpdir) +@@ -116,7 +116,7 @@ if __name__ == '__main__': + if pid == 0: + cmd = 'gnuplot %s/plot.cmds -' % tmpdir + +- if verbose: print 'Executing %s' % cmd ++ if verbose: print ('Executing %s' % cmd) + + os.chdir(tmpdir) + os.system(cmd) +diff --git a/btt/btt_plot.py b/btt/btt_plot.py +index b81dad5..6e403ef 100755 +--- a/btt/btt_plot.py ++++ b/btt/btt_plot.py +@@ -163,7 +163,7 @@ def get_data(files): + if not os.path.exists(file): + fatal('%s not found' % file) + elif verbose: +- print 'Processing %s' % file ++ print ('Processing %s' % file) + + xs = [] + ys = [] +@@ -214,7 +214,7 @@ def parse_args(args): + + try: + (opts, args) = getopt.getopt(args[1:], s_opts, l_opts) +- except getopt.error, msg: ++ except getopt.error as msg: + print >>sys.stderr, msg + fatal(__doc__) + + for (o, a) in opts: +@@ -314,7 +314,7 @@ def generate_output(type, db): + ofile = '%s.png' % type + + if verbose: +- print 'Generating plot into %s' % ofile ++ print ('Generating plot into %s' % ofile) + + fig = plt.figure(figsize=plot_size) + ax = fig.add_subplot(111) +-- +1.8.3.1 + -- Gitee From 6b5b713c7c2f4c4fac04c2f62ead75cb50d02d0d Mon Sep 17 00:00:00 2001 From: eulerstorage Date: Wed, 18 Mar 2020 20:43:12 +0800 Subject: [PATCH 3/4] modify python2 function to python3 --- modify-python2-expression-to-python3.patch | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modify-python2-expression-to-python3.patch b/modify-python2-expression-to-python3.patch index fefcb6c..c49cc4c 100644 --- a/modify-python2-expression-to-python3.patch +++ b/modify-python2-expression-to-python3.patch @@ -1,11 +1,11 @@ -From 0a4798b479a46c1f804901fd227fbd9bd84da32e Mon Sep 17 00:00:00 2001 +From 007e3250a86bfaf78c3729197cc2add76de4aacc Mon Sep 17 00:00:00 2001 From: eulerstorage -Date: Wed, 18 Mar 2020 18:31:54 +0800 -Subject: [PATCH] 456 +Date: Wed, 18 Mar 2020 20:37:33 +0800 +Subject: [PATCH] 45 --- btt/bno_plot.py | 14 +++++++------- - btt/btt_plot.py | 6 ++++---- + btt/btt_plot.py | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/btt/bno_plot.py b/btt/bno_plot.py @@ -54,7 +54,7 @@ index aa92480..3506f33 100644 os.chdir(tmpdir) os.system(cmd) diff --git a/btt/btt_plot.py b/btt/btt_plot.py -index b81dad5..6e403ef 100755 +index b81dad5..79bdfad 100755 --- a/btt/btt_plot.py +++ b/btt/btt_plot.py @@ -163,7 +163,7 @@ def get_data(files): @@ -72,10 +72,9 @@ index b81dad5..6e403ef 100755 (opts, args) = getopt.getopt(args[1:], s_opts, l_opts) - except getopt.error, msg: + except getopt.error as msg: - print >>sys.stderr, msg + print >>sys.stderr, msg fatal(__doc__) - for (o, a) in opts: @@ -314,7 +314,7 @@ def generate_output(type, db): ofile = '%s.png' % type -- Gitee From d2b68cacac7c8cc57b34c6ee6c08e05584cd2500 Mon Sep 17 00:00:00 2001 From: eulerstorage Date: Wed, 18 Mar 2020 20:43:12 +0800 Subject: [PATCH 4/4] modify python2 function to python3 --- blktrace.spec | 4 ++-- modify-python2-expression-to-python3.patch | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/blktrace.spec b/blktrace.spec index 8cab730..1a1c7b8 100644 --- a/blktrace.spec +++ b/blktrace.spec @@ -7,8 +7,8 @@ Source: http://brick.kernel.dk/snaps/blktrace-%{version}.tar.bz2 URL: https://git.kernel.dk/cgit/blktrace BuildRequires: gcc, git, xz, libaio-devel, python3, librsvg2-devel blktrace sysstat theora-tools -Provides: iowatcher -Obsoletes: iowatcher +Provides: iowatcher = %{version}-%{release} +Obsoletes: iowatcher < %{version}-%{release} Requires: python3 Patch0: blktrace-fix-btt-overflow.patch diff --git a/modify-python2-expression-to-python3.patch b/modify-python2-expression-to-python3.patch index fefcb6c..c49cc4c 100644 --- a/modify-python2-expression-to-python3.patch +++ b/modify-python2-expression-to-python3.patch @@ -1,11 +1,11 @@ -From 0a4798b479a46c1f804901fd227fbd9bd84da32e Mon Sep 17 00:00:00 2001 +From 007e3250a86bfaf78c3729197cc2add76de4aacc Mon Sep 17 00:00:00 2001 From: eulerstorage -Date: Wed, 18 Mar 2020 18:31:54 +0800 -Subject: [PATCH] 456 +Date: Wed, 18 Mar 2020 20:37:33 +0800 +Subject: [PATCH] 45 --- btt/bno_plot.py | 14 +++++++------- - btt/btt_plot.py | 6 ++++---- + btt/btt_plot.py | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/btt/bno_plot.py b/btt/bno_plot.py @@ -54,7 +54,7 @@ index aa92480..3506f33 100644 os.chdir(tmpdir) os.system(cmd) diff --git a/btt/btt_plot.py b/btt/btt_plot.py -index b81dad5..6e403ef 100755 +index b81dad5..79bdfad 100755 --- a/btt/btt_plot.py +++ b/btt/btt_plot.py @@ -163,7 +163,7 @@ def get_data(files): @@ -72,10 +72,9 @@ index b81dad5..6e403ef 100755 (opts, args) = getopt.getopt(args[1:], s_opts, l_opts) - except getopt.error, msg: + except getopt.error as msg: - print >>sys.stderr, msg + print >>sys.stderr, msg fatal(__doc__) - for (o, a) in opts: @@ -314,7 +314,7 @@ def generate_output(type, db): ofile = '%s.png' % type -- Gitee