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: 08-Feb-2008 22:12:57
Branch: HEAD Handle: 2008020821125601
Modified files:
rpm CHANGES
rpm/rpmio tglob.c
Log:
- jbj: tweak up tglob debugging spew, add a Glob(3) stopwatch.
Summary:
Revision Changes Path
1.2156 +1 -0 rpm/CHANGES
2.10 +21 -9 rpm/rpmio/tglob.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2155 -r1.2156 CHANGES
--- rpm/CHANGES 8 Feb 2008 21:02:15 -0000 1.2155
+++ rpm/CHANGES 8 Feb 2008 21:12:56 -0000 1.2156
@@ -1,4 +1,5 @@
5.0.0 -> 5.1a1:
+ - jbj: tweak up tglob debugging spew, add a Glob(3) stopwatch.
- jbj: tweak up tget debugging spew, trick in a Stat(2) on path,
add Stat(2)/Fread(3) stopwatches, display same as "ls -island" output.
- proyvind: python: add back RPMSENSE_FIND_REQUIRES, needed by rpmlint
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/tglob.c
============================================================================
$ cvs diff -u -r2.9 -r2.10 tglob.c
--- rpm/rpmio/tglob.c 8 Feb 2008 00:02:49 -0000 2.9
+++ rpm/rpmio/tglob.c 8 Feb 2008 21:12:57 -0000 2.10
@@ -16,22 +16,32 @@
return 1;
}
-static void printGlob(const char * path)
+static int printGlob(const char * path)
{
- glob_t gl;
+ rpmop op = memset(alloca(sizeof(*op)), 0, sizeof(*op));
+ glob_t gl = { .gl_pathc = 0, .gl_pathv = NULL, .gl_offs = 0 };
int rc;
- int i;
+ int xx;
fprintf(stderr, "===== %s\n", path);
+ xx = rpmswEnter(op, 0);
gl.gl_pathc = 0;
gl.gl_pathv = NULL;
gl.gl_offs = 0;
rc = Glob(path, 0, my_Glob_error, &gl);
+ if (rc != 0) {
fprintf(stderr, "*** Glob rc %d\n", rc);
- if (rc == 0)
- for (i = 0; i < gl.gl_pathc; i++)
- fprintf(stderr, "%5d %s\n", i, gl.gl_pathv[i]);
+ } else
+ if (rpmIsVerbose()) {
+ int i;
+ for (i = 0; i < gl.gl_pathc; i++)
+ fprintf(stderr, "%5d %s\n", i, gl.gl_pathv[i]);
+ }
Globfree(&gl);
+ xx = rpmswExit(op, 0);
+
+ rpmswPrint("glob:", op);
+ return rc;
}
static struct poptOption optionsTable[] = {
@@ -60,6 +70,7 @@
int ac;
const char * dn;
int rc;
+ int xx;
while ((rc = poptGetNextOpt(optCon)) > 0) {
const char * optArg = poptGetOptArg(optCon);
@@ -79,6 +90,8 @@
_av_debug = -1;
_dav_debug = -1;
_ftp_debug = -1;
+_url_debug = -1;
+_rpmio_debug = -1;
}
av = poptGetArgs(optCon);
@@ -88,9 +101,8 @@
goto exit;
}
- while ((dn = *av++) != NULL) {
- printGlob(dn);
- }
+ while ((dn = *av++) != NULL)
+ xx = printGlob(dn);
exit:
@@ .
Received on Fri Feb 8 22:12:57 2008