Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Lua interpreter in augtool #300

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
10bd64a
Add a lua interpreter to augtool
raphink Sep 16, 2015
0bf4760
Use snprintf in lua_checkargs
raphink Sep 16, 2015
fac868b
Allow nil as third value in defnode
raphink Sep 16, 2015
22d60f5
Make auto_save work with lua
raphink Sep 16, 2015
4e7ea58
Add lua_aug_clear, lua_aug_clearm and lua_aug_touch
raphink Sep 17, 2015
9127af5
Remove comment
raphink Sep 17, 2015
18ef0fc
Continue on empty lines in lua
raphink Sep 17, 2015
3f4ead5
Make multiline work in lua REPL, irb style
raphink Sep 17, 2015
b351999
Make command as arg work with lua
raphink Sep 17, 2015
f8eeb22
Lua aliases for store/retrieve
raphink Sep 17, 2015
70e68d1
Pass arguments to lua script
raphink Sep 23, 2015
0f5851f
Use an aug table to assign lua methods
raphink Sep 23, 2015
ef23c22
Put lua code in src/auglua.c
raphink Sep 24, 2015
89abf80
Cleanup code
raphink Sep 24, 2015
74227f2
Rename setup_lua to luaopen_augeas
raphink Sep 24, 2015
ea2daf2
Reset Menu.txt
raphink Sep 24, 2015
1ebed13
Newlines DO work
raphink Sep 24, 2015
029b60d
Add aug_lua
raphink Sep 24, 2015
9b30c76
Use a better registry key
raphink Sep 24, 2015
731466e
better var name
raphink Sep 24, 2015
94a577f
Reset etc/passwd in root
raphink Sep 24, 2015
8c4d38d
Revert "Reset etc/passwd in root"
raphink Sep 24, 2015
3c11069
AUGEAS_0.21.0
raphink Dec 2, 2015
03b95f3
Remove unnecessary comments
raphink Dec 2, 2015
382e55f
Use lua_pushfstring
raphink Dec 2, 2015
bd23da0
Fix call of run_command()
raphink Dec 2, 2015
b40abf4
configure: scan for Lua versions
kunkku Nov 15, 2016
219dff8
move Lua extensions to libauglua
kunkku Nov 18, 2016
acbde1e
import laugeas.c from lua-augeas as luamod
kunkku Nov 16, 2016
c2e3a3b
luamod: add copyright notice
kunkku Nov 16, 2016
8ce7857
compile luamod
kunkku Nov 18, 2016
4afe954
rename luaopen_augeas back to setup_lua
kunkku Nov 18, 2016
6c17a37
luamod: define public interface
kunkku Nov 18, 2016
433ee86
luamod: userdata structure
kunkku Nov 18, 2016
f69a357
auglua: use lua_pushliteral with registry key
kunkku Nov 18, 2016
5886de4
auglua: use luamod to push instance to stack
kunkku Nov 18, 2016
682cd10
auglua: use luamod for missing functions
kunkku Nov 18, 2016
fc0c812
auglua: remove redundant functions
kunkku Nov 22, 2016
02624ef
auglua: move label to luamod
kunkku Nov 22, 2016
2b3d9e9
auglua: move cp to luamod
kunkku Nov 22, 2016
60f28b2
auglua: move rename to luamod
kunkku Nov 22, 2016
f6350cb
auglua: move clear to luamod
kunkku Nov 22, 2016
7d291e1
auglua: move clearm to luamod
kunkku Nov 22, 2016
3de1ad5
auglua: move touch to luamod
kunkku Nov 22, 2016
01778a8
auglua: move text_store to luamod
kunkku Nov 25, 2016
a3948ef
auglua: move text_retrieve to luamod
kunkku Nov 25, 2016
5ed0705
auglua: move transform to luamod
kunkku Nov 25, 2016
5967264
auglua: save: use luamod functions
kunkku Nov 25, 2016
7a402e3
make Lua module for all available versions
kunkku Nov 23, 2016
0908334
Merge pull request #1 from kunkku/lua-combined
raphink Nov 28, 2016
c04faa6
include config.h in auglua.c and luamod.c
kunkku Nov 28, 2016
d3210af
Merge pull request #2 from kunkku/lua-include-config
raphink Nov 29, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make Lua module for all available versions
  • Loading branch information
