diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2017-06-14 12:02:34 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2017-06-14 12:02:57 +0200 |
commit | 85ce82b389e5d418380b85731152da07155cf0b2 (patch) | |
tree | 3a37873a0d80ded3c07dc8d5d44c5aa05972a5f5 /community/lua-toml | |
parent | cad5581a14cb3580b186149e043b92fb49cb73a0 (diff) | |
download | aports-85ce82b389e5d418380b85731152da07155cf0b2.tar.bz2 aports-85ce82b389e5d418380b85731152da07155cf0b2.tar.xz |
community/lua-toml: fix decode arrays and include testcase
https://github.com/jonstoler/lua-toml/pull/13
Diffstat (limited to 'community/lua-toml')
-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 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=lua-toml pkgver=1.0 -pkgrel=4 +pkgrel=5 pkgdesc="TOML decoder/encoder for Lua" url="https://github.com/jonstoler/lua-toml" arch="noarch" license="Happy" depends="" checkdepends="lua-busted" -source="$pkgname-$pkgver.tar.gz::https://github.com/jonstoler/$pkgname/archive/v$pkgver.tar.gz" +source="$pkgname-$pkgver.tar.gz::https://github.com/jonstoler/$pkgname/archive/v$pkgver.tar.gz + fix-decode-arrays-and-include-testcase.patch" builddir="$srcdir/$pkgname-$pkgver" # luajit is not available for selected arches @@ -47,6 +48,5 @@ _subpackage() { install -m 644 -D toml.lua "$subpkgdir"/usr/share/lua/$lver/toml.lua } -md5sums="00422b0ef80b8903706360761fe204a1 lua-toml-1.0.tar.gz" -sha256sums="4c81ae8c338d3da3d7007978f4ec2c736ea89448beaa5583fba7092e46a90e0d lua-toml-1.0.tar.gz" -sha512sums="f04ed6f26f47d6492c7a21c310da09b1091476724022c32b81a5492713340a4571bc04c51f34dded73f4f1cf1085dbe08e280356b0f1fa88ef0efefd0685c77e lua-toml-1.0.tar.gz" +sha512sums="f04ed6f26f47d6492c7a21c310da09b1091476724022c32b81a5492713340a4571bc04c51f34dded73f4f1cf1085dbe08e280356b0f1fa88ef0efefd0685c77e lua-toml-1.0.tar.gz +8f09e578ef3e7bcc35316ca290e21a47b2d62b439a06228c7e6dcef14e3306800aa44d8b4d70ff2e1cf17211bf7e585423bb4fcd9edb4131076532d4bf5b0640 fix-decode-arrays-and-include-testcase.patch" 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 @@ +From d77cbb5f94bb8fbaa8d589573de20ce120765055 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 14 Jun 2017 11:23:32 +0200 +Subject: [PATCH 1/2] add test case for issue #12 + +--- + spec/encode_spec.lua | 11 +++++++++++ + 1 file changed, 11 insertions(+) + create mode 100644 spec/encode_spec.lua + +diff --git a/spec/encode_spec.lua b/spec/encode_spec.lua +new file mode 100644 +index 0000000..db26834 +--- /dev/null ++++ b/spec/encode_spec.lua +@@ -0,0 +1,11 @@ ++describe("encoding", function() ++ setup(function() ++ TOML = require "toml" ++ end) ++ ++ it("array", function() ++ local obj = TOML.encode{ a = { "foo","bar" } } ++ local sol = "a = [\nfoo,\nbar,\n]" ++ assert.same(sol, obj) ++ end) ++end) + +From b914f26b66856d82d11d4c9205d5ccd97ae54bb6 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Wed, 14 Jun 2017 11:44:20 +0200 +Subject: [PATCH 2/2] fix encoding of plain ol borring arrays (issue #12) + +--- + toml.lua | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/toml.lua b/toml.lua +index a5655ed..b5eb2ed 100644 +--- a/toml.lua ++++ b/toml.lua +@@ -619,7 +619,7 @@ TOML.encode = function(tbl) + else + -- plain ol boring array + toml = toml .. k .. " = [\n" +- for kk, vv in pairs(v) do ++ for kk, vv in pairs(first) do + toml = toml .. tostring(vv) .. ",\n" + end + toml = toml .. "]\n" |