debian/0000755000000000000000000000000012201123742007160 5ustar debian/watch0000644000000000000000000000031712201123742010212 0ustar # test this watch file using: # uscan --watchfile debian/watch --upstream-version 0.0.1 --package luaexpat # version=3 http://luaforge.net/frs/?group_id=13 \ /frs/download.php/\d+/luaexpat-([\d\.]*).tar.gz debian/lua5.1.dh-lua.conf0000644000000000000000000000103112201123742012200 0ustar PKG_NAME=expat ### things relative to the C library part CLIB_CFLAGS= -I src/ CLIB_LDFLAGS= -lexpat CLIB_OBJS= src/lxplib.lo ### things relative to the lua library part LUA_HEADER=src/lxplib.h LUA_SOURCES=src/lxp/lom.lua LUA_SOURCES_MANGLER=sed 's?^src/??' LUA_MODNAME=lxp LUA_TEST=tests/test.lua; tests/test-lom.lua ### this part is relative to pkg-config PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1) PKG_LIBS_PRIVATE= PKG_URL=http://luaforge.net/projects/luaexpat/ PKG_REQUIRES= PKG_CONFLICTS= debian/lua-expat-dev.docs0000644000000000000000000000000712201123742012503 0ustar doc/us debian/rules0000755000000000000000000000007312201123742010240 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=lua --with lua debian/compat0000644000000000000000000000000212201123742010356 0ustar 7 debian/lua5.2.dh-lua.conf0000777000000000000000000000000012201123742015230 2lua5.1.dh-lua.confustar debian/source/0000755000000000000000000000000012201123742010460 5ustar debian/source/format0000644000000000000000000000001412201123742011666 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000000705712201123742011043 0ustar lua-expat (1.2.0-6) unstable; urgency=low * Packaging moved to git * Remove transitional packages -- Enrico Tassi Thu, 19 Apr 2012 09:58:50 +0200 lua-expat (1.2.0-5) unstable; urgency=low * Clean up debian/rules * Build depend on dh-lua >= 12 * Copyright file ported to 1.0 format -- Enrico Tassi Thu, 19 Apr 2012 09:56:34 +0200 lua-expat (1.2.0-4) unstable; urgency=low * Removed build dependency over shake that is lua5.1 only * Bump Standards-Version to 3.9.3, no changes * Switch to dh-lua * Packages renamed according to the new lua policy * Add patch lua5.2.patch adding support for lua5.2 * Copyright file ported to dep5 format * Updated upstream contact infos -- Enrico Tassi Mon, 09 Apr 2012 16:39:20 +0200 lua-expat (1.2.0-3) unstable; urgency=low * source format 3.0 (quilt) -- Enrico Tassi Thu, 21 Jul 2011 17:52:15 +0200 lua-expat (1.2.0-2) unstable; urgency=low * Bump Standards-Version to 3.9.2, no changes * Multi-Arch compliant (build-depend on lua-policy >= 32 and dh >= 8.1.3) -- Enrico Tassi Wed, 20 Jul 2011 21:48:31 +0200 lua-expat (1.2.0-1) unstable; urgency=high * new upstream release adding APIs to prevent the “billion laughs” denial-of-service attack (Closes: #629225) -- Enrico Tassi Sat, 04 Jun 2011 18:02:33 +0200 lua-expat (1.1.0-4) unstable; urgency=low * depend on lua5.1-policy-dev >= 27 to kill all .la files (Closes: #620600) -- Enrico Tassi Tue, 31 May 2011 09:48:40 +0200 lua-expat (1.1.0-3) unstable; urgency=low * depend on lua5.1-policy-dev >= 22 * changed lua to Lua in the package description * bumped standards-version to 3.8.2, no changes needed -- Enrico Tassi Tue, 21 Jul 2009 12:48:09 +0200 lua-expat (1.1.0-2) unstable; urgency=low * Renamed cdbs deprecated variable * Vcs- fields fixed * Use shake to run compilation tests * Added Homepage control field * Removed dpatch build dependency * Moved -dev package in section libdevel -- Enrico Tassi Tue, 18 Mar 2008 17:12:50 +0100 lua-expat (1.1.0-1) unstable; urgency=low * new upstream release, works out of the box with lua5.1 -- Enrico Tassi Fri, 08 Jun 2007 18:42:44 +0200 lua-expat (1.0.2-5) unstable; urgency=low * Updated to policy 10 that fixes clean target (Closes: #424551) -- Enrico Tassi Wed, 16 May 2007 16:20:50 +0200 lua-expat (1.0.2-4) unstable; urgency=low * made control file binNMU safe * Added a note about the documentation shipped within the -dev package in the control file * Added call to lua5.1-policy-apply --reverse in the clean:: hook -- Enrico Tassi Mon, 8 Jan 2007 17:32:37 +0100 lua-expat (1.0.2-3) unstable; urgency=low * Moved to policy version 7 * The FTBFS bug #405990 is because of an incompatibility with the policy version 7 that is not in etch. This incompatibility has been fixed (Closes: #405990) -- Enrico Tassi Mon, 8 Jan 2007 17:30:34 +0100 lua-expat (1.0.2-2) unstable; urgency=low * added XS-X-Vcs-svn field to control. -- Enrico Tassi Sun, 3 Sep 2006 10:26:13 +0200 lua-expat (1.0.2-1) unstable; urgency=low * Initial release. (Closes: #384350) -- Enrico Tassi Wed, 23 Aug 2006 20:12:16 +0200 debian/copyright0000644000000000000000000000245512201123742011121 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: luaexpat Upstream-Contact: Matthew Wild Source: http://matthewwild.co.uk/projects/luaexpat/ Files: * Copyright: 2003-2006 The Kepler Project License: MIT/X Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/control0000644000000000000000000000256312201123742010571 0ustar Source: lua-expat Section: interpreters Priority: optional Maintainer: Enrico Tassi Build-Depends: debhelper (>= 8.1.3), dh-lua (>= 12), libexpat1-dev Standards-Version: 3.9.3 Homepage: http://matthewwild.co.uk/projects/luaexpat/ Vcs-Git: git://git.debian.org/git/pkg-lua/lua-expat.git Vcs-Browser: http://git.debian.org/?p=pkg-lua/lua-expat.git Package: lua-expat Architecture: any Multi-Arch: same Pre-Depends: multiarch-support Depends: ${misc:Depends}, ${shlibs:Depends} Provides: liblua5.1-expat0, ${lua:Provides} Replaces: liblua5.1-expat0 (<< 1.2.0-4~) Breaks: liblua5.1-expat0 (<< 1.2.0-4~) XB-Lua-Versions: ${lua:Versions} Description: libexpat bindings for the Lua language This package contains the bindings for the expat library. Package: lua-expat-dev Architecture: any Multi-Arch: same Pre-Depends: multiarch-support Depends: ${misc:Depends}, lua-expat (= ${binary:Version}) Replaces: liblua5.1-expat-dev (<< 1.2.0-4~) Breaks: liblua5.1-expat-dev (<< 1.2.0-4~) Provides: liblua5.1-expat-dev, ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Section: libdevel Description: libexpat development files for the Lua language This package contains the development files of the libexpat Lua bindings, useful to create a statically linked binary (like a C application or a standalone Lua interpreter). Documentation is also shipped within this package. debian/patches/0000755000000000000000000000000012201123742010607 5ustar debian/patches/lua5.2.patch0000644000000000000000000001403712201123742012643 0ustar Index: lua-expat-1.2.0/src/lxplib.c =================================================================== --- lua-expat-1.2.0.orig/src/lxplib.c 2011-06-03 16:17:04.000000000 +0200 +++ lua-expat-1.2.0/src/lxplib.c 2012-02-22 12:05:14.000000000 +0100 @@ -17,6 +17,12 @@ #include "compat-5.1.h" #endif +#if (LUA_VERSION_NUM == 502) + +#undef luaL_register +#define luaL_register(L,n,f) \ + { if ((n) == NULL) luaL_setfuncs(L,f,0); else luaL_newlib(L,f); } +#endif #include "lxplib.h" @@ -66,7 +72,7 @@ static void lxpclose (lua_State *L, lxp_userdata *xpu) { - lua_unref(L, xpu->tableref); + luaL_unref(L, LUA_REGISTRYINDEX, xpu->tableref); xpu->tableref = LUA_REFNIL; if (xpu->parser) XML_ParserFree(xpu->parser); @@ -225,7 +231,7 @@ child->parser = XML_ExternalEntityParserCreate(p, context, NULL); if (!child->parser) luaL_error(L, "XML_ParserCreate failed"); - lua_getref(L, xpu->tableref); /* child uses the same table of its father */ + lua_rawgeti(L, LUA_REGISTRYINDEX, xpu->tableref); /* child uses the same table of its father */ child->tableref = luaL_ref(L, LUA_REGISTRYINDEX); lua_pushstring(L, base); lua_pushstring(L, systemId); @@ -449,7 +455,7 @@ xpu->state = XPSok; xpu->b = &b; lua_settop(L, 2); - lua_getref(L, xpu->tableref); /* to be used by handlers */ + lua_rawgeti(L, LUA_REGISTRYINDEX, xpu->tableref); /* to be used by handlers */ status = XML_Parse(xpu->parser, s, (int)len, s == NULL); if (xpu->state == XPSstring) dischargestring(xpu); if (xpu->state == XPSerror) { /* callback error? */ @@ -517,7 +523,7 @@ return 1; } -static const struct luaL_reg lxp_meths[] = { +static const struct luaL_Reg lxp_meths[] = { {"parse", lxp_parse}, {"close", lxp_close}, {"__gc", parser_gc}, @@ -530,7 +536,7 @@ {NULL, NULL} }; -static const struct luaL_reg lxp_funcs[] = { +static const struct luaL_Reg lxp_funcs[] = { {"new", lxp_make_parser}, {NULL, NULL} }; @@ -557,8 +563,8 @@ lua_pushliteral(L, "__index"); lua_pushvalue(L, -2); lua_rawset(L, -3); - luaL_openlib (L, NULL, lxp_meths, 0); - luaL_openlib (L, "lxp", lxp_funcs, 0); + luaL_register (L, NULL, lxp_meths); + luaL_register (L, "lxp", lxp_funcs); set_info (L); return 1; Index: lua-expat-1.2.0/tests/test.lua =================================================================== --- lua-expat-1.2.0.orig/tests/test.lua 2011-06-03 16:17:04.000000000 +0200 +++ lua-expat-1.2.0/tests/test.lua 2012-02-22 12:05:14.000000000 +0100 @@ -2,7 +2,7 @@ -- See Copyright Notice in license.html -- $Id: test.lua,v 1.6 2006/06/08 20:34:52 tomas Exp $ -require"lxp" +lxp = require"lxp" print (lxp._VERSION) -- basic test with no preamble @@ -36,10 +36,11 @@ ]] local X -function getargs (...) X = arg end +function getargs (...) X = {...} end function xgetargs (c) return function (...) + local arg = {...} table.insert(arg, 1, c) table.insert(X, arg) end @@ -58,10 +59,10 @@ assert(p:parse([[ ]])) -assert(X.n == 3 and X[1] == p and X[2] == "to") +assert(#X == 3 and X[1] == p and X[2] == "to") x = X[3] assert(x.priority=="10" and x.xu=="hi" and x.method=="POST") -assert(x[1] == "priority" and x[2] == "xu" and table.getn(x) == 2) +assert(x[1] == "priority" and x[2] == "xu" and #x == 2) assert(p:parse("")) assert(p:parse()) p:close() @@ -94,8 +95,7 @@ assert(p:parse(preamble)) assert(p:parse"") assert(p:parse"") -assert(table.getn(X) == 3) -assert(X[1][1] == "s" and X[1][2] == p) +assert(#X == 3 and X[1][1] == "s" and X[1][2] == p) assert(X[2][1] == "c" and X[2][2] == p and X[2][3] == "hi") assert(X[3][1] == "e" and X[3][2] == p) assert(p:parse"") @@ -200,7 +200,7 @@ assert(p:parse[[]]) p:close() assert(X[2] == "test-unparsed" and X[3] == "/base" and - X[4] == "unparsed.txt" and X[6] == "txt" and X.n == 6) + X[4] == "unparsed.txt" and X[6] == "txt" and #X == 6) @@ -220,13 +220,13 @@ ]]) p:close() x = X[1] -assert(x[1] == "sn" and x[3] == "space" and x[4] == "a/namespace" and table.getn(x) == 4) +assert(x[1] == "sn" and x[3] == "space" and x[4] == "a/namespace" and #x == 4) x = X[3] assert(x[1] == "s" and x[3] == "a/namespace?a") x = X[4] assert(x[1] == "e" and x[3] == "a/namespace?a") x = X[6] -assert(x[1] == "en" and x[3] == "space" and table.getn(x) == 3) +assert(x[1] == "en" and x[3] == "space" and #x == 3) ---------------------------- print("testing doctype declarations") @@ -313,14 +313,14 @@ -- test for GC print("\ntesting garbage collection") collectgarbage(); collectgarbage() -local x = gcinfo() +local x = collectgarbage("count") for i=1,100000 do -- due to a small bug in Lua... - if math.mod(i, 100) == 0 then collectgarbage() end + if math.fmod(i, 100) == 0 then collectgarbage() end lxp.new({}) end collectgarbage(); collectgarbage() -assert(math.abs(gcinfo() - x) <= 2) +assert(math.abs(collectgarbage("count") - x) <= 2) print"OK" Index: lua-expat-1.2.0/src/lxp/lom.lua =================================================================== --- lua-expat-1.2.0.orig/src/lxp/lom.lua 2011-06-03 16:17:04.000000000 +0200 +++ lua-expat-1.2.0/src/lxp/lom.lua 2012-02-22 12:05:38.000000000 +0100 @@ -1,11 +1,10 @@ -- See Copyright Notice in license.html -- $Id: lom.lua,v 1.6 2005/06/09 19:18:40 tuler Exp $ -require "lxp" +local lxp = require "lxp" -local tinsert, tremove, getn = table.insert, table.remove, table.getn +local tinsert, tremove = table.insert, table.remove local assert, type, print = assert, type, print -local lxp = lxp module ("lxp.lom") @@ -19,14 +18,14 @@ local stack = p:getcallbacks().stack local element = tremove(stack) assert(element.tag == tag) - local level = getn(stack) + local level = #stack tinsert(stack[level], element) end local function text (p, txt) local stack = p:getcallbacks().stack - local element = stack[getn(stack)] - local n = getn(element) + local element = stack[#stack] + local n = #element if type(element[n]) == "string" then element[n] = element[n] .. txt else debian/patches/series0000644000000000000000000000001512201123742012020 0ustar lua5.2.patch