RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: rpm Date: 31-Dec-2007 22:43:20
Branch: HEAD Handle: 2007123121432000
Modified files:
rpm CHANGES
rpm/rpmio rpmlua.c
Log:
add RPM Lua function rpm.verbose() to be able to check CLI option
--verbose
Summary:
Revision Changes Path
1.2045 +1 -0 rpm/CHANGES
2.35 +13 -0 rpm/rpmio/rpmlua.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2044 -r1.2045 CHANGES
--- rpm/CHANGES 31 Dec 2007 20:26:40 -0000 1.2044
+++ rpm/CHANGES 31 Dec 2007 21:43:20 -0000 1.2045
@@ -1,4 +1,5 @@
5.0b4 -> 5.0.0:
+ - rse: add RPM Lua function rpm.verbose() to be able to check CLI option --verbose
- rse: add often required RPM Lua convenience function util.slurp()
- rse: add PCRE to "devtool standalone" procedure
- rse: make RPM configuration in "devtool standalone" procedure more flexible
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmlua.c
============================================================================
$ cvs diff -u -r2.34 -r2.35 rpmlua.c
--- rpm/rpmio/rpmlua.c 30 Dec 2007 12:41:54 -0000 2.34
+++ rpm/rpmio/rpmlua.c 31 Dec 2007 21:43:20 -0000 2.35
@@ -7,6 +7,7 @@
#include <rpmlog.h>
#include <rpmurl.h>
#include <rpmhook.h>
+#include <rpmcb.h>
#include <argv.h>
#include <lua.h>
@@ -933,6 +934,17 @@
return 0;
}
+static int rpm_verbose(lua_State *L)
+ /*@globals internalState @*/
+ /*@modifies L, internalState @*/
+{
+ if (rpmIsVerbose())
+ lua_pushinteger(L, 1);
+ else
+ lua_pushnil(L);
+ return 1;
+}
+
/*@-readonlytrans@*/
/*@observer@*/ /*@unchecked@*/
static const luaL_reg rpmlib[] = {
@@ -946,6 +958,7 @@
{"interactive", rpm_interactive},
{"source", rpm_source},
{"load", rpm_load},
+ {"verbose", rpm_verbose},
{NULL, NULL}
};
/*@=readonlytrans@*/
@@ .
Received on Mon Dec 31 22:43:20 2007