0.5.15lorg2-alt4

- Patched and rebuilt for lua-5.1.
This commit is contained in:
Alexey Tourbin 2006-05-16 18:14:17 +00:00 committed by Dmitry V. Levin
parent e97a90dec9
commit 1c5bf91a4b
4 changed files with 122 additions and 118 deletions

View File

@ -3,5 +3,5 @@ copy: *.old
copy: *.patch
copy: *.po
copy: *.rsync
tar.bz2: apt
tar: apt
copy: genbasedir

View File

@ -1,108 +0,0 @@
--- apt-0.5.15cnc5~/lua/Makefile.am 2003-12-23 20:14:06 +0000
+++ apt-0.5.15cnc5/lua/Makefile.am 2004-01-16 18:25:47 +0000
@@ -1,7 +1,6 @@
if WITH_LUA
-noinst_LTLIBRARIES = liblua.la
-noinst_PROGRAMS = lua/lua luac/luac
+noinst_LTLIBRARIES = libluapt.la
endif
EXTRA_DIST = \
@@ -11,75 +10,19 @@ EXTRA_DIST = \
local/userconfig.c \
local/linit.lua
-LDADD = liblua.la
-INCLUDES = -I$(srcdir)/include -I$(srcdir)/local
-
-lua_lua_SOURCES = lua/lua.c
-lua_lua_CFLAGS = -DLUA_USERCONFIG='"$(srcdir)/local/userconfig.c"'
-#lua_lua_LDADD = $(LDADD) -lreadline -lhistory -lncurses
-luac_luac_SOURCES = luac/luac.c luac/print.c lopcodes.c
-luac_luac_CFLAGS = -DLUA_OPNAMES
+LDADD = libluapt.la
+INCLUDES = -I$(srcdir)/local
-liblua_la_CFLAGS = -DUSE_DLOPEN -DWITH_POSIX
-liblua_la_LIBADD = -lm -ldl
-liblua_la_SOURCES = \
+libluapt_la_LIBADD = -llua -llualib
+libluapt_la_CFLAGS = -DWITH_POSIX
+libluapt_la_SOURCES = \
local/linit.c \
local/linit.h \
local/linit.lch \
local/lposix.h \
local/lposix.c \
local/lrexlib.h \
- local/lrexlib.c \
- include/lauxlib.h \
- include/lua.h \
- include/lualib.h \
- lib/lauxlib.c \
- lib/lbaselib.c \
- lib/ldblib.c \
- lib/liolib.c \
- lib/lmathlib.c \
- lib/loadlib.c \
- lib/lstrlib.c \
- lib/ltablib.c \
- lapi.c \
- lapi.h \
- lcode.c \
- lcode.h \
- ldebug.c \
- ldebug.h \
- ldo.c \
- ldo.h \
- ldump.c \
- lfunc.c \
- lfunc.h \
- lgc.c \
- lgc.h \
- llex.c \
- llex.h \
- llimits.h \
- lmem.c \
- lmem.h \
- lobject.c \
- lobject.h \
- lopcodes.c \
- lopcodes.h \
- lparser.c \
- lparser.h \
- lstate.c \
- lstate.h \
- lstring.c \
- lstring.h \
- ltable.c \
- ltable.h \
- ltests.c \
- ltm.c \
- ltm.h \
- lundump.c \
- lundump.h \
- lvm.c \
- lvm.h \
- lzio.c \
- lzio.h
+ local/lrexlib.c
local/linit.lch: local/linit.lua
bin2c local/linit.lua > local/linit.lch
--- apt-0.5.15cnc5~/apt-pkg/Makefile.am 2003-12-23 20:23:17 +0000
+++ apt-0.5.15cnc5/apt-pkg/Makefile.am 2004-01-16 19:06:12 +0000
@@ -6,10 +6,10 @@ libapt_pkg_la_LDFLAGS = -version-info 1:
AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\"
-INCLUDES = -I$(top_srcdir)/lua/include -I$(top_srcdir)/lua/local
+INCLUDES = -I$(top_srcdir)/lua/local
if WITH_LUA
-libapt_pkg_la_LIBADD += $(top_builddir)/lua/liblua.la
+libapt_pkg_la_LIBADD += $(top_builddir)/lua/libluapt.la
endif
libapt_pkg_la_SOURCES = \

View File

@ -0,0 +1,112 @@
--- 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

@ -2,7 +2,7 @@
Name: apt
Version: 0.5.15lorg2
Release: alt3
Release: alt4
Summary: Debian's Advanced Packaging Tool with RPM support
Summary(ru_RU.KOI8-R): Debian APT - õÓÏ×ÅÒÛÅÎÓÔ×Ï×ÁÎÎÏÅ ÓÒÅÄÓÔ×Ï ÕÐÒÁ×ÌÅÎÉÑ ÐÁËÅÔÁÍÉ Ó ÐÏÄÄÅÒÖËÏÊ RPM
@ -11,7 +11,7 @@ Group: System/Configuration/Packaging
Url: https://moin.conectiva.com.br/AptRpm
Packager: APT Development Team <apt@packages.altlinux.org>
Source0: http://moin.conectiva.com.br/files/AptRpm/attachments/%name-%version.tar.bz2
Source0: http://moin.conectiva.com.br/files/AptRpm/attachments/%name-%version.tar
Source1: apt.conf
Source2: genbasedir
Source3: README.rsync
@ -39,8 +39,8 @@ Patch25: apt-0.5.15cnc5-alt-packagemanager-CheckRConflicts.patch
Patch26: apt-0.5.5cnc4.1-alt-PrioComp.patch
Patch27: apt-0.5.4cnc9-alt-pkgorderlist-score.patch
Patch28: apt-0.5.15cnc6-alt-virtual-scores.patch
Patch29: apt-0.5.15cnc5-alt-system-lua5.patch
Patch30: apt-0.5.15cnc5-alt-gettext.patch
Patch29: apt-0.5.15cnc5-alt-gettext.patch
Patch30: apt-0.5.15lorg2-alt-lua51.patch
Patch31: apt-0.5.15cnc6-alt-rpm-order.patch
Patch32: apt-0.5.15cnc6-alt-pkgcachegen.patch
Patch33: apt-0.5.15cnc6-alt-apt-shell.patch
@ -259,11 +259,8 @@ This package contains method 'rsync' for APT.
find -type f -name \*.orig -delete -print
# Use system-wide lua5
pushd lua
# keep only local/ and lua/
rm -rfv include lib luac *.[ch]
popd
# Ensure system-wide lua5 in use.
rm -rf lua
# Turn it on only if you want to see the debugging messages:
#%patch101 -p1 -b .getsrc-debug
@ -373,6 +370,9 @@ fi
# Probably %%doc with README.rsync?
%changelog
* Tue May 16 2006 Alexey Tourbin <at@altlinux.ru> 0.5.15lorg2-alt4
- Patched and rebuilt for lua-5.1.
* Sat Apr 01 2006 Dmitry V. Levin <ldv@altlinux.org> 0.5.15lorg2-alt3
- Resolved a few issues introduced after cnc6.