RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 04-Nov-2007 01:23:08
Branch: HEAD Handle: 2007110400230701
Modified files:
rpm CHANGES
rpm/lib librpm.vers poptALL.c rpmts.c rpmts.h
rpm/rpmio macro.c
Log:
- jbj: add all-mode --macrosused option, debug rpmGetMacroEntries().
Summary:
Revision Changes Path
1.1767 +1 -0 rpm/CHANGES
1.23 +2 -1 rpm/lib/librpm.vers
2.48 +9 -4 rpm/lib/poptALL.c
2.117 +11 -0 rpm/lib/rpmts.c
2.84 +2 -0 rpm/lib/rpmts.h
2.149 +2 -2 rpm/rpmio/macro.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1766 -r1.1767 CHANGES
--- rpm/CHANGES 3 Nov 2007 23:43:59 -0000 1.1766
+++ rpm/CHANGES 4 Nov 2007 00:23:07 -0000 1.1767
@@ -1,4 +1,5 @@
4.5 -> 5.0:
+ - jbj: add all-mode --macrosused option, debug rpmGetMacroEntries().
- jbj: access all tag data integers as "unsigned", using <stdint.h> types.
- rpm.org: fix segfault in %{lua: ...}'s rpm_print, no newline.
- jbj: add lua/python getMacros bindings (mostly from <pjones@redhat.com>).
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/librpm.vers
============================================================================
$ cvs diff -u -r1.22 -r1.23 librpm.vers
--- rpm/lib/librpm.vers 31 Oct 2007 19:21:13 -0000 1.22
+++ rpm/lib/librpm.vers 4 Nov 2007 00:23:08 -0000 1.23
@@ -337,7 +337,6 @@
rpmtsColor;
rpmtsCreate;
rpmtsCurrDir;
- _rpmts_debug;
rpmtsDBMode;
rpmtsDFlags;
rpmtsDoARBGoal;
@@ -390,6 +389,8 @@
rpmtsSetVSFlags;
rpmtsSolve;
rpmtsSpec;
+ _rpmts_debug;
+ _rpmts_macros;
_rpmts_stats;
rpmtsUnorderedSuccessors;
rpmtsUpdateDSI;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/poptALL.c
============================================================================
$ cvs diff -u -r2.47 -r2.48 poptALL.c
--- rpm/lib/poptALL.c 20 Oct 2007 18:52:34 -0000 2.47
+++ rpm/lib/poptALL.c 4 Nov 2007 00:23:08 -0000 2.48
@@ -119,6 +119,9 @@
extern int _rpmts_debug;
/*@unchecked@*/
+extern int _rpmts_macros;
+
+/*@unchecked@*/
extern int _rpmts_stats;
/*@unchecked@*/
@@ -423,8 +426,12 @@
{ "promoteepoch", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmds_nopromote, 0,
NULL, NULL},
+ { "avdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_av_debug, -1,
+ N_("debug argv collections"), NULL},
{ "cpiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_cpio_debug, -1,
N_("debug cpio payloads"), NULL},
+ { "davdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_dav_debug, -1,
+ N_("debug WebDAV data stream"), NULL},
{ "fpsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fps_debug, -1,
NULL, NULL},
{ "fsmdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fsm_debug, -1,
@@ -433,12 +440,10 @@
N_("use threads for file state machine"), NULL},
{ "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
N_("debug FTP/HTTP data stream"), NULL},
- { "avdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_av_debug, -1,
- N_("debug argv collections"), NULL},
- { "davdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_dav_debug, -1,
- N_("debug WebDAV data stream"), NULL},
{ "hdrdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_hdr_debug, -1,
NULL, NULL},
+ { "macrosused", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmts_macros, -1,
+ NULL, NULL},
{ "miredebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_mire_debug, -1,
NULL, NULL},
#ifdef DYING
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmts.c
============================================================================
$ cvs diff -u -r2.116 -r2.117 rpmts.c
--- rpm/lib/rpmts.c 3 Nov 2007 23:44:01 -0000 2.116
+++ rpm/lib/rpmts.c 4 Nov 2007 00:23:08 -0000 2.117
@@ -73,6 +73,9 @@
/*@unchecked@*/
int _rpmts_stats = 0;
+/*@unchecked@*/
+int _rpmts_macros = 0;
+
rpmts XrpmtsUnlink(rpmts ts, const char * msg, const char * fn, unsigned ln)
{
/*@-modfilesys@*/
@@ -667,6 +670,14 @@
if (_rpmts_stats)
rpmtsPrintStats(ts);
+ if (_rpmts_macros) {
+ const char ** av = NULL;
+ int ac = rpmGetMacroEntries(NULL, NULL, 1, &av);
+ int i;
+ argvPrint("macros used", av, NULL);
+ av = argvFree(av);
+ }
+
(void) rpmtsUnlink(ts, "tsCreate");
/*@-refcounttrans -usereleased @*/
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmts.h
============================================================================
$ cvs diff -u -r2.83 -r2.84 rpmts.h
--- rpm/lib/rpmts.h 3 Nov 2007 23:44:01 -0000 2.83
+++ rpm/lib/rpmts.h 4 Nov 2007 00:23:08 -0000 2.84
@@ -15,6 +15,8 @@
/*@unchecked@*/
extern int _rpmts_debug;
/*@unchecked@*/
+extern int _rpmts_macros;
+/*@unchecked@*/
extern int _rpmts_stats;
/*@unchecked@*/
extern int _fps_debug;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/macro.c
============================================================================
$ cvs diff -u -r2.148 -r2.149 macro.c
--- rpm/rpmio/macro.c 3 Nov 2007 13:19:23 -0000 2.148
+++ rpm/rpmio/macro.c 4 Nov 2007 00:23:08 -0000 2.149
@@ -277,7 +277,7 @@
const char *** avp)
{
const char ** av;
- int ac;
+ int ac = 0;
int i;
if (mc == NULL)
@@ -296,7 +296,7 @@
if (used == 0 && me->used != 0)
continue;
#if !defined(DEBUG_MACROS) /* XXX preserve standalone build */
- if (mireRegexec(mire, me->name))
+ if (mire != NULL && mireRegexec(mire, me->name))
continue;
#endif
av[ac++] = dupMacroEntry(me);
@@ .
Received on Sun Nov 4 01:23:09 2007