kunkku committed Nov 25, 2016
commit 7a402e3b407ea4606c5c8066c266a1e4e395621d
15 changes: 13 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,39 @@ gl_INIT
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])

LUA_SUBDIRS=
LUA_MAKEFILES=
m4_foreach_w([LUAPKG], [lua5.1 lua5.2 lua5.3 lua], [
AC_MSG_CHECKING([for LUAPKG])
PKG_CHECK_EXISTS(LUAPKG, [
AC_MSG_RESULT([yes])
LIBLUA_CFLAGS=$($PKG_CONFIG --cflags LUAPKG)
LIBLUA_LIBS=$($PKG_CONFIG --libs LUAPKG)
LUA_VERSION=$($PKG_CONFIG --variable=V LUAPKG)
LUA_SUBDIRS="$LUA_SUBDIRS LUAPKG"

LUA_SUBDIR=src/LUAPKG
AS_MKDIR_P([$LUA_SUBDIR])

LUA_MAKEFILE=$LUA_SUBDIR/Makefile
ln -fs ../Makefile.luamod $LUA_MAKEFILE.am
eval $AUTOMAKE $LUA_MAKEFILE
LUA_MAKEFILES="$LUA_MAKEFILES $LUA_MAKEFILE"
], [AC_MSG_RESULT([no])])
])
if test -z "$LIBLUA_LIBS"; then
AC_MSG_ERROR([no Lua libraries found])
fi
AC_SUBST([LIBLUA_CFLAGS])
AC_SUBST([LIBLUA_LIBS])
AC_SUBST([LUA_VERSION])
AC_SUBST([LUA_SUBDIRS])

AC_CHECK_FUNCS([strerror_r fsync])

AC_OUTPUT(Makefile \
gnulib/lib/Makefile \
gnulib/tests/Makefile \
src/Makefile \
$LUA_MAKEFILES \
man/Makefile \
tests/Makefile \
examples/Makefile \
Expand Down
9 changes: 2 additions & 7 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SUBDIRS = . $(LUA_SUBDIRS)

GNULIB= ../gnulib/lib/libgnu.la
GNULIB_CFLAGS= -I $(top_builddir)/gnulib/lib -I $(top_srcdir)/gnulib/lib

Expand All @@ -14,9 +16,6 @@ DISTCLEANFILES = datadir.h
lib_LTLIBRARIES = libfa.la libaugeas.la libauglua.la
noinst_LTLIBRARIES = liblexer.la

luadir = $(libdir)/lua/$(LUA_VERSION)
lua_LTLIBRARIES = augeas.la

bin_PROGRAMS = augtool augparse

include_HEADERS = augeas.h fa.h
Expand Down Expand Up @@ -60,10 +59,6 @@ libfa_la_LDFLAGS = $(FA_VERSION_SCRIPT) -version-info $(LIBFA_VERSION_INFO)
liblexer_la_SOURCES = lexer.l
liblexer_la_CFLAGS = $(AM_CFLAGS) -Wno-error

augeas_la_SOURCES = augeas.h luamod.c luamod.h
augeas_la_LIBADD = libaugeas.la
augeas_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module -shared

FAILMALLOC_START ?= 1
FAILMALLOC_REP ?= 20
FAILMALLOC_PROG ?= ./augtool
Expand Down
13 changes: 13 additions & 0 deletions src/Makefile.luamod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2016 Kaarle Ritvanen

AUTOMAKE_OPTIONS = subdir-objects

LUA_PACKAGE = $(notdir $(CURDIR))

luadir = $(libdir)/lua/$(shell $(PKG_CONFIG) --variable=V $(LUA_PACKAGE))
lua_LTLIBRARIES = augeas.la

augeas_la_SOURCES = ../augeas.h ../luamod.c ../luamod.h
augeas_la_CFLAGS = $(AM_CFLAGS) $(LIBXML_CFLAGS) $(shell $(PKG_CONFIG) --cflags $(LUA_PACKAGE))
augeas_la_LIBADD = ../libaugeas.la
augeas_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -module -shared