diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2017-06-14 12:02:34 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-06-14 12:33:12 +0200 |
commit | 37de56f40d83e20b5a09e2e14be98cb3fbf1d3ff (patch) | |
tree | 5590c3e3f34c6504c8d948d2774ff2bf696f8f19 | |
parent | cf45338daafa8d5f517fda82b707b26f2036099f (diff) | |
download | alpine_aports-37de56f40d83e20b5a09e2e14be98cb3fbf1d3ff.tar.bz2 alpine_aports-37de56f40d83e20b5a09e2e14be98cb3fbf1d3ff.tar.xz alpine_aports-37de56f40d83e20b5a09e2e14be98cb3fbf1d3ff.zip |
community/lua-toml: fix decode arrays and include testcase
https://github.com/jonstoler/lua-toml/pull/13
-rw-r--r-- | community/lua-toml/APKBUILD | 10 | ||||
-rw-r--r-- | community/lua-toml/fix-decode-arrays-and-include-testcase.patch | 50 |
2 files changed, 55 insertions, 5 deletions
diff --git a/community/lua-toml/APKBUILD b/community/lua-toml/APKBUILD index e70451e2c2..fe2dfdb4c8 100644 --- a/community/lua-toml/APKBUILD +++ b/community/lua-toml/APKBUILD | |||
@@ -2,14 +2,15 @@ | |||
2 | # Maintainer: Jakub Jirutka <jakub@jirutka.cz> | 2 | # Maintainer: Jakub Jirutka <jakub@jirutka.cz> |
3 | pkgname=lua-toml | 3 | pkgname=lua-toml |
4 | pkgver=1.0 | 4 | pkgver=1.0 |
5 | pkgrel=4 | 5 | pkgrel=5 |
6 | pkgdesc="TOML decoder/encoder for Lua" | 6 | pkgdesc="TOML decoder/encoder for Lua" |
7 | url="https://github.com/jonstoler/lua-toml" | 7 | url="https://github.com/jonstoler/lua-toml" |
8 | arch="noarch" | 8 | arch="noarch" |
9 | license="Happy" | 9 | license="Happy" |
10 | depends="" | 10 | depends="" |
11 | checkdepends="lua-busted" | 11 | checkdepends="lua-busted" |
12 | source="$pkgname-$pkgver.tar.gz::https://github.com/jonstoler/$pkgname/archive/v$pkgver.tar.gz" | 12 | source="$pkgname-$pkgver.tar.gz::https://github.com/jonstoler/$pkgname/archive/v$pkgver.tar.gz |
13 | fix-decode-arrays-and-include-testcase.patch" | ||
13 | builddir="$srcdir/$pkgname-$pkgver" | 14 | builddir="$srcdir/$pkgname-$pkgver" |
14 | 15 | ||
15 | # luajit is not available for selected arches | 16 | # luajit is not available for selected arches |
@@ -47,6 +48,5 @@ _subpackage() { | |||
47 | install -m 644 -D toml.lua "$subpkgdir"/usr/share/lua/$lver/toml.lua | 48 | install -m 644 -D toml.lua "$subpkgdir"/usr/share/lua/$lver/toml.lua |
48 | } | 49 | } |
49 | 50 | ||
50 | md5sums="00422b0ef80b8903706360761fe204a1 lua-toml-1.0.tar.gz" | 51 | sha512sums="f04ed6f26f47d6492c7a21c310da09b1091476724022c32b81a5492713340a4571bc04c51f34dded73f4f1cf1085dbe08e280356b0f1fa88ef0efefd0685c77e lua-toml-1.0.tar.gz |
51 | sha256sums="4c81ae8c338d3da3d7007978f4ec2c736ea89448beaa5583fba7092e46a90e0d lua-toml-1.0.tar.gz" | 52 | 8f09e578ef3e7bcc35316ca290e21a47b2d62b439a06228c7e6dcef14e3306800aa44d8b4d70ff2e1cf17211bf7e585423bb4fcd9edb4131076532d4bf5b0640 fix-decode-arrays-and-include-testcase.patch" |
52 | sha512sums="f04ed6f26f47d6492c7a21c310da09b1091476724022c32b81a5492713340a4571bc04c51f34dded73f4f1cf1085dbe08e280356b0f1fa88ef0efefd0685c77e lua-toml-1.0.tar.gz" | ||
diff --git a/community/lua-toml/fix-decode-arrays-and-include-testcase.patch b/community/lua-toml/fix-decode-arrays-and-include-testcase.patch new file mode 100644 index 0000000000..0409f39ee1 --- /dev/null +++ b/community/lua-toml/fix-decode-arrays-and-include-testcase.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From d77cbb5f94bb8fbaa8d589573de20ce120765055 Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Wed, 14 Jun 2017 11:23:32 +0200 | ||
4 | Subject: [PATCH 1/2] add test case for issue #12 | ||
5 | |||
6 | --- | ||
7 | spec/encode_spec.lua | 11 +++++++++++ | ||
8 | 1 file changed, 11 insertions(+) | ||
9 | create mode 100644 spec/encode_spec.lua | ||
10 | |||
11 | diff --git a/spec/encode_spec.lua b/spec/encode_spec.lua | ||
12 | new file mode 100644 | ||
13 | index 0000000..db26834 | ||
14 | --- /dev/null | ||
15 | +++ b/spec/encode_spec.lua | ||
16 | @@ -0,0 +1,11 @@ | ||
17 | +describe("encoding", function() | ||
18 | + setup(function() | ||
19 | + TOML = require "toml" | ||
20 | + end) | ||
21 | + | ||
22 | + it("array", function() | ||
23 | + local obj = TOML.encode{ a = { "foo","bar" } } | ||
24 | + local sol = "a = [\nfoo,\nbar,\n]" | ||
25 | + assert.same(sol, obj) | ||
26 | + end) | ||
27 | +end) | ||
28 | |||
29 | From b914f26b66856d82d11d4c9205d5ccd97ae54bb6 Mon Sep 17 00:00:00 2001 | ||
30 | From: Natanael Copa <ncopa@alpinelinux.org> | ||
31 | Date: Wed, 14 Jun 2017 11:44:20 +0200 | ||
32 | Subject: [PATCH 2/2] fix encoding of plain ol borring arrays (issue #12) | ||
33 | |||
34 | --- | ||
35 | toml.lua | 2 +- | ||
36 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
37 | |||
38 | diff --git a/toml.lua b/toml.lua | ||
39 | index a5655ed..b5eb2ed 100644 | ||
40 | --- a/toml.lua | ||
41 | +++ b/toml.lua | ||
42 | @@ -619,7 +619,7 @@ TOML.encode = function(tbl) | ||
43 | else | ||
44 | -- plain ol boring array | ||
45 | toml = toml .. k .. " = [\n" | ||
46 | - for kk, vv in pairs(v) do | ||
47 | + for kk, vv in pairs(first) do | ||
48 | toml = toml .. tostring(vv) .. ",\n" | ||
49 | end | ||
50 | toml = toml .. "]\n" | ||