summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoan Bruguera2019-04-30 01:09:30 +0200
committerJoan Bruguera2019-04-30 01:09:30 +0200
commit8a87dc3b166be2611c1c64e743528d19df77cbd0 (patch)
treef959639863ccfaf5486901dbe013c590b396ee43
parentdeaff8f44b821c6ea47fe809dfe80bd6b922ead9 (diff)
downloadaur-8a87dc3b166be2611c1c64e743528d19df77cbd0.tar.gz
Fix scripts (only those included in the generated bin) that depend on python2.
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD15
-rw-r--r--python3-ports.patch41
3 files changed, 56 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 52ced297b231..58dd62fb86ae 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = tracking
pkgdesc = Analyze how the behavior of a parallel application evolves through different scenarios (from BSC).
pkgver = 2.6.10
- pkgrel = 3
+ pkgrel = 4
url = https://www.bsc.es/discover-bsc/organisation/scientific-structure/performance-tools
arch = i686
arch = x86_64
@@ -12,7 +12,9 @@ pkgbase = tracking
depends = python-wxpython
depends = python-matplotlib
source = https://ftp.tools.bsc.es/tracking/tracking-2.6.10-src.tar.bz2
+ source = python3-ports.patch
sha512sums = 577783edf85f9a53fdabc8a25556fca806c8a9c3df28d713815fc5cccb63450bf3a5d0ee904bec4e7b125f3278d75e6c2b9c2e899f14ab4694d288b07db3eb9d
+ sha512sums = 78568513919ee9d5e2c1c2a9f835259d097b2bbd246fc911b4c2083d4e2a9e20c86a15e990997b41dd5e62bb04d3c156c2aa47ad90d6d3fc55eca1040fc97ed9
pkgname = tracking
diff --git a/PKGBUILD b/PKGBUILD
index b76f5b303097..afd25f155fb6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,13 +2,22 @@
pkgname='tracking'
pkgdesc='Analyze how the behavior of a parallel application evolves through different scenarios (from BSC).'
pkgver='2.6.10'
-pkgrel='3'
+pkgrel='4'
arch=('i686' 'x86_64')
url='https://www.bsc.es/discover-bsc/organisation/scientific-structure/performance-tools'
license=('GPL2')
depends=(wxparaver clusteringsuite python-pillow python-wxpython python-matplotlib)
-source=("https://ftp.tools.bsc.es/$pkgname/$pkgname-$pkgver-src.tar.bz2")
-sha512sums=(577783edf85f9a53fdabc8a25556fca806c8a9c3df28d713815fc5cccb63450bf3a5d0ee904bec4e7b125f3278d75e6c2b9c2e899f14ab4694d288b07db3eb9d)
+source=("https://ftp.tools.bsc.es/$pkgname/$pkgname-$pkgver-src.tar.bz2"
+ python3-ports.patch)
+sha512sums=(577783edf85f9a53fdabc8a25556fca806c8a9c3df28d713815fc5cccb63450bf3a5d0ee904bec4e7b125f3278d75e6c2b9c2e899f14ab4694d288b07db3eb9d
+ 78568513919ee9d5e2c1c2a9f835259d097b2bbd246fc911b4c2083d4e2a9e20c86a15e990997b41dd5e62bb04d3c156c2aa47ad90d6d3fc55eca1040fc97ed9)
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # WORKAROUND: Fix some scripts that still only work with Python 2
+ patch -Np1 -i "$srcdir/python3-ports.patch"
+}
build() {
cd "$srcdir/$pkgname-$pkgver"
diff --git a/python3-ports.patch b/python3-ports.patch
new file mode 100644
index 000000000000..d6933911a7d0
--- /dev/null
+++ b/python3-ports.patch
@@ -0,0 +1,41 @@
+diff --git a/src/scripts/scale-frames.py b/src/scripts/scale-frames.py
+index cadaeb1..f10c60b 100755
+--- a/src/scripts/scale-frames.py
++++ b/src/scripts/scale-frames.py
+@@ -17,8 +17,8 @@ SuffixNormalizedCSV = ".norm"
+
+ ### Prints help
+ def PrintUsage():
+- print "SYNTAX"
+- print " " + sys.argv[0] + " [-s DIMENSION1,DIMENSION2...] TRACE1 TRACE2 ...\n"
++ print("SYNTAX")
++ print(" " + sys.argv[0] + " [-s DIMENSION1,DIMENSION2...] TRACE1 TRACE2 ...\n")
+
+ if (len(sys.argv) < 2): # FIXME
+ PrintUsage()
+@@ -75,14 +75,14 @@ while ((currentArg < len(sys.argv)) and (sys.argv[currentArg][0] == '-')):
+ DimensionsToScale = [dim for dim in DimensionsToScale]
+ else:
+ PrintUsage()
+- print "*** INVALID PARAMETER "+sys.argv[currentArg];
++ print("*** INVALID PARAMETER "+sys.argv[currentArg]);
+ sys.exit(-1)
+ currentArg = currentArg + 1
+
+ ### 1 trace at least
+ if (len(sys.argv) - currentArg < 1):
+ PrintUsage()
+- print "*** Error: Pass 1 or more traces!"
++ print("*** Error: Pass 1 or more traces!")
+ sys.exit(-1)
+
+ InputTraces = [] # array[ TRACE1, TRACE2 ... ]
+@@ -112,7 +112,7 @@ for Trace in sys.argv[currentArg:]:
+ CSVFile = TraceBasename + SuffixClustersData
+
+ ### Get the number of tasks from the trace
+- Header = subprocess.Popen(["head", "-n1", Trace], shell=False, stdout=subprocess.PIPE).communicate()[0]
++ Header = subprocess.Popen(["head", "-n1", Trace], shell=False, stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
+ numTasks = float(Header.split("(")[2].split(":")[2])
+ TasksPerTrace.append(numTasks)
+