1 |
commit: 49b1038f628d110714a36e2839d37ebd507efb12 |
2 |
Author: Tim Harder <radhermit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 17 04:49:01 2019 +0000 |
4 |
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 17 05:06:51 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49b1038f |
7 |
|
8 |
app-text/xlsx2csv: version bump to 0.7.6 |
9 |
|
10 |
Signed-off-by: Tim Harder <radhermit <AT> gentoo.org> |
11 |
|
12 |
app-text/xlsx2csv/Manifest | 1 + |
13 |
app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch | 61 ++++++++++++++++++++++ |
14 |
app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild | 33 ++++++++++++ |
15 |
3 files changed, 95 insertions(+) |
16 |
|
17 |
diff --git a/app-text/xlsx2csv/Manifest b/app-text/xlsx2csv/Manifest |
18 |
index b0b07303699..7dbc902e10f 100644 |
19 |
--- a/app-text/xlsx2csv/Manifest |
20 |
+++ b/app-text/xlsx2csv/Manifest |
21 |
@@ -1,2 +1,3 @@ |
22 |
DIST xlsx2csv-0.7.3.tar.gz 201482 BLAKE2B a2268e584097777d28f2565a19d0f271cb694066e1abffffd7578ecf0271efd420af63932eaea4389c062e050da257fa2f7164c9de7cdfa4ab3fd416692e7968 SHA512 855fcce9ae6ec51c46673e085a456d2862912d0da5130fdac34d88e5612c64d2bc0674c13b3bfb6cd6b7017e513fe0924dbb594db543020842705a82b6006e8e |
23 |
DIST xlsx2csv-0.7.4.tar.gz 212472 BLAKE2B de77f4d199bd5fbb43fb4aa775aed9b36aea4c956846be42e9387b79bf76727ba457a0c54db3b4803376b82af12923f21786aa34d21542e2d6ab354be33ad3f3 SHA512 771af30dce63b64272fc8d4dccbcab2106f60a2c9d33370b4d4034a21606e5726c84d963d59e88e2aa124c60f62fd57831ca5fb442d7540474ff1d688da9aaf6 |
24 |
+DIST xlsx2csv-0.7.6.tar.gz 231283 BLAKE2B d0271c6a82b7ed2825e3224f0e34637db3dacda3fe99c6ef5a087cc8d248592efc169b466514abd18b50f6625e8d9743c812b46ecb6f76ce7d1fdc51dfe34fc4 SHA512 7fc8e0da0c050e12d0cfd73f16ffd9c00f19bf05925b54cc68d6a0858a75db89d52e46312956dfd149e0ec88778f68056942a090db44e6148796fad33fa26489 |
25 |
|
26 |
diff --git a/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch b/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch |
27 |
new file mode 100644 |
28 |
index 00000000000..f3e04b827bd |
29 |
--- /dev/null |
30 |
+++ b/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch |
31 |
@@ -0,0 +1,61 @@ |
32 |
+--- xlsx2csv-0.7.6/test/run |
33 |
++++ xlsx2csv-0.7.6/test/run |
34 |
+@@ -5,8 +5,6 @@ |
35 |
+ import subprocess |
36 |
+ from io import open |
37 |
+ |
38 |
+-PYTHON_VERSIONS = ["2.7"] |
39 |
+- |
40 |
+ """ |
41 |
+ This test uses sys.stdout. |
42 |
+ That means this test doesn't verify: |
43 |
+@@ -16,31 +14,24 @@ |
44 |
+ |
45 |
+ def compare(case, arguments=[]): |
46 |
+ failed = False |
47 |
+- for pyver in PYTHON_VERSIONS: |
48 |
+- ext = "xlsx" |
49 |
+- if os.path.exists("test/%s.xlsm" % case): |
50 |
+- ext = "xlsm" |
51 |
+- |
52 |
+- if os.name == 'posix':# in case of Linux |
53 |
+- left = subprocess.check_output(["python%s" %pyver, "./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','') |
54 |
+- elif os.name == 'nt':# in case of Windows |
55 |
+- # Use py.exe http://blog.python.org/2011/07/python-launcher-for-windows_11.html on Windows |
56 |
+- left = subprocess.check_output(["py", "-%s" %pyver, "./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','') |
57 |
+- else: |
58 |
+- print("os.name is unexpected: "+os.name) |
59 |
+- sys.exit(1) |
60 |
+- |
61 |
+- f = open("test/%s.csv" %case, "r", encoding="utf-8", newline="") |
62 |
+- right = f.read().replace('\r','') |
63 |
+- f.close() |
64 |
+- |
65 |
+- if left != right: |
66 |
+- print("FAILED: %s %s" %(case, pyver)) |
67 |
+- print(" actual:", left.replace("\r", "\\r").replace("\n", "\\n")) |
68 |
+- print(" expected:", right.replace("\r", "\\r").replace("\n", "\\n")) |
69 |
+- failed = True |
70 |
+- else: |
71 |
+- print("OK: %s %s" %(case, pyver)) |
72 |
++ ext = "xlsx" |
73 |
++ if os.path.exists("test/%s.xlsm" % case): |
74 |
++ ext = "xlsm" |
75 |
++ |
76 |
++ left = subprocess.check_output(["./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','') |
77 |
++ |
78 |
++ f = open("test/%s.csv" %case, "r", encoding="utf-8", newline="") |
79 |
++ right = f.read().replace('\r','') |
80 |
++ f.close() |
81 |
++ |
82 |
++ if left != right: |
83 |
++ print("FAILED: %s" % (case,)) |
84 |
++ print(" actual:", left.replace("\r", "\\r").replace("\n", "\\n")) |
85 |
++ print(" expected:", right.replace("\r", "\\r").replace("\n", "\\n")) |
86 |
++ failed = True |
87 |
++ else: |
88 |
++ print("OK: %s" % (case,)) |
89 |
++ |
90 |
+ if failed: |
91 |
+ sys.exit(1) |
92 |
+ |
93 |
|
94 |
diff --git a/app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild b/app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild |
95 |
new file mode 100644 |
96 |
index 00000000000..a23cd856301 |
97 |
--- /dev/null |
98 |
+++ b/app-text/xlsx2csv/xlsx2csv-0.7.6.ebuild |
99 |
@@ -0,0 +1,33 @@ |
100 |
+# Copyright 1999-2019 Gentoo Authors |
101 |
+# Distributed under the terms of the GNU General Public License v2 |
102 |
+ |
103 |
+EAPI="7" |
104 |
+PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} ) |
105 |
+PYTHON_REQ_USE="xml" |
106 |
+ |
107 |
+inherit distutils-r1 |
108 |
+ |
109 |
+DESCRIPTION="Convert MS Office xlsx files to CSV" |
110 |
+HOMEPAGE="https://github.com/dilshod/xlsx2csv/" |
111 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
112 |
+ |
113 |
+LICENSE="GPL-3" |
114 |
+SLOT="0" |
115 |
+KEYWORDS="~amd64 ~x86" |
116 |
+ |
117 |
+DEPEND="dev-lang/perl" |
118 |
+ |
119 |
+PATCHES=( "${FILESDIR}"/${P}-tests.patch ) |
120 |
+ |
121 |
+python_compile_all() { |
122 |
+ emake -C man |
123 |
+} |
124 |
+ |
125 |
+python_test() { |
126 |
+ "${PYTHON}" test/run || die "tests failed with ${EPYTHON}" |
127 |
+} |
128 |
+ |
129 |
+python_install_all() { |
130 |
+ distutils-r1_python_install_all |
131 |
+ doman man/${PN}.1 |
132 |
+} |