Skip to content

Commit

Permalink
Add a lua interpreter to augtool
Browse files Browse the repository at this point in the history
This commit adds a -l/--lua flag to augtool
which allows to execute Lua code instead of
the native augsrun interpreter.

Each API call is mapped into a correponding
aug_* Lua command, as well as short * commands.
  • Loading branch information
raphink committed Sep 16, 2015
1 parent 1c25978 commit fad7fee
Show file tree
Hide file tree
Showing 8 changed files with 594 additions and 27 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ addons:
packages:
- libxml2-dev
- libreadline-dev
- liblua5.2-dev
- valgrind
install:
- ./autogen.sh
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ gl_INIT
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])

PKG_CHECK_MODULES([LIBLUA], [lua5.2])

AC_CHECK_FUNCS([strerror_r fsync])

AC_OUTPUT(Makefile \
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNULIB= ../gnulib/lib/libgnu.la
GNULIB_CFLAGS= -I $(top_builddir)/gnulib/lib -I $(top_srcdir)/gnulib/lib

AM_CFLAGS = @AUGEAS_CFLAGS@ @WARN_CFLAGS@ $(GNULIB_CFLAGS) $(LIBXML_CFLAGS)
AM_CFLAGS = @AUGEAS_CFLAGS@ @WARN_CFLAGS@ $(GNULIB_CFLAGS) $(LIBXML_CFLAGS) $(LIBLUA_CFLAGS)

AM_YFLAGS=-d -p spec_

Expand Down Expand Up @@ -35,13 +35,13 @@ endif

libaugeas_la_LDFLAGS = $(AUGEAS_VERSION_SCRIPT) \
-version-info $(LIBAUGEAS_VERSION_INFO)
libaugeas_la_LIBADD = liblexer.la libfa.la $(LIB_SELINUX) $(LIBXML_LIBS) $(GNULIB)
libaugeas_la_LIBADD = liblexer.la libfa.la $(LIB_SELINUX) $(LIBXML_LIBS) $(LIBLUA_LIBS) $(GNULIB)

augtool_SOURCES = augtool.c
augtool_LDADD = libaugeas.la $(READLINE_LIBS) $(LIBXML_LIBS) $(GNULIB)
augtool_LDADD = libaugeas.la $(READLINE_LIBS) $(LIBXML_LIBS) $(LIBLUA_LIBS) $(GNULIB)

augparse_SOURCES = augparse.c
augparse_LDADD = libaugeas.la $(LIBXML_LIBS) $(GNULIB)
augparse_LDADD = libaugeas.la $(LIBXML_LIBS) $(LIBLUA_LIBS) $(GNULIB)

libfa_la_SOURCES = fa.c fa.h hash.c hash.h memory.c memory.h ref.h ref.c
libfa_la_LIBADD = $(LIB_SELINUX) $(GNULIB)
Expand Down
Loading

0 comments on commit fad7fee

Please sign in to comment.