[CVS] RPM: rpm/rpmdb/ rpmdb.c

2007-12-14 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 11:21:30
  Branch: HEAD Handle: 2007121410212900

  Modified files:
rpm/rpmdb   rpmdb.c

  Log:
output debugging message only if we are really debugging

  Summary:
RevisionChanges Path
1.228   +3  -3  rpm/rpmdb/rpmdb.c
  

  patch -p0 '@@ .'
  Index: rpm/rpmdb/rpmdb.c
  
  $ cvs diff -u -r1.227 -r1.228 rpmdb.c
  --- rpm/rpmdb/rpmdb.c 14 Dec 2007 03:35:48 -  1.227
  +++ rpm/rpmdb/rpmdb.c 14 Dec 2007 10:21:29 -  1.228
  @@ -279,9 +279,9 @@
dbiNTags++;
   }
   
  -for (dbix = 0; dbix  dbiNTags; dbix++)
  -fprintf(stderr, %4d %s[%u] 0x%x\n, dbix, dbiTags[dbix].str, 
dbiTags[dbix].tag, dbiTags[dbix].tag);
  -
  +if (_rpmdb_debug)
  +for (dbix = 0; dbix  dbiNTags; dbix++)
  +fprintf(stderr, -- %4d %s[%u] 0x%x\n, dbix, 
dbiTags[dbix].str, dbiTags[dbix].tag, dbiTags[dbix].tag);
   
   if (dbiNTagsP != NULL)
*dbiNTagsP = dbiNTags;
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ VENDOR rpm/build/ parsePreamble.c rpm/rpmio/ argv.c ar...

2007-12-14 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 12:22:08
  Branch: HEAD Handle: 2007121411220800

  Modified files:
rpm VENDOR
rpm/build   parsePreamble.c
rpm/rpmio   argv.c argv.h

  Log:
Apply another OpenPKG-specific change which is another candicate for
being used for stock RPM, too: Allow wildcards in %{_arbitrary_tags}
in order to support e.g. %_arbitrary_tags My* for custom but clearly
distinguishable user headers, the matching of tagnames is done via a
slower but more flexible linear search based on fnmatch(3) instead of a
binary search based on strcasecmp(3).

  Summary:
RevisionChanges Path
2.9 +10 -0  rpm/VENDOR
2.158   +4  -0  rpm/build/parsePreamble.c
1.10+37 -0  rpm/rpmio/argv.c
1.7 +34 -0  rpm/rpmio/argv.h
  

  patch -p0 '@@ .'
  Index: rpm/VENDOR
  
  $ cvs diff -u -r2.8 -r2.9 VENDOR
  --- rpm/VENDOR13 Dec 2007 19:08:16 -  2.8
  +++ rpm/VENDOR14 Dec 2007 11:22:08 -  2.9
  @@ -272,4 +272,14 @@
Reason: This is a macro-frontend to realpath(3) and
allows one to resolve a (relative) path into
an absolute path.
  + 
  +
  + Change: wildcard-matching-arbitrary-tagnames
  + Purpose:Allow wildcards in %{_arbitrary_tags}
  + Reason: In order to support e.g. %_arbitrary_tags My*
  + for custom but clearly distinguishable user
  + headers, the matching of tagnames is done via a
  + slower but more flexible linear search based on
  + fnmatch(3) instead of a binary search based on
  + strcasecmp(3).
   
  @@ .
  patch -p0 '@@ .'
  Index: rpm/build/parsePreamble.c
  
  $ cvs diff -u -r2.157 -r2.158 parsePreamble.c
  --- rpm/build/parsePreamble.c 13 Dec 2007 19:08:16 -  2.157
  +++ rpm/build/parsePreamble.c 14 Dec 2007 11:22:08 -  2.158
  @@ -928,7 +928,11 @@
