RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/rpmio/ tdir.c tglob.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Fri 08 Feb 2008 - 01:02:49 CET
Message-Id: <20080208000249.A0DA3348479@rpm5.org>
  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 01:02:49
  Branch: HEAD                             Handle: 2008020800024801

  Modified files:
    rpm                     CHANGES
    rpm/rpmio               tdir.c tglob.c

  Log:
    - jbj: rpmio: rescuscitate tglob.c.

  Summary:
    Revision    Changes     Path
    1.2146      +1  -0      rpm/CHANGES
    2.9         +0  -1      rpm/rpmio/tdir.c
    2.9         +30 -32     rpm/rpmio/tglob.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2145 -r1.2146 CHANGES
  --- rpm/CHANGES	7 Feb 2008 23:50:08 -0000	1.2145
  +++ rpm/CHANGES	8 Feb 2008 00:02:48 -0000	1.2146
  @@ -1,4 +1,5 @@
   5.0.0 -> 5.1a1:
  +    - jbj: rpmio: rescuscitate tglob.c.
       - jbj: rpmio: rescuscitate tdir.c.
       - jbj: rpmio: fix: cvtfmode access beyond end-of-string with "r" fmode.
       - jbj: rpmio: rescuscitate tget.c.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/tdir.c
  ============================================================================
  $ cvs diff -u -r2.8 -r2.9 tdir.c
  --- rpm/rpmio/tdir.c	7 Feb 2008 23:50:09 -0000	2.8
  +++ rpm/rpmio/tdir.c	8 Feb 2008 00:02:49 -0000	2.9
  @@ -61,7 +61,6 @@
       ARGV_t av = NULL;
       int ac;
       const char * dn;
  -
       int rc;
   
       while ((rc = poptGetNextOpt(optCon)) > 0) {
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/tglob.c
  ============================================================================
  $ cvs diff -u -r2.8 -r2.9 tglob.c
  --- rpm/rpmio/tglob.c	1 Feb 2008 21:34:41 -0000	2.8
  +++ rpm/rpmio/tglob.c	8 Feb 2008 00:02:49 -0000	2.9
  @@ -3,31 +3,13 @@
   #include <rpmio_internal.h>
   #include <rpmmacro.h>
   #include <rpmcb.h>
  +#include <argv.h>
   #include <popt.h>
   
   #include "debug.h"
   
   static int _debug = 0;
   
  -int noNeon;
  -
  -#define	HTTPSPATH	"https://localhost/rawhide/test/*.rpm"
  -#if 0
  -#define	HTTPPATH	"http://localhost/rawhide/test/*.rpm"
  -#else
  -#define	HTTPPATH	"http://localhost/rawhide/*.rpm"
  -#endif
  -#define	FTPPATH		"ftp://localhost/pub/rawhide/packages/test/*.rpm"
  -#define	DIRPATH		"/var/ftp/pub/rawhide/packages/test/*.rpm"
  -#if 0
  -static char * dirpath = DIRPATH;
  -static char * ftppath = FTPPATH;
  -#endif
  -static char * httppath = HTTPPATH;
  -#if 0
  -static char * httpspath = HTTPSPATH;
  -#endif
  -
   static int my_Glob_error(const char *epath, int eerrno)
   {
   fprintf(stderr, "*** glob_error(%p,%d) path %s\n", epath, eerrno, epath);
  @@ -54,10 +36,13 @@
   
   static struct poptOption optionsTable[] = {
    { "debug", 'd', POPT_ARG_VAL,	&_debug, -1,		NULL, NULL },
  +
  + { "avdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_av_debug, -1,
  +	N_("debug protocol data stream"), NULL},
  + { "davdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_dav_debug, -1,
  +	N_("debug protocol data stream"), NULL},
    { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
   	N_("debug protocol data stream"), NULL},
  - { "noneon", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &noNeon, 1,
  -	N_("disable use of libneon for HTTP"), NULL},
    { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
   	N_("debug rpmio I/O"), NULL},
    { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
  @@ -71,9 +56,13 @@
   main(int argc, char *argv[])
   {
       poptContext optCon = poptGetContext(argv[0], argc, argv, optionsTable, 0);
  +    ARGV_t av;
  +    int ac;
  +    const char * dn;
       int rc;
   
       while ((rc = poptGetNextOpt(optCon)) > 0) {
  +	const char * optArg = poptGetOptArg(optCon);
   	switch (rc) {
   	case 'v':
   	    rpmIncreaseVerbosity();
  @@ -81,24 +70,33 @@
   	default:
               /*@switchbreak@*/ break;
   	}
  +	optArg = _free(optArg);
       }
   
       if (_debug) {
   	rpmIncreaseVerbosity();
   	rpmIncreaseVerbosity();
  -    }
  -
   _av_debug = -1;
  -_ftp_debug = -1;
   _dav_debug = -1;
  -#if 0
  -    printGlob(dirpath);
  -    printGlob(ftppath);
  -#endif
  -    printGlob(httppath);
  -#if 0
  -    printGlob(httpspath);
  -#endif
  +_ftp_debug = -1;
  +    }
  +
  +    av = poptGetArgs(optCon);
  +    ac = argvCount(av);
  +    if (ac < 1) {
  +	poptPrintUsage(optCon, stderr, 0);
  +	goto exit;
  +    }
  +
  +    while ((dn = *av++) != NULL) {
  +	printGlob(dn);
  +    }
  +
  +exit:
  +
  +/*@i@*/ urlFreeCache();
  +
  +    optCon = poptFreeContext(optCon);
   
       return 0;
   }
  @@ .
Received on Fri Feb 8 01:02:49 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.