[CVS] RPM: rpm/ devtool.conf rpm.spec.in

2009-03-13 Thread Jason Corley
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jason Corley
  Root:   /v/rpm/cvs   Email:  jas...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 16:09:43
  Branch: HEAD Handle: 2009031315094300

  Modified files:
rpm devtool.conf rpm.spec.in

  Log:
remove duplicate --db-tools-integrated

  Summary:
RevisionChanges Path
2.266   +0  -1  rpm/devtool.conf
2.455   +0  -1  rpm/rpm.spec.in
  

  patch -p0 '@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.265 -r2.266 devtool.conf
  --- rpm/devtool.conf  9 Mar 2009 23:09:40 -   2.265
  +++ rpm/devtool.conf  13 Mar 2009 15:09:43 -  2.266
  @@ -91,7 +91,6 @@
   --with-selinux \
   --with-python \
   --with-perl \
  ---with-db-tools-integrated \
   --with-build-extlibdep \
   --with-build-maxextlibdep \
   --enable-build-pic \
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpm.spec.in
  
  $ cvs diff -u -r2.454 -r2.455 rpm.spec.in
  --- rpm/rpm.spec.in   15 Dec 2008 21:02:51 -  2.454
  +++ rpm/rpm.spec.in   13 Mar 2009 15:09:43 -  2.455
  @@ -205,7 +205,6 @@
   --with-selinux \
$WITH_PYTHON \
$WITH_PERL \
  ---with-db-tools-integrated \
   --with-build-extlibdep \
   --with-build-maxextlibdep \
   --enable-build-pic \
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/rpmio/ rpmpigz.c rpmzq.c rpmzq.h

2009-03-13 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 17:29:29
  Branch: HEAD Handle: 2009031316292801

  Modified files:
rpm/rpmio   rpmpigz.c rpmzq.c rpmzq.h

  Log:
- jbj: rpmz: add locking sufficient to permit input job chaining.
- jbj: rpmz: add seperate I/O queues for z_stream pipelining. well, duh.

  Summary:
RevisionChanges Path
1.49+162 -134   rpm/rpmio/rpmpigz.c
1.17+11 -9  rpm/rpmio/rpmzq.c
1.25+9  -6  rpm/rpmio/rpmzq.h
  

  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmpigz.c
  
  $ cvs diff -u -r1.48 -r1.49 rpmpigz.c
  --- rpm/rpmio/rpmpigz.c   12 Mar 2009 21:35:40 -  1.48
  +++ rpm/rpmio/rpmpigz.c   13 Mar 2009 16:29:28 -  1.49
  @@ -1336,7 +1336,16 @@
job-more = (job-in-len == nread);
job-in-len = nread;
   
  - rpmzqAddRJob(zq, job);
  + /* queue read job at end of list. */
  +{rpmzJob here, *prior;
  + yarnPossess(zq-qi_first);
  + prior = zq-qi;
  + while ((here = *prior) != NULL)
  + prior = here-next;
  + job-next = here;
  + *prior = job;
  + yarnRelease(zq-qi_first);
  +}
   
Trace((zlog, -- decompress read thread read %lu bytes, nread));
yarnTwist(zq-load_state, TO, 0);
  @@ -1355,25 +1364,20 @@