if (aTags != NULL  aTags[0] != NULL) {
ARGV_t av;
s = tagCanonicalize(spec-line);
  +#if defined(RPM_VENDOR_OPENPKG) /* wildcard-matching-arbitrary-tagnames */
  + av = argvSearchLinear(aTags, s, argvFnmatchCasefold);
  +#else
av = argvSearch(aTags, s, argvStrcasecmp);
  +#endif
if (av != NULL) {
*tagp = tagGenerate(s);
rc = 0;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/argv.c
  
  $ cvs diff -u -r1.9 -r1.10 argv.c
  --- rpm/rpmio/argv.c  2 Dec 2007 23:06:02 -   1.9
  +++ rpm/rpmio/argv.c  14 Dec 2007 11:22:08 -  1.10
  @@ -93,6 +93,22 @@
   return xstrcasecmp(astr, bstr);
   }
   
  +#if defined(RPM_VENDOR_OPENPKG) /* wildcard-matching-arbitrary-tagnames */
  +int argvFnmatch(const void * a, const void * b)
  +{
  +ARGstr_t astr = *(ARGV_t)a;
  +ARGstr_t bstr = *(ARGV_t)b;
  +return (fnmatch(astr, bstr, 0) == 0 ? 0 : 1);
  +}
  +
  +int argvFnmatchCasefold(const void * a, const void * b)
  +{
  +ARGstr_t astr = *(ARGV_t)a;
  +ARGstr_t bstr = *(ARGV_t)b;
  +return (fnmatch(astr, bstr, FNM_CASEFOLD) == 0 ? 0 : 1);
  +}
  +#endif
  +
   int argvSort(ARGV_t argv, int (*compar)(const void *, const void *))
   {
   if (compar == NULL)
  @@ -111,6 +127,27 @@
   return bsearch(val, argv, argvCount(argv), sizeof(*argv), compar);
   }
   
  +#if defined(RPM_VENDOR_OPENPKG) /* wildcard-matching-arbitrary-tagnames */
  +ARGV_t argvSearchLinear(ARGV_t argv, ARGstr_t val,
  + int (*compar)(const void *, const void *))
  +{
  +ARGV_t result;
  +ARGV_t av;
  +if (argv == NULL)
  +return NULL;
  +if (compar == NULL)
  +compar = argvCmp;
  +result = NULL;
  +for (av = argv; *av != NULL; av++) {
  +if (compar(av, val) == 0) {
  +result = av;
  +break;
  +}
  +}
  +return result;
  +}
  +#endif
  +
   int argiAdd(/[EMAIL PROTECTED]@*/ ARGI_t * argip, int ix, int val)
   {
   ARGI_t argi;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/argv.h
  
  $ cvs diff -u 

[CVS] RPM: rpm/ devtool.conf

2007-12-14 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 12:14:30
  Branch: HEAD Handle: 2007121411143000

  Modified files:
rpm devtool.conf

  Log:
make sure directory exists, even if the main install failed

  Summary:
RevisionChanges Path
2.147   +1  -0  rpm/devtool.conf
  

  patch -p0 '@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.146 -r2.147 devtool.conf
  --- rpm/devtool.conf  14 Dec 2007 09:34:12 -  2.146
  +++ rpm/devtool.conf  14 Dec 2007 11:14:30 -  2.147
  @@ -894,6 +894,7 @@
   standalone_install () {
   rm -rf $prefix
   make install
  +install -d -m 755 $prefix/lib/rpm
   install -m 644 $base3rd/bin/$platform/file-${v_file}/magic/magic 
$prefix/lib/rpm/magic
   }
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ TODO

2007-12-14 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 15:21:40
  Branch: HEAD Handle: 2007121414214000

  Modified files:
rpm TODO

  Log:
- more drive-by rpm critiques.

  Summary:
RevisionChanges Path
1.72+4  -0  rpm/TODO
  

  patch -p0 '@@ .'
  Index: rpm/TODO
  
  $ cvs diff -u -r1.71 -r1.72 TODO
  --- rpm/TODO  14 Dec 2007 03:55:06 -  1.71
  +++ rpm/TODO  14 Dec 2007 14:21:40 -  1.72
  @@ -170,4 +170,8 @@
script kiddie progress bars across the screen.
   - jbj: arbitrary %foo -p /bar scriptlets as pair'ed 
RPMTAG_{FOO,FOOPROG}.
   - jbj: arbitrary triggers, like scriptlets, but with a condition check 
too.
  +- jbj: the hash *ahem* algorithm at rpmio/rpmhash.c:77 
hashFunctionString()
  + is pathetic. Ditto, rpmdb/fprint.c:186 fpHashFunction(). FYI, the
  + fingerprint hash is in the top 10 pigs when profiling rpm installs, so
  + better has immediate performance benefits. rpmio/lookup3.c == better.

  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/rpmdb/ rpmdb.c

2007-12-14 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 15:54:39
  Branch: HEAD Handle: 2007121414543800

  Modified files:
rpm/rpmdb   rpmdb.c

  Log:
- nuke the debugging.

  Summary:
RevisionChanges Path
1.229   +0  -4  rpm/rpmdb/rpmdb.c
  

  patch -p0 '@@ .'
  Index: rpm/rpmdb/rpmdb.c
  
  $ cvs diff -u -r1.228 -r1.229 rpmdb.c
  --- rpm/rpmdb/rpmdb.c 14 Dec 2007 10:21:29 -  1.228
  +++ rpm/rpmdb/rpmdb.c 14 Dec 2007 14:54:38 -  1.229
  @@ -279,10 +279,6 @@
dbiNTags++;
   }
   
  -if (_rpmdb_debug)
  -for (dbix = 0; dbix  dbiNTags; dbix++)
  -fprintf(stderr, -- %4d %s[%u] 0x%x\n, dbix, 
dbiTags[dbix].str, dbiTags[dbix].tag, dbiTags[dbix].tag);
  -
   if (dbiNTagsP != NULL)
*dbiNTagsP = dbiNTags;
   if (dbiTagsP != NULL)
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmds.c rpm/misc/ librpmmisc.c rpm/rp...

2007-12-14 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 14:03:11
  Branch: HEAD Handle: 2007121413031001

  Modified files:
rpm CHANGES
rpm/lib rpmds.c
rpm/misclibrpmmisc.c
rpm/rpmio   fts.c rpmdav.c rpmio.c rpmsq.c

  Log:
various windows/cygwin hacks...

  Summary:
RevisionChanges Path
1.1987  +1  -0  rpm/CHANGES
2.89+2  -0  rpm/lib/rpmds.c
1.2 +2  -0  rpm/misc/librpmmisc.c
1.28+13 -0  rpm/rpmio/fts.c
2.53+5  -3  rpm/rpmio/rpmdav.c
1.115   +4  -0  rpm/rpmio/rpmio.c
1.31+22 -0  rpm/rpmio/rpmsq.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1986 -r1.1987 CHANGES
  --- rpm/CHANGES   14 Dec 2007 03:35:48 -  1.1986
  +++ rpm/CHANGES   14 Dec 2007 13:03:10 -  1.1987
  @@ -1,4 +1,5 @@
   5.0b1 - 5.0b2:
  +- afb: made it compile on Cygwin too.
   - jbj: add Foo:Bar:Baz indices for now.
   - jbj: permit arbitrary tags to be indexed by Name, not Tag_0x12345678.
   - jbj: permit tag aliases in rpmdb index names (Filedigests - 
Filemd5s).
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmds.c
  
  $ cvs diff -u -r2.88 -r2.89 rpmds.c
  --- rpm/lib/rpmds.c   8 Dec 2007 05:15:11 -   2.88
  +++ rpm/lib/rpmds.c   14 Dec 2007 13:03:10 -  2.89
  @@ -2577,6 +2577,7 @@
}
/[EMAIL PROTECTED]@*/ break;
case CONFSTR:
  +#ifndef __CYGWIN__
