Source: MontaVista Software, Inc.
Type: Defect Fix
Disposition: merge to http://www.rpm.org
Description:
Red Hat bugzilla 147013.

lua is bringing in readline, which is not what we want to do, due to license
issues.  Remove the readline requirement.

Index: rpm-4.3.3/lua/Makefile.am
===================================================================
--- rpm-4.3.3.orig/lua/Makefile.am
+++ rpm-4.3.3/lua/Makefile.am
@@ -16,7 +16,7 @@
 
 lua_lua_SOURCES = lua/lua.c
 lua_lua_CFLAGS = -DLUA_USERCONFIG='"$(srcdir)/local/userconfig.c"'
-lua_lua_LDADD = $(LDADD) -lreadline -lhistory -lncurses
+lua_lua_LDADD = $(LDADD) -lncurses
 luac_luac_SOURCES = luac/luac.c luac/print.c lopcodes.c
 luac_luac_CFLAGS = -DLUA_OPNAMES
 
Index: rpm-4.3.3/lua/local/userconfig.c
===================================================================
--- rpm-4.3.3.orig/lua/local/userconfig.c
+++ rpm-4.3.3/lua/local/userconfig.c
@@ -9,43 +9,6 @@
 	{"rex", luaopen_rex}, \
 	{"luapath", luapath},
 
-#define lua_readline	myreadline
-#define lua_saveline	mysaveline
-
-#include <ctype.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-
-static int myreadline (lua_State *L, const char *prompt) {
-  char *s=readline(prompt);
-  if (s==NULL)
-    return 0;
-  else {
-    lua_pushstring(L,s);
-    lua_pushliteral(L,"\n");
-    lua_concat(L,2);
-    free(s);
-    return 1;
-  }
-}
-
-static void mysaveline (lua_State *L, const char *s) {
-  const char *p;
-  for (p=s; isspace(*p); p++)
-    ;
-  if (*p!=0) {
-    size_t n=strlen(s)-1;
-    if (s[n]!='\n')
-      add_history(s);
-    else {
-      lua_pushlstring(L,s,n);
-      s=lua_tostring(L,-1);
-      add_history(s);
-      lua_remove(L,-1);
-    }
-  }
-}
-
 static int luapath(lua_State *L)
 {
 	lua_pushstring(L, "LUA_PATH");
