diff --git a/1.3.2.tar.gz b/1.3.2.tar.gz deleted file mode 100644 index 19a1d214bc645d93d45aa1eaf3d3daaead98541f..0000000000000000000000000000000000000000 Binary files a/1.3.2.tar.gz and /dev/null differ diff --git a/1.3.4.tar.gz b/1.3.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..159d982b27f18a8b211f7ba92211204d1454ac01 Binary files /dev/null and b/1.3.4.tar.gz differ diff --git a/decode.strings-tests-fixes-additionalEscapes-to-over.patch b/decode.strings-tests-fixes-additionalEscapes-to-over.patch deleted file mode 100644 index f391abf3b760aa36c5ad614ba1eb9b9a9bb74e4d..0000000000000000000000000000000000000000 --- a/decode.strings-tests-fixes-additionalEscapes-to-over.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 4198da3854ccfaabcb85de23fa4cf8144e45b44d Mon Sep 17 00:00:00 2001 -From: Thomas Harning Jr -Date: Mon, 18 Apr 2016 23:12:33 -0400 -Subject: [PATCH 52/66] decode.strings+tests: fixes additionalEscapes to - override builtin escapes and side-step escapeCheck needing to be altered - ---- - lua/json/decode/strings.lua | 6 +++--- - tests/lunit-tests.lua | 6 ++++-- - 2 files changed, 7 insertions(+), 5 deletions(-) - -diff --git a/lua/json/decode/strings.lua b/lua/json/decode/strings.lua -index cb3b5cc..4272f29 100644 ---- a/lua/json/decode/strings.lua -+++ b/lua/json/decode/strings.lua -@@ -107,12 +107,12 @@ local function generateLexer(options) - local escapeMatch = doSimpleSub - escapeMatch = escapeMatch + doXSub / decodeX - escapeMatch = escapeMatch + doUniSub / options.decodeUnicode -- if options.additionalEscapes then -- escapeMatch = escapeMatch + options.additionalEscapes -- end - if options.escapeCheck then - escapeMatch = options.escapeCheck * escapeMatch + bad_escape - end -+ if options.additionalEscapes then -+ escapeMatch = options.additionalEscapes + escapeMatch -+ end - local captureString - for i = 1, #quotes do - local cap = buildCaptureString(quotes[i], options.badChars, escapeMatch) -diff --git a/tests/lunit-tests.lua b/tests/lunit-tests.lua -index 10f38cb..d2f183f 100644 ---- a/tests/lunit-tests.lua -+++ b/tests/lunit-tests.lua -@@ -44,8 +44,10 @@ function test_preprocess() - end - - function test_additionalEscapes_only() -- -- Need to do escape while skipping escape character san-check -- assert_equal("Hello", json.decode([["\S"]], { strings = { additionalEscapes = lpeg.C(lpeg.P("S")) / "Hello", escapeCheck= false } })) -+ -- Test that additionalEscapes is processed on its own - side-stepping normal processing -+ assert_equal("Hello\\?", json.decode([["\S"]], { strings = { additionalEscapes = lpeg.C(lpeg.P("S")) / "Hello\\?" } })) -+ -- Test that additionalEscapes overrides any builtin handling -+ assert_equal("Hello\\?", json.decode([["\n"]], { strings = { additionalEscapes = lpeg.C(lpeg.P("n")) / "Hello\\?" } })) - end - - local strictDecoder = json.decode.getDecoder(true) --- -2.19.1 - diff --git a/lua-json.spec b/lua-json.spec index 4aa4101a699cbd6ad62a0063a3a445b2a12793af..13b1656dffcfa8978b442aed4cc8cf9421bc5934 100644 --- a/lua-json.spec +++ b/lua-json.spec @@ -1,6 +1,6 @@ Name: lua-json -Version: 1.3.2 -Release: 14 +Version: 1.3.4 +Release: 1 License: MIT Summary: JSON Parser/Constructor for Lua @@ -10,7 +10,7 @@ Summary: JSON Parser/Constructor for Lua %global shortid %(c=%{commitid}; echo ${c:0:7}) URL: http://github.com/harningt/luajson/ -Source0: https://github.com/harningt/luajson/archive/%{version}.tar.gz +Source0: https://github.com/harningt/luajson/archive/refs/tags/%{version}.tar.gz # for build and check BuildRequires: lua >= %{luaversion}, lua-lpeg >= 0.8.1 BuildRequires: lua-filesystem >= 1.4.1, lua-lunit >= 0.4 @@ -18,11 +18,6 @@ BuildArch: noarch # for run Requires: lua >= %{luaversion}, lua-lpeg >= 0.8.1 -Patch0: luajson-lua-5.2.patch - -Patch6000: tests-enhances-coverage-for-strings.additionalEscape.patch -Patch6001: decode.strings-tests-fixes-additionalEscapes-to-over.patch - %description JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible. @@ -44,6 +39,9 @@ make check-regression %{luapkgdir}/* %changelog +* Mon Jun 27 2022 dillon chen -1.3.4-1 +- update to 1.3.4 + * Tue Sep 8 2020 shixuantong - 1.3.2-14 - Type: bugfix - ID: NA diff --git a/luajson-lua-5.2.patch b/luajson-lua-5.2.patch deleted file mode 100644 index 75966c10690af1db668da8be8dbc39606dc59246..0000000000000000000000000000000000000000 --- a/luajson-lua-5.2.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua.lua-52 luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua ---- luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua.lua-52 2013-05-10 16:32:47.277329679 -0400 -+++ luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua 2013-05-10 16:33:19.301328534 -0400 -@@ -8,7 +8,7 @@ local jsonutil = require("json.util") - local assert = assert - local type = type - local next = next --local unpack = unpack -+local unpack = table.unpack - - local _ENV = nil - -diff -up luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua.lua-52 luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua ---- luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua.lua-52 2013-05-10 16:31:50.764331699 -0400 -+++ luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua 2013-05-10 16:32:00.788331341 -0400 -@@ -8,7 +8,7 @@ local setmetatable = setmetatable - module("lunit-encoderfunc", lunit.testcase, package.seeall) - - local function build_call(name, parameters) -- return json.util.buildCall(name, unpack(parameters, parameters.n)) -+ return json.util.buildCall(name, table.unpack(parameters, parameters.n)) - end - - function test_param_counts() diff --git a/tests-enhances-coverage-for-strings.additionalEscape.patch b/tests-enhances-coverage-for-strings.additionalEscape.patch deleted file mode 100644 index 25cbbd59f6122f6115efccba5f157150fce4ab6a..0000000000000000000000000000000000000000 --- a/tests-enhances-coverage-for-strings.additionalEscape.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 4556f70aa8fd4826551399701144ec56f4733954 Mon Sep 17 00:00:00 2001 -From: Thomas Harning Jr -Date: Mon, 18 Apr 2016 23:08:49 -0400 -Subject: [PATCH] tests: enhances coverage for strings.additionalEscapes - decoding option - ---- - tests/lunit-tests.lua | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/tests/lunit-tests.lua b/tests/lunit-tests.lua -index 30e82df..d25216c 100644 ---- a/tests/lunit-tests.lua -+++ b/tests/lunit-tests.lua -@@ -1,6 +1,7 @@ - local json = require("json") - local lunit = require("lunit") - local testutil = require("testutil") -+local lpeg = require("lpeg") - -- DECODE NOT 'local' due to requirement for testutil to access it - decode = json.decode.getDecoder(false) - -@@ -35,6 +36,11 @@ function test_preprocess() - assert_equal('-Infinity', json.encode(1/0, {preProcess = function(x) return -x end})) - end - -+function test_additionalEscapes_only() -+ -- Need to do escape while skipping escape character san-check -+ assert_equal("Hello", json.decode([["\S"]], { strings = { additionalEscapes = lpeg.C(lpeg.P("S")) / "Hello", escapeCheck= false } })) -+end -+ - local strictDecoder = json.decode.getDecoder(true) - - local function buildStrictDecoder(f) -@@ -45,7 +51,7 @@ local function buildFailedStrictDecoder(f) - end - -- SETUP CHECKS FOR SEQUENCE OF DECODERS - for k, v in pairs(_M) do -- if k:match("^test_") and not k:match("_gen$") then -+ if k:match("^test_") and not k:match("_gen$") and not k:match("_only$") then - if k:match("_nostrict") then - _M[k .. "_strict_gen"] = buildFailedStrictDecoder(v) - else --- -1.8.3.1 -