/*...@globals fileSystem, internalState @*/
/*...@modifies zq, fileSystem, internalState @*/
   {
  -rpmzJob job = zq-_job;
  -
  -assert(job != NULL);
   /* if already detected end of file, do nothing */
  -if (job-more  0) {
  - job-more = 0;
  +if (zq-qi-more  0) {
  + zq-qi-more = 0;
return 0;
   }
   
   #if 0/* XXX hmmm, the comment above is incorrect. todo++ */
  -assert(job-in-len == 0);
  +assert(zq-qi-in-len == 0);
   #endif
   
   #ifndef _PIGZNOTHREAD
   /* if first time in or zq-threads == 1, read a buffer to have something 
to
  return, otherwise wait for the previous read job to complete */
   if (zq-threads  1) {
  - static long seq = 0;
  - rpmzJob njob;
/* if first time, fire up the read thread, ask for a read */
if (zq-_in_which == -1) {
zq-_in_which = 1;
  @@ -1389,17 +1393,27 @@
yarnRelease(zq-load_state);
   
/* set up input buffer with the data just read */
  - job-in = rpmzqDropSpace(job-in);
  - njob = rpmzqDelRJob(zq, seq++);
  + zq-qi-in = rpmzqDropSpace(zq-qi-in);
  +
  + yarnPossess(zq-qi_first);
  + yarnTwist(zq-qi_first, TO, -1);
  +
  + /* steal the queued read job following zq-qi. */
  + {   rpmzJob ojob;
  + rpmzJob njob;
  +
  + yarnPossess(zq-qi_first);
  + ojob = zq-qi;
  + njob = ojob-next;
   assert(njob != NULL);
  - job-in = njob-in;
  - job-seq = njob-seq;   /* XXX propagate job-seq for now */
  - njob-in = NULL;
  - njob = rpmzqDropJob(njob);
  + zq-qi = njob;
  + yarnRelease(zq-qi_first);
  + rpmzqDropJob(ojob);
  + }
   
/* if not at end of file, alert read thread to load next buffer,
 * alternate between in_buf and in_buf2 */
  - if (job-in-len == zq-_in_buf_allocated) {
  + if (zq-qi-in-len == zq-_in_buf_allocated) {
zq-_in_which = 1 - zq-_in_which;
yarnPossess(zq-load_state);
yarnTwist(zq-load_state, TO, 1);
  @@ -1417,28 +1431,28 @@
   {size_t nread;
/* don't use threads -- free old buffer, malloc and read a new buffer */

  - job-in = rpmzqDropSpace(job-in);
  - job-in = rpmzqNewSpace(NULL, zq-_in_buf_allocated);
  - nread = rpmzRead(zq, job-in-buf, job-in-len);
  - job-in-len = nread;
  + zq-qi-in = rpmzqDropSpace(zq-qi-in);
  + zq-qi-in = rpmzqNewSpace(NULL, zq-_in_buf_allocated);
  + nread = rpmzRead(zq, zq-qi-in-buf, zq-qi-in-len);
  + zq-qi-in-len = nread;
   }
   
   /* note end of file */
  -if (job-in-len  zq-_in_buf_allocated) {
  - job-more = -1;
  +if (zq-qi-in-len  zq-_in_buf_allocated) {
  + zq-qi-more = -1;
   
/* if we got bupkis, now is the time to mark eof */
  - if (job-in-len == 0)
  - job-more = 0;
  + if (zq-qi-in-len == 0)
  + zq-qi-more = 0;
   } else
  - job-more = 1;
  + zq-qi-more = 1;
   
   if (_debug)
  -jobDebug(loaded, zq-_job);
  +jobDebug(loaded, zq-qi);
   
   /* update the total and return the available bytes */
  -zq-in_tot += job-in-len;
  -

[CVS] RPM: rpm/lib/ rpmrc.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 18:43:29
  Branch: HEAD Handle: 2009031317432900

  Modified files:
rpm/lib rpmrc.c

  Log:
be sure to check that cvog isn't NULL before freeing it..

  Summary:
RevisionChanges Path
2.260   +4  -2  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.259 -r2.260 rpmrc.c
  --- rpm/lib/rpmrc.c   12 Mar 2009 22:01:17 -  2.259
  +++ rpm/lib/rpmrc.c   13 Mar 2009 17:43:29 -  2.260
  @@ -597,8 +597,10 @@
addMacro(NULL, _host_vendor, NULL, cvog-vendor, -1);
addMacro(NULL, _host_os, NULL, cvog-os, -1);
}
  - cvog-str = _free(cvog-str);
  - cvog = _free(cvog);
  + if (cvog) {
  +cvog-str = _free(cvog-str);
  +cvog = _free(cvog);
  + }
   
rc = RPMRC_OK;
if (rc == RPMRC_OK) {
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ rpmrc.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 18:57:08
  Branch: HEAD Handle: 2009031317570800

  Modified files:
rpm/lib rpmrc.c

  Log:
check cpuinfo() dependencies only rather than using #ifdefs

  Summary:
RevisionChanges Path
2.261   +29 -40 rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.260 -r2.261 rpmrc.c
  --- rpm/lib/rpmrc.c   13 Mar 2009 17:43:29 -  2.260
  +++ rpm/lib/rpmrc.c   13 Mar 2009 17:57:08 -  2.261
  @@ -524,53 +524,42 @@
   uname(un);
   xx = rpmdsCpuinfo(cpuinfo, NULL);
   
  -#if defined(__i386__) || defined(__x86_64__)
  -/* XXX: kinda superfluous, same as with cpuinfo([arch]), do nicer..? */
  -if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo)  strcmp(un.machine, 
x86_64) == 0)
  - xx = mireAppend(RPMMIRE_REGEX, 0, x86_64, NULL, mi_re, mi_nre);
  -if(rpmCpuinfoMatch(cpuinfo(cmov), cpuinfo))
  -{
  - if(rpmCpuinfoMatch(cpuinfo(mmx), cpuinfo))
  - {
  - if(rpmCpuinfoMatch(cpuinfo(sse), cpuinfo))
  - {
  - if(rpmCpuinfoMatch(cpuinfo(sse2), cpuinfo))
  - xx = mireAppend(RPMMIRE_REGEX, 0, pentium4, NULL, mi_re, 
mi_nre);
  - xx = mireAppend(RPMMIRE_REGEX, 0, pentium3, NULL, mi_re, 
mi_nre);
  - }
  - if(rpmCpuinfoMatch(cpuinfo(3dnow+), cpuinfo))
  - xx = mireAppend(RPMMIRE_REGEX, 0, athlon, NULL, mi_re, 
mi_nre);
  - xx = mireAppend(RPMMIRE_REGEX, 0, pentium2, NULL, mi_re, 
mi_nre);
  - }
  - xx = mireAppend(RPMMIRE_REGEX, 0, i686, NULL, mi_re, mi_nre);
  -}
  -if(rpmCpuinfoMatch(cpuinfo(3dnow), cpuinfo)  
rpmCpuinfoMatch(cpuinfo(mmx), cpuinfo))
  - xx = mireAppend(RPMMIRE_REGEX, 0, geode, NULL, mi_re, mi_nre);
  -if(rpmCpuinfoMatch(cpuinfo(tsc), cpuinfo))
  - xx = mireAppend(RPMMIRE_REGEX, 0, i586, NULL, mi_re, mi_nre);
  -if(rpmCpuinfoMatch(cpuinfo(ac), cpuinfo))
  - xx = mireAppend(RPMMIRE_REGEX, 0, i486, NULL, mi_re, mi_nre);
  -if(rpmCpuinfoMatch(cpuinfo([x86]), cpuinfo))
  +if(rpmCpuinfoMatch(cpuinfo([x86]), cpuinfo)) {
  + if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo)  strcmp(un.machine, 
x86_64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, x86_64, NULL, mi_re, mi_nre);
  + if(rpmCpuinfoMatch(cpuinfo(cmov), cpuinfo)) {
  + if(rpmCpuinfoMatch(cpuinfo(mmx), cpuinfo)) {
  + if(rpmCpuinfoMatch(cpuinfo(sse), cpuinfo)) {
  + if(rpmCpuinfoMatch(cpuinfo(sse2), cpuinfo))
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium4, NULL, 
mi_re, mi_nre);
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium3, NULL, mi_re, 
mi_nre);
  + }
  + if(rpmCpuinfoMatch(cpuinfo(3dnow+), cpuinfo))
  + xx = mireAppend(RPMMIRE_REGEX, 0, athlon, NULL, mi_re, 
mi_nre);
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium2, NULL, mi_re, 
mi_nre);
  + }
  + xx = mireAppend(RPMMIRE_REGEX, 0, i686, NULL, mi_re, mi_nre);
  + }
  + if(rpmCpuinfoMatch(cpuinfo(3dnow), cpuinfo)  
rpmCpuinfoMatch(cpuinfo(mmx), cpuinfo))
  + xx = mireAppend(RPMMIRE_REGEX, 0, geode, NULL, mi_re, mi_nre);
  + if(rpmCpuinfoMatch(cpuinfo(tsc), cpuinfo))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i586, NULL, mi_re, mi_nre);
  + if(rpmCpuinfoMatch(cpuinfo(ac), cpuinfo))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i486, NULL, mi_re, mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, i386, NULL, mi_re, mi_nre);
  -#endif
  + xx = mireAppend(RPMMIRE_REGEX, 0, fat, NULL, mi_re, mi_nre);
  +}
   
  -#if defined(__powerpc__)
  -if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo)  strcmp(un.machine, 
ppc64) == 0)
  - xx = mireAppend(RPMMIRE_REGEX, 0, ppc64, NULL, mi_re, mi_nre);
  -if(rpmCpuinfoMatch(cpuinfo([ppc]), cpuinfo))
  +if(rpmCpuinfoMatch(cpuinfo([ppc]), cpuinfo)) {
  + if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo)  strcmp(un.machine, 
ppc64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, ppc64, NULL, mi_re, mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, ppc, NULL, mi_re, mi_nre);
  -#endif
  -
  -#if defined(__powerpc__) || defined(__i386__) || defined(__x86_64__)
  -if(rpmCpuinfoMatch(cpuinfo([ppc]), cpuinfo) || 
rpmCpuinfoMatch(cpuinfo([ppc]), cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, fat, NULL, mi_re, mi_nre);
  -#endif
  +}
   
  -#if defined(__ia64__)
   if(rpmCpuinfoMatch(cpuinfo([ia64]), 

[CVS] RPM: rpm/lib/ rpmds.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 19:27:30
  Branch: HEAD Handle: 2009031318273000

  Modified files:
rpm/lib rpmds.c

  Log:
add cpuinfo(cpu_cores)  cpuinfo(cpu_threads) for libcpuinfo

  Summary:
RevisionChanges Path
2.127   +10 -4  rpm/lib/rpmds.c
  

  patch -p0 '@@ .'
  Index: rpm/lib/rpmds.c
  
  $ cvs diff -u -r2.126 -r2.127 rpmds.c
  --- rpm/lib/rpmds.c   12 Mar 2009 22:56:53 -  2.126
  +++ rpm/lib/rpmds.c   13 Mar 2009 18:27:30 -  2.127
  @@ -1207,11 +1207,17 @@
   const char * NS = cpuinfo;
   struct cpuinfo *cip = cpuinfo_new();
   cpuinfo_feature_t feature;
  +char tmp[20];
   
  -char mhz[20];
  -snprintf(mhz, 19, %d, cpuinfo_get_frequency(cip));
  -mhz[19] = '\0';
  -rpmdsNSAdd(dsp, NS, cpu_MHz, mhz, RPMSENSE_PROBE|RPMSENSE_EQUAL);
  +snprintf(tmp, 19, %d, cpuinfo_get_frequency(cip));
  +tmp[19] = '\0';
  +rpmdsNSAdd(dsp, NS, cpu_MHz, tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
  +snprintf(tmp, 19, %d, cpuinfo_get_cores(cip));
  +tmp[19] = '\0';
  +rpmdsNSAdd(dsp, NS, cpu_cores, tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
  +snprintf(tmp, 19, %d, cpuinfo_get_threads(cip));
  +tmp[19] = '\0';
  +rpmdsNSAdd(dsp, NS, cpu_threads, tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
   
   for (feature = cpuinfo_feature_common; feature != 
cpuinfo_feature_architecture_max; feature++) {
if(feature == cpuinfo_feature_common_max)
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ rpmrc.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 19:33:47
  Branch: HEAD Handle: 2009031318334600

  Modified files:
rpm/lib rpmrc.c

  Log:
update feature name since libcpuinfo has been made consistent with
/proc/cpuinfo

  Summary:
RevisionChanges Path
2.262   +1  -1  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.261 -r2.262 rpmrc.c
  --- rpm/lib/rpmrc.c   13 Mar 2009 17:57:08 -  2.261
  +++ rpm/lib/rpmrc.c   13 Mar 2009 18:33:46 -  2.262
  @@ -534,7 +534,7 @@
xx = mireAppend(RPMMIRE_REGEX, 0, pentium4, NULL, 
mi_re, mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, pentium3, NULL, mi_re, 
mi_nre);
}
  - if(rpmCpuinfoMatch(cpuinfo(3dnow+), cpuinfo))
  + if(rpmCpuinfoMatch(cpuinfo(3dnowext), cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, athlon, NULL, mi_re, 
mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, pentium2, NULL, mi_re, 
mi_nre);
}
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ rpmds.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 19:35:53
  Branch: HEAD Handle: 2009031318355300

  Modified files:
rpm/lib rpmds.c

  Log:
no need to add terminator several times since we never copy long enough 
strings
to overwrite it

  Summary:
RevisionChanges Path
2.128   +0  -2  rpm/lib/rpmds.c
  

  patch -p0 '@@ .'
  Index: rpm/lib/rpmds.c
  
  $ cvs diff -u -r2.127 -r2.128 rpmds.c
  --- rpm/lib/rpmds.c   13 Mar 2009 18:27:30 -  2.127
  +++ rpm/lib/rpmds.c   13 Mar 2009 18:35:53 -  2.128
  @@ -1213,10 +1213,8 @@
   tmp[19] = '\0';
   rpmdsNSAdd(dsp, NS, cpu_MHz, tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
   snprintf(tmp, 19, %d, cpuinfo_get_cores(cip));
  -tmp[19] = '\0';
   rpmdsNSAdd(dsp, NS, cpu_cores, tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
   snprintf(tmp, 19, %d, cpuinfo_get_threads(cip));
  -tmp[19] = '\0';
   rpmdsNSAdd(dsp, NS, cpu_threads, tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
   
   for (feature = cpuinfo_feature_common; feature != 
cpuinfo_feature_architecture_max; feature++) {
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/rpmio/ rpmpigz.c rpmzq.c rpmzq.h

2009-03-13 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 20:20:01
  Branch: HEAD Handle: 2009031319200100

  Modified files:
rpm/rpmio   rpmpigz.c rpmzq.c rpmzq.h

  Log:
- jbj: rpmz: structures for FIFO/SEQUENCE queues with Yet Another
Renaming.

  Summary:
RevisionChanges Path
1.50+125 -131   rpm/rpmio/rpmpigz.c
1.18+46 -46 rpm/rpmio/rpmzq.c
1.26+45 -19 rpm/rpmio/rpmzq.h
  

  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmpigz.c
  
  $ cvs diff -u -r1.49 -r1.50 rpmpigz.c
  --- rpm/rpmio/rpmpigz.c   13 Mar 2009 16:29:28 -  1.49
  +++ rpm/rpmio/rpmpigz.c   13 Mar 2009 19:20:01 -  1.50
  @@ -905,18 +905,18 @@
   int caught;
   
   /* only do this once */
  -if (zq-compress_have == NULL)
  +if (zq-_compress.have == NULL)
return;
   
   /* command all of the extant compress threads to return */
  -yarnPossess(zq-compress_have);
  +yarnPossess(zq-_compress.have);
   job.seq = -1;
   job.next = NULL;
   /*...@-immediatetrans -mustfreeo...@*/
  -zq-compress_head = job;
  +zq-_compress.head = job;
   /*...@=immediatetrans =mustfreeo...@*/
  -zq-compress_tail = (job.next);
  -yarnTwist(zq-compress_have, BY, 1);   /* will wake them all up */
  +zq-_compress.tail = (job.next);
  +yarnTwist(zq-_compress.have, BY, 1);   /* will wake them all up */
   
   /* join all of the compress threads, verify they all came back */
   caught = yarnJoinAll();
  @@ -929,8 +929,8 @@
   Trace((zlog, -- freed %d output buffers, caught));
   zq-in_pool = rpmzqFreePool(zq-in_pool, caught);
   Trace((zlog, -- freed %d input buffers, caught));
  -zq-write_first = yarnFreeLock(zq-write_first);
  -zq-compress_have = yarnFreeLock(zq-compress_have);
  +zq-_write.first = yarnFreeLock(zq-_write.first);
  +zq-_compress.have = yarnFreeLock(zq-_compress.have);
   }
   
   /* setup job lists (call from main thread) */
  @@ -939,16 +939,16 @@
/*...@modifies fileSystem, internalState @*/
   {
   /* set up only if not already set up*/
  -if (zq-compress_have != NULL)
  +if (zq-_compress.have != NULL)
return;
   
   /* allocate locks and initialize lists */
   /*...@-mustfreeonly@*/
  -zq-compress_have = yarnNewLock(0);
  -zq-compress_head = NULL;
  -zq-compress_tail = zq-compress_head;
  -zq-write_first = yarnNewLock(-1);
  -zq-write_head = NULL;
  +zq-_compress.have = yarnNewLock(0);
  +zq-_compress.head = NULL;
  +zq-_compress.tail = zq-_compress.head;
  +zq-_write.first = yarnNewLock(-1);
  +zq-_write.head = NULL;
   
   /* initialize buffer pools */
   zq-in_pool = rpmzqNewPool(zq-blocksize, (zq-threads  1) + 2);
  @@ -1031,7 +1031,7 @@
   
   gz = rpmgzCompressFini(gz);
   
  -/*...@-mustfreeonly@*/   /* XXX zq-compress_head not released */
  +/*...@-mustfreeonly@*/   /* XXX zq-_compress.head not released */
   return;
   /*...@=mustfreeonly@*/
   }
  @@ -1338,13 +1338,13 @@
   
/* queue read job at end of list. */
   {rpmzJob here, *prior;
  - yarnPossess(zq-qi_first);
  - prior = zq-qi;
  + yarnPossess(zq-_qi.first);
  + prior = zq-_qi.head;
while ((here = *prior) != NULL)
prior = here-next;
job-next = here;
*prior = job;
  - yarnRelease(zq-qi_first);
  + yarnRelease(zq-_qi.first);
   }
   
Trace((zlog, -- decompress read thread read %lu bytes, nread));
  @@ -1365,8 +1365,8 @@
/*...@modifies zq, fileSystem, internalState @*/
   {
   /* if already detected end of file, do nothing */
  -if (zq-qi-more  0) {
  - zq-qi-more = 0;
  +if (zq-_qi.head-more  0) {
  + zq-_qi.head-more = 0;
return 0;
   }
   
  @@ -1393,27 +1393,27 @@
yarnRelease(zq-load_state);
   
/* set up input buffer with the data just read */
  - zq-qi-in = rpmzqDropSpace(zq-qi-in);
  + zq-_qi.head-in = rpmzqDropSpace(zq-_qi.head-in);
   
  - yarnPossess(zq-qi_first);
  - yarnTwist(zq-qi_first, TO, -1);
  + yarnPossess(zq-_qi.first);
  + yarnTwist(zq-_qi.first, TO, -1);
   
/* steal the queued read job following zq-qi. */
{   rpmzJob ojob;
rpmzJob njob;
   
  - yarnPossess(zq-qi_first);
  - ojob = zq-qi;
  + yarnPossess(zq-_qi.first);
  + ojob = zq-_qi.head;
njob = ojob-next;
   assert(njob != 

[CVS] RPM: rpm/rpmio/ librpmio.vers rpmpigz.c rpmzq.c rpmzq.h

2009-03-13 Thread Jeff Johnson
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Jeff Johnson
  Root:   /v/rpm/cvs   Email:  j...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 23:13:50
  Branch: HEAD Handle: 2009031322135000

  Modified files:
rpm/rpmio   librpmio.vers rpmpigz.c rpmzq.c rpmzq.h

  Log:
- jbj: rpmz: move the FIFO/SEQ queue methods to rpmzq.

  Summary:
RevisionChanges Path
2.91+8  -0  rpm/rpmio/librpmio.vers
1.52+0  -115rpm/rpmio/rpmpigz.c
1.20+102 -0 rpm/rpmio/rpmzq.c
1.28+44 -0  rpm/rpmio/rpmzq.h
  

  patch -p0 '@@ .'
  Index: rpm/rpmio/librpmio.vers
  
  $ cvs diff -u -r2.90 -r2.91 librpmio.vers
  --- rpm/rpmio/librpmio.vers   13 Mar 2009 21:40:03 -  2.90
  +++ rpm/rpmio/librpmio.vers   13 Mar 2009 22:13:50 -  2.91
  @@ -428,15 +428,23 @@
   rpmbzCompressBlock;
   _rpmzq;
   rpmzqAddCJob;
  +rpmzqAddFIFO;
  +rpmzqAddSEQ;
   rpmzqAddWJob;
   rpmzqDelCJob;
  +rpmzqDelFIFO;
  +rpmzqDelSEQ;
   rpmzqDelWJob;
   rpmzqDropJob;
   rpmzqDropSpace;
   rpmzqFini;
  +rpmzqFiniFIFO;
  +rpmzqFiniSEQ;
   rpmzqFree;
   rpmzqFreePool;
   rpmzqInit;
  +rpmzqInitFIFO;
  +rpmzqInitSEQ;
   rpmzqLaunch;
   rpmzqNew;
   rpmzqNewJob;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmpigz.c
  
  $ cvs diff -u -r1.51 -r1.52 rpmpigz.c
  --- rpm/rpmio/rpmpigz.c   13 Mar 2009 21:40:03 -  1.51
  +++ rpm/rpmio/rpmpigz.c   13 Mar 2009 22:13:50 -  1.52
  @@ -885,121 +885,6 @@
   }
   
   /*==*/
  -static void rpmzqInitFIFO(rpmzFIFO zs, long val)
  - /*...@modifies zs @*/
  -{
  -zs-have = yarnNewLock(val);
  -zs-head = NULL;
  -zs-tail = zs-head;
  -}
  -
  -static void rpmzqFiniFIFO(rpmzFIFO zs)
  - /*...@modifies zs @*/
  -{
  -if (zs-have != NULL)
  - zs-have = yarnFreeLock(zs-have);
  -zs-head = NULL;
  -zs-tail = zs-head;
  -}
  -
  -static rpmzJob rpmzqDelFIFO(rpmzFIFO zs)
  - /*...@globals fileSystem, internalState @*/
  - /*...@modifies zs, fileSystem, internalState @*/
  -{
  -rpmzJob job;
  -
  -/* get job from compress list, let all the compressors know */
  -yarnPossess(zs-have);
  -yarnWaitFor(zs-have, NOT_TO_BE, 0);
  -job = zs-head;
  -assert(job != NULL);
  -if (job-seq == -1) {
  - yarnRelease(zs-have);
  - return NULL;
  -}
  -
  -/*...@-assignexpose -dependenttr...@*/
  -zs-head = job-next;
  -/*...@=assignexpose =dependenttr...@*/
  -if (job-next == NULL)
  - zs-tail = zs-head;
  -yarnTwist(zs-have, BY, -1);
  -
  -return job;
  -}
  -
  -static void rpmzqAddFIFO(rpmzFIFO zs, rpmzJob job)
  - /*...@globals fileSystem, internalState @*/
  - /*...@modifies zs, job, fileSystem, internalState @*/
  -{
  -/* put job at end of compress list, let all the compressors know */
  -yarnPossess(zs-have);
  -job-next = NULL;
  -/*...@-assignexpose@*/
  -*zs-tail = job;
  -zs-tail = job-next;
  -/*...@=assignexpose@*/
  -yarnTwist(zs-have, BY, 1);
  -}
  -
  -static void rpmzqInitSEQ(rpmzSEQ zs, long val)
  - /*...@modifies zs @*/
  -{
  -zs-first = yarnNewLock(val);
  -zs-head = NULL;
  -}
  -
  -static void rpmzqFiniSEQ(rpmzSEQ zs)
  - /*...@modifies zs @*/
  -{
  -if (zs-first != NULL)
  - zs-first = yarnFreeLock(zs-first);
  -zs-head = NULL;
  -}
  -
  -static rpmzJob rpmzqDelSEQ(rpmzSEQ zs, long seq)
  - /*...@globals fileSystem, internalState @*/
  - /*...@modifies zs, fileSystem, internalState @*/
  -{
  -rpmzJob job;
  -
  -/* get next read job in order */
  -yarnPossess(zs-first);
  -yarnWaitFor(zs-first, TO_BE, seq);
  -job = zs-head;
  -assert(job != NULL);
  -/*...@-assignexpose -dependenttr...@*/
  -zs-head = job-next;
  -/*...@=assignexpose =dependenttr...@*/
  -yarnTwist(zs-first, TO, zs-head == NULL ? -1 : zs-head-seq);
  -return job;
  -}
  -
  -static void rpmzqAddSEQ(rpmzSEQ zs, rpmzJob job)
  - /*...@globals fileSystem, internalState @*/
  - /*...@modifies zs, job, fileSystem, internalState @*/
  -{
  -rpmzJob here;/* pointers for inserting in SEQ list */
  -rpmzJob * prior; /* pointers for inserting in SEQ list */
  -
  -yarnPossess(zs-first);
  -
  -/* insert read job in list in sorted order, alert read thread */
  -prior = zs-head;
  -while ((here = *prior) 

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   13-Mar-2009 23:46:12
  Branch: HEAD Handle: 2009031322461200

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
get the list of compatible archs printed with '--showrc' from mire
platform patterns.

  Summary:
RevisionChanges Path
1.2818  +2  -0  rpm/CHANGES
2.263   +3  -3  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2817 -r1.2818 CHANGES
  --- rpm/CHANGES   12 Mar 2009 21:56:36 -  1.2817
  +++ rpm/CHANGES   13 Mar 2009 22:46:12 -  1.2818
  @@ -1,5 +1,7 @@
   
   5.2a3 - 5.2a4:
  +- proyvind: get the list of compatible archs printed with '--showrc' from
  + mire platform patterns.
   - proyvind: use cpuinfo() probe for detecting platform rather than
libcpuinfo directly.
   - jbj: delete ancient header+payload RSA signatures too using GPG 
(#488953).
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.262 -r2.263 rpmrc.c
  --- rpm/lib/rpmrc.c   13 Mar 2009 18:33:46 -  2.262
  +++ rpm/lib/rpmrc.c   13 Mar 2009 22:46:12 -  2.263
  @@ -1080,6 +1080,7 @@
   int i;
   machEquivTable equivTable;
   int xx;
  +miRE mire;
   
   /* the caller may set the build arch which should be printed here */
   fprintf(fp, ARCHITECTURE AND OS:\n);
  @@ -1103,9 +1104,8 @@
   fprintf(fp, install os: %s\n, current[OS]);
   
   fprintf(fp, compatible archs  :);
  -equivTable = tables[RPM_MACHTABLE_INSTARCH].equiv;
  -for (i = 0; i  equivTable-count; i++)
  - fprintf(fp, %s, equivTable-list[i].name);
  +for (mire = platpat, i = 0; i  nplatpat; i++)
  + fprintf(fp,  %s, mire[i].pattern);
   fprintf(fp, \n);
   
   fprintf(fp, compatible os's   :);
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c

2009-03-13 Thread Per �yvind Karlsen
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Per Øyvind Karlsen
  Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
  Module: rpm  Date:   14-Mar-2009 02:49:01
  Branch: HEAD Handle: 200903140149

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
make it possible to set preferred build architectures when using libcpuinfo 
with
ie. '%_prefer_buildarchs x86_64:i686:i586'.

  Summary:
RevisionChanges Path
1.2819  +2  -0  rpm/CHANGES
2.264   +22 -0  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2818 -r1.2819 CHANGES
  --- rpm/CHANGES   13 Mar 2009 22:46:12 -  1.2818
  +++ rpm/CHANGES   14 Mar 2009 01:49:00 -  1.2819
  @@ -1,5 +1,7 @@
   
   5.2a3 - 5.2a4:
  +- proyvind: make it possible to set preferred build architectures when 
using
  + libcpuinfo with ie. '%_prefer_buildarchs x86_64:i686:i586'.
   - proyvind: get the list of compatible archs printed with '--showrc' from
mire platform patterns.
   - proyvind: use cpuinfo() probe for detecting platform rather than
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.263 -r2.264 rpmrc.c
  --- rpm/lib/rpmrc.c   13 Mar 2009 22:46:12 -  2.263
  +++ rpm/lib/rpmrc.c   14 Mar 2009 01:49:00 -  2.264
  @@ -13,6 +13,7 @@
   #include rpmcb.h
   #define _MIRE_INTERNAL
   #include mire.h
  +#include argv.h
   #include rpmlua.h
   #include rpmluaext.h
   #include rpmmacro.h
  @@ -848,7 +849,28 @@
if (name) *name = canon-short_name;
   } else {
if (num) *num = 255;
  +#if defined(SUPPORT_LIBCPUINFO)
  + if (name)
  + {
  + char * pref = NULL;
  + if(type == ARCH  strlen((pref = 
rpmExpand(%{?_prefer_buildarchs}, NULL)))  0)
  + {
  + ARGV_t archs = NULL;
  + int i, j, n;
  +
  + (void) argvSplit(archs, pref, :);
  +
  + for(i = 0, j = argvCount(archs); (i  j  !*name); i++)
  + if((n = rpmPlatformScore(archs[i], platpat, nplatpat))  0)
  + *name = ((miRE)platpat)[n-1].pattern;
  + archs = argvFree(archs);
  + }
  + if(pref) pref = _free(pref);
  + if(!*name) *name = current[type];
  + }
  +#else
if (name) *name = current[type];
  +#endif
   }
   }
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org