clen = confstr(c-call_name, (char *) NULL, 0);
EVR = xmalloc(clen+1);
*EVR = '\0';
  @@ -2585,6 +2586,7 @@
exit (EXIT_FAILURE);
}
EVR[clen] = '\0';
  +#endif
/[EMAIL PROTECTED]@*/ break;
}
if (EVR == NULL)
  @@ .
  patch -p0 '@@ .'
  Index: rpm/misc/librpmmisc.c
  
  $ cvs diff -u -r1.1 -r1.2 librpmmisc.c
  --- rpm/misc/librpmmisc.c 27 Jun 2007 09:45:15 -  1.1
  +++ rpm/misc/librpmmisc.c 14 Dec 2007 13:03:11 -  1.2
  @@ -70,6 +70,8 @@
   
   #include fnmatch.h
   #include fnmatch.c
  +#ifndef __CYGWIN__
   #include glob.h
   #include glob.c
  +#endif
   
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/fts.c
  
  $ cvs diff -u -r1.27 -r1.28 fts.c
  --- rpm/rpmio/fts.c   10 Dec 2007 09:25:42 -  1.27
  +++ rpm/rpmio/fts.c   14 Dec 2007 13:03:11 -  1.28
  @@ -74,6 +74,19 @@
   #   define __fxstat64(_stat_ver, _fd, _sbp)  fstat64((_fd), (_sbp))
   #endif
   #endif
  +#if defined(__CYGWIN__) || defined(__MINGW32__)
  +#   include sys/stat.h
  +#if defined(__CYGWIN__)
  +#   define __errno_location()(__errno())
  +#elif !defined(_UWIN)
  +#   define __errno_location()(_errno())
  +#else
  +#   define __errno_location()(errno)
  +#endif
  +#   define stat64stat
  +#   define _STAT_VER 0
  +#   define __fxstat64(_stat_ver, _fd, _sbp)  fstat((_fd), (_sbp))
  +#endif
   #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || 
