Apply apt-0.5.15lorg2-alt-lua51.patch

Added in commit cbb5c92:
0.5.15cnc5-alt2

- Added one more %triggerun to correct apt.conf,
  due to apt methods migration.
- Applied patch from Alexey Tourbin to use systemwide lua5.
- Applied patch from Sviatoslav Sviridov to workaround VendorList bug.
This commit is contained in:
Gleb Fotengauer-Malinovskiy 2014-05-16 21:04:21 +04:00
parent d25ff21d36
commit 763307181d
5 changed files with 18 additions and 149 deletions

View File

@ -1,112 +0,0 @@
--- apt-0.5.15lorg2/apt-pkg/Makefile.am- 2006-01-17 02:10:47 +0300
+++ apt-0.5.15lorg2/apt-pkg/Makefile.am 2006-05-16 15:51:12 +0400
@@ -6,10 +6,8 @@ libapt_pkg_la_LDFLAGS = -version-info 2:
AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\"
-INCLUDES = -I$(top_srcdir)/lua/include -I$(top_srcdir)/lua/local
-
if WITH_LUA
-libapt_pkg_la_LIBADD += $(top_builddir)/lua/liblua.la
+libapt_pkg_la_LIBADD += -llua
endif
libapt_pkg_la_SOURCES = \
--- apt-0.5.15lorg2/apt-pkg/luaiface.cc- 2006-01-17 02:14:40 +0300
+++ apt-0.5.15lorg2/apt-pkg/luaiface.cc 2006-05-16 17:45:03 +0400
@@ -17,12 +17,12 @@
#ifdef WITH_LUA
extern "C" {
-#include "lua.h"
-#include "lualib.h"
-#include "lauxlib.h"
-#include "lposix.h"
-#include "lrexlib.h"
-#include "linit.h"
+#include <lua.h>
+#include <lualib.h>
+#include <lauxlib.h>
+#if LUA_VERSION_NUM < 501
+#error lua 5.1 required
+#endif
}
#include <apt-pkg/depcache.h>
@@ -52,12 +52,9 @@ extern "C" {
} while (0)
#define checkudata(ctype, target, n) \
- do { \
- ctype *_tmp = (ctype *) luaL_checkudata(L, n, #ctype); \
- if (_tmp != NULL) \
- target = *_tmp; \
- else \
- target = NULL; \
+ do { ctype *_tmp; target = NULL; \
+ if ( !lua_isnil(L, n) && (_tmp = (ctype *) luaL_checkudata(L, n, #ctype)) ) \
+ target = *_tmp; \
} while (0)
Lua *_GetLuaObj()
@@ -78,26 +75,13 @@ Lua::Lua()
{
_config->CndSet("Dir::Bin::scripts", "/usr/share/apt/scripts");
- const luaL_reg lualibs[] = {
- {"base", luaopen_base},
- {"table", luaopen_table},
- {"io", luaopen_io},
- {"string", luaopen_string},
- {"math", luaopen_math},
- {"debug", luaopen_debug},
- {"loadlib", luaopen_loadlib},
- {"posix", luaopen_posix},
- {"rex", luaopen_rex},
- {"init", luaopen_init},
- {"apt", luaopen_apt},
- {NULL, NULL}
- };
L = lua_open();
- const luaL_reg *lib = lualibs;
- for (; lib->name; lib++) {
- lib->func(L); /* open library */
- lua_settop(L, 0); /* discard any results */
- }
+ luaL_openlibs(L);
+
+ lua_pushcfunction(L, luaopen_apt);
+ lua_pushstring(L, "apt");
+ lua_call(L, 1, 0);
+
luaL_newmetatable(L, "pkgCache::Package*");
lua_pushstring(L, "__eq");
lua_pushcfunction(L, AptLua_pkgcomp);
@@ -198,7 +182,7 @@ bool Lua::RunScripts(const char *ConfLis
lua_pushnil(L);
lua_rawset(L, LUA_GLOBALSINDEX);
- lua_pop(L, 1);
+ lua_settop(L, 0);
return true;
}
--- apt-0.5.15lorg2/Makefile.am- 2006-05-16 15:51:12 +0400
+++ apt-0.5.15lorg2/Makefile.am 2006-05-16 15:51:12 +0400
@@ -1,5 +1,5 @@
-SUBDIRS = buildlib lua apt-pkg methods cmdline tools doc m4 po
+SUBDIRS = buildlib apt-pkg methods cmdline tools doc m4 po
ACLOCAL_AMFLAGS = -I m4 -I buildlib
--- apt-0.5.15lorg2/configure.in- 2006-05-16 15:51:12 +0400
+++ apt-0.5.15lorg2/configure.in 2006-05-16 15:51:12 +0400
@@ -252,7 +252,6 @@ AC_OUTPUT([
Makefile
buildlib/Makefile
intl/Makefile
- lua/Makefile
apt-pkg/Makefile
methods/Makefile
cmdline/Makefile

View File

@ -1,5 +1,5 @@
SUBDIRS = buildlib lua apt-pkg methods cmdline tools doc m4 po SUBDIRS = buildlib apt-pkg methods cmdline tools doc m4 po
ACLOCAL_AMFLAGS = -I m4 -I buildlib ACLOCAL_AMFLAGS = -I m4 -I buildlib

View File

@ -6,10 +6,8 @@ libapt_pkg_la_LDFLAGS = -version-info 4:0:1 -release @GLIBC_VER@-@LIBSTDCPP_VER@
AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\" AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\"
INCLUDES = -I$(top_srcdir)/lua/include -I$(top_srcdir)/lua/local
if WITH_LUA if WITH_LUA
libapt_pkg_la_LIBADD += $(top_builddir)/lua/liblua.la libapt_pkg_la_LIBADD += -llua
endif endif
libapt_pkg_la_SOURCES = \ libapt_pkg_la_SOURCES = \

View File

@ -17,12 +17,12 @@
#ifdef WITH_LUA #ifdef WITH_LUA
extern "C" { extern "C" {
#include "lua.h" #include <lua.h>
#include "lualib.h" #include <lualib.h>
#include "lauxlib.h" #include <lauxlib.h>
#include "lposix.h" #if LUA_VERSION_NUM < 501
#include "lrexlib.h" #error lua 5.1 required
#include "linit.h" #endif
} }
#include <apt-pkg/depcache.h> #include <apt-pkg/depcache.h>
@ -52,12 +52,9 @@ extern "C" {
} while (0) } while (0)
#define checkudata(ctype, target, n) \ #define checkudata(ctype, target, n) \
do { \ do { ctype *_tmp; target = NULL; \
ctype *_tmp = (ctype *) luaL_checkudata(L, n, #ctype); \ if ( !lua_isnil(L, n) && (_tmp = (ctype *) luaL_checkudata(L, n, #ctype)) ) \
if (_tmp != NULL) \
target = *_tmp; \ target = *_tmp; \
else \
target = NULL; \
} while (0) } while (0)
Lua *_GetLuaObj() Lua *_GetLuaObj()
@ -78,26 +75,13 @@ Lua::Lua()
{ {
_config->CndSet("Dir::Bin::scripts", "/usr/share/apt/scripts"); _config->CndSet("Dir::Bin::scripts", "/usr/share/apt/scripts");
const luaL_reg lualibs[] = {
{"base", luaopen_base},
{"table", luaopen_table},
{"io", luaopen_io},
{"string", luaopen_string},
{"math", luaopen_math},
{"debug", luaopen_debug},
{"loadlib", luaopen_loadlib},
{"posix", luaopen_posix},
{"rex", luaopen_rex},
{"init", luaopen_init},
{"apt", luaopen_apt},
{NULL, NULL}
};
L = lua_open(); L = lua_open();
const luaL_reg *lib = lualibs; luaL_openlibs(L);
for (; lib->name; lib++) {
lib->func(L); /* open library */ lua_pushcfunction(L, luaopen_apt);
lua_settop(L, 0); /* discard any results */ lua_pushstring(L, "apt");
} lua_call(L, 1, 0);
luaL_newmetatable(L, "pkgCache::Package*"); luaL_newmetatable(L, "pkgCache::Package*");
lua_pushstring(L, "__eq"); lua_pushstring(L, "__eq");
lua_pushcfunction(L, AptLua_pkgcomp); lua_pushcfunction(L, AptLua_pkgcomp);
@ -198,7 +182,7 @@ bool Lua::RunScripts(const char *ConfListKey, bool CacheChunks)
lua_pushnil(L); lua_pushnil(L);
lua_rawset(L, LUA_GLOBALSINDEX); lua_rawset(L, LUA_GLOBALSINDEX);
lua_pop(L, 1); lua_settop(L, 0);
return true; return true;
} }

View File

@ -252,7 +252,6 @@ AC_OUTPUT([
Makefile Makefile
buildlib/Makefile buildlib/Makefile
intl/Makefile intl/Makefile
lua/Makefile
apt-pkg/Makefile apt-pkg/Makefile
methods/Makefile methods/Makefile
cmdline/Makefile cmdline/Makefile