defined(__DragonFly__)
   #   define __errno_location()  (errno)
   #   define stat64  stat
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmdav.c
  
  $ cvs diff -u -r2.52 -r2.53 rpmdav.c
  --- rpm/rpmio/rpmdav.c15 Nov 2007 17:27:59 -  2.52
  +++ rpm/rpmio/rpmdav.c14 Dec 2007 13:03:11 -  2.53
  @@ -1668,11 +1668,11 @@
   /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */
   /[EMAIL PROTECTED]@*/
   dp-d_ino = i + 1;   /* W2DO? */
  -#if !defined(__DragonFly__)
  +#if !defined(__DragonFly__)  !defined(__CYGWIN__)
   dp-d_reclen = 0;/* W2DO? */
   #endif
   
  -#if !(defined(hpux) || defined(__hpux) || defined(sun) || 
defined(RPM_OS_AIX))
  +#if !(defined(hpux) || defined(__hpux) || defined(sun) || 
defined(RPM_OS_AIX) || defined(__CYGWIN__))
   #if !defined(__APPLE__)  !defined(__FreeBSD_kernel__)  
!defined(__FreeBSD__)  !defined(__NetBSD__)  !defined(__DragonFly__)
   dp-d_off = 0;   /* W2DO? */
   #endif
  @@ -1790,9 +1790,11 @@
   /* XXX glob(3) uses REAL_DIR_ENTRY(dp) test on d_ino */
   /[EMAIL PROTECTED]@*/
   

[CVS] RPM: rpm/ CHANGES TODO rpm/rpmio/ rpmhash.c

2007-12-14 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   14-Dec-2007 17:49:35
  Branch: HEAD Handle: 2007121416493500

  Modified files:
rpm CHANGES TODO
rpm/rpmio   rpmhash.c

  Log:
- rse: DJBX33A hash with unrolling is more better (no need to
measure).

  Summary:
RevisionChanges Path
1.1988  +1  -0  rpm/CHANGES
1.74+7  -4  rpm/TODO
1.8 +58 -10 rpm/rpmio/rpmhash.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1987 -r1.1988 CHANGES
  --- rpm/CHANGES   14 Dec 2007 13:03:10 -  1.1987
  +++ rpm/CHANGES   14 Dec 2007 16:49:35 -  1.1988
  @@ -1,4 +1,5 @@
   5.0b1 - 5.0b2:
  +- rse: DJBX33A hash with unrolling is more better (no need to measure).
   - afb: made it compile on Cygwin too.
   - jbj: add Foo:Bar:Baz indices for now.
   - jbj: permit arbitrary tags to be indexed by Name, not Tag_0x12345678.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/TODO
  
  $ cvs diff -u -r1.73 -r1.74 TODO
  --- rpm/TODO  14 Dec 2007 14:29:15 -  1.73
  +++ rpm/TODO  14 Dec 2007 16:49:35 -  1.74
  @@ -170,10 +170,13 @@
script kiddie progress bars across the screen.
   - jbj: arbitrary %foo -p /bar scriptlets as pair'ed 
RPMTAG_{FOO,FOOPROG}.
   - jbj: arbitrary triggers, like scriptlets, but with a condition check 
too.
  -- jbj: the hash *ahem* algorithm at rpmio/rpmhash.c:77 
hashFunctionString()
  - is pathetic. Ditto, rpmdb/fprint.c:186 fpHashFunction(). FYI, the
  - fingerprint hash is in the top 10 pigs when profiling rpm installs, so
  - better has immediate performance benefits. rpmio/lookup3.c == better.
  +- jbj: the hash *ahem* algorithm at rpmdb/fprint.c:186 fpHashFunction() 
is
  + pathetic. FYI, the fingerprint hash is in the top 10 pigs when
  + profiling rpm installs, so better has immediate performance benefits.
  + rpmio/lookup3.c is possibly better. The other important usage case
  + is restructuring the multi-level add package provides lookup in
  + lib/rpmal.c (but that likely needs to be thrown into a Berkeley DB
  + table to minimize memory footprint).
   - jbj: using qsort to insure that nearly sorted lists of join keys in
an rpmdb remain sorted is stoopid: quicksort on nearly sorted lists
is slower than alternative implementations like mergesort.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmhash.c
  
  $ cvs diff -u -r1.7 -r1.8 rpmhash.c
  --- rpm/rpmio/rpmhash.c   15 Nov 2007 17:27:59 -  1.7
  +++ rpm/rpmio/rpmhash.c   14 Dec 2007 16:49:35 -  1.8
  @@ -77,19 +77,67 @@
   static uint32_t hashFunctionString(uint32_t h, const void * data, size_t 
size)
/[EMAIL PROTECTED]/
   {
  -const char * chp = data;
  -unsigned char sum = (unsigned char)0;
  -unsigned char xor = (unsigned char)0;
  -size_t i;
  +const char *key = data;
   
   if (size == 0)
  - size = strlen(chp);
  -for (i = 0; i  size; i++, chp++) {
  - xor ^= *chp;
  - sum += *chp;
  -}
  + size = strlen(key);
   
  -h += ((uint32_t)(size  16) + (uint32_t)(sum  8) + (uint32_t)xor);
  +/*
  + * DJBX33A (Daniel J. Bernstein, Times 33 with Addition)
  + *
  + * This is Daniel J. Bernstein's popular `times 33' hash function as
  + * posted by him years ago on comp.lang.c. It basically uses a  function
  + * like ``hash(i) = hash(i-1) * 33 + str[i]''. This is one of the best
  + * known hash functions for strings. Because it is both computed very
  + * fast and distributes very well.
  + *
  + * The magic of number 33, i.e. why it works better than many other
  + * constants, prime or not, has never been adequately explained by
  + * anyone. So I try an explanation: if one experimentally tests all
  + * multipliers between 1 and 256 (as RSE did now) one detects that even
  + * numbers are not useable at all. The remaining 128 odd numbers
  + * (except for the number 1) work more or less all equally well. They
  + * all distribute in an acceptable way and this way fill a hash table
  + * with an average percent of approx. 86%.
  + *
  + * If one compares the Chi^2 values of the variants, the number 33 not
  + * even has the best value. But the number 

[CVS] RPM: rpm/ configure.ac

2007-12-14 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   15-Dec-2007 00:20:35
  Branch: HEAD Handle: 2007121423203400

  Modified files:
rpm configure.ac

  Log:
look for confstr(3) too. Posix, sheesh.

  Summary:
RevisionChanges Path
2.266   +1  -1  rpm/configure.ac
  

  patch -p0 '@@ .'
  Index: rpm/configure.ac
  
  $ cvs diff -u -r2.265 -r2.266 configure.ac
  --- rpm/configure.ac  9 Dec 2007 13:34:54 -   2.265
  +++ rpm/configure.ac  14 Dec 2007 23:20:34 -  2.266
  @@ -660,7 +660,7 @@
   
   dnl checks for library functions (generic)
   AC_CHECK_FUNCS([dnl
  -basename getaddrinfo getcwd getnameinfo getwd inet_aton dnl
  +basename getaddrinfo getcwd getnameinfo getwd inet_aton confstr dnl
   mtrace putenv realpath setenv clearenv stpcpy stpncpy strcspn strdup dnl
   strndup strerror strtol strtoul strspn strstr sighold sigrelse sigpause 
dnl
   sigprocmask sigemptyset sigaddset sigdelset sigsuspend madvise dnl
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org