[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c rpm/rpmio/ librpmio.vers look...

2010-12-29 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:   29-Dec-2010 17:33:54
  Branch: HEAD Handle: 2010122916335201

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/rpmio   librpmio.vers lookup3.c

  Log:
- revert lookup3.c+valgrind because gcc version dependent.

  Summary:
RevisionChanges Path
1.3528  +1  -0  rpm/CHANGES
2.291   +0  -4  rpm/lib/rpmrc.c
2.201   +0  -1  rpm/rpmio/librpmio.vers
1.8 +62 -72 rpm/rpmio/lookup3.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.3527 -r1.3528 CHANGES
  --- rpm/CHANGES   29 Dec 2010 16:07:59 -  1.3527
  +++ rpm/CHANGES   29 Dec 2010 16:33:52 -  1.3528
  @@ -1,4 +1,5 @@
   5.4.0 - 5.4.1:
  +- jbj: revert lookup3.c+valgrind because gcc version dependent.
   
   5.3.7 - 5.4.0:
   - jbj: remove markReplacedFiles.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.290 -r2.291 rpmrc.c
  --- rpm/lib/rpmrc.c   25 Dec 2010 20:39:05 -  2.290
  +++ rpm/lib/rpmrc.c   29 Dec 2010 16:33:53 -  2.291
  @@ -1070,10 +1070,6 @@
   {
   int rc = 0;
   
  -#ifdef WITH_VALGRIND
  -_running_on_valgrind = RUNNING_ON_VALGRIND;
  -#endif
  -
   if (!defaultsInitialized) {
setDefaults();
defaultsInitialized = 1;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/librpmio.vers
  
  $ cvs diff -u -r2.200 -r2.201 librpmio.vers
  --- rpm/rpmio/librpmio.vers   25 Dec 2010 20:39:04 -  2.200
  +++ rpm/rpmio/librpmio.vers   29 Dec 2010 16:33:53 -  2.201
  @@ -881,7 +881,6 @@
   mongo_simple_int_command;
   mongo_simple_str_command;
   mongo_update;
  -_running_on_valgrind;
 local:
   *;
   };
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/lookup3.c
  
  $ cvs diff -u -r1.7 -r1.8 lookup3.c
  --- rpm/rpmio/lookup3.c   25 Dec 2010 20:39:04 -  1.7
  +++ rpm/rpmio/lookup3.c   29 Dec 2010 16:33:53 -  1.8
  @@ -255,7 +255,7 @@
   u.ptr = key;
   if (HASH_LITTLE_ENDIAN  ((u.i  0x3) == 0)) {
const rpmuint32_t *k = (const rpmuint32_t *)key;/* read 32-bit 
chunks */
  -#ifdef   WITH_VALGRIND
  +#ifdef   VALGRIND
const rpmuint8_t  *k8;
   #endif
   
  @@ -279,29 +279,8 @@
 * still catch it and complain.  The masking trick does make the hash
 * noticably faster for short strings (like English words).
 */
  -#ifdef WITH_VALGRIND
  - if(UNLIKELY(_running_on_valgrind)) {
  - /* make valgrind happy */
  +#ifndef VALGRIND
   
  - k8 = (const rpmuint8_t *)k;
  - switch (size) {
  - case 12:c += k[2]; b+=k[1]; a+=k[0];break;
  - case 11:c += ((rpmuint32_t)k8[10])16; /*...@fallthrough@*/
  - case 10:c += ((rpmuint32_t)k8[9])8;   /*...@fallthrough@*/
  - case  9:c += k8[8]; /*...@fallthrough@*/
  - case  8:b += k[1]; a+=k[0]; break;
  - case  7:b += ((rpmuint32_t)k8[6])16;  /*...@fallthrough@*/
  - case  6:b += ((rpmuint32_t)k8[5])8;   /*...@fallthrough@*/
  - case  5:b += k8[4]; /*...@fallthrough@*/
  - case  4:a += k[0];  break;
  - case  3:a += ((rpmuint32_t)k8[2])16;  /*...@fallthrough@*/
  - case  2:a += ((rpmuint32_t)k8[1])8;   /*...@fallthrough@*/
  - case  1:a += k8[0]; break;
  - case  0:goto exit;
  - }
  -
  - } else {
  -#endif
switch (size) {
case 12:c += k[2]; b+=k[1]; a+=k[0]; break;
case 11:c += k[2]0xff; b+=k[1]; a+=k[0]; break;
  @@ -317,8 +296,26 @@
case  1:a += k[0]0xff; break;
case  0:goto exit;
}
  -#ifdef WITH_VALGRIND
  +
  +#else /* make valgrind happy */
  +
  + k8 = (const rpmuint8_t *)k;
  + switch (size) {
  + case 12:c += k[2]; b+=k[1]; a+=k[0] break;
  + case 11:c += ((rpmuint32_t)k8[10])16; /*...@fallthrough@*/
  + case 10:c += ((rpmuint32_t)k8[9])8;   /*...@fallthrough@*/
  + case  9:c += k8[8]; /*...@fallthrough@*/
  + case  8:  

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c rpm/rpmio/ librpmio.vers look...

2010-12-25 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:   25-Dec-2010 21:39:05
  Branch: HEAD Handle: 2010122520390302

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/rpmio   librpmio.vers lookup3.c rpmio.c

  Log:
lookup3: fix valgrind #ifdef and perform runtime check for valgrind in
stead.

  Summary:
RevisionChanges Path
1.3521  +2  -0  rpm/CHANGES
2.290   +4  -0  rpm/lib/rpmrc.c
2.200   +1  -0  rpm/rpmio/librpmio.vers
1.7 +72 -62 rpm/rpmio/lookup3.c
1.231   +4  -0  rpm/rpmio/rpmio.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.3520 -r1.3521 CHANGES
  --- rpm/CHANGES   25 Dec 2010 19:31:46 -  1.3520
  +++ rpm/CHANGES   25 Dec 2010 20:39:03 -  1.3521
  @@ -1,4 +1,6 @@
   5.3.7 - 5.4a1:
  +- proyvind: lookup3: fix valgrind #ifdef and perform runtime check for
  + valgrind in stead.
   - jbj: ISPRAS: upgrade to abi-compliance-checker-1.21.9.
   - jbj: ISPRAS: upgrade to api-sanity-autotest-1.11.
   - jbj: rpmdb: disable Depcache, --install and make test todo++.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.289 -r2.290 rpmrc.c
  --- rpm/lib/rpmrc.c   10 Dec 2009 18:52:18 -  2.289
  +++ rpm/lib/rpmrc.c   25 Dec 2010 20:39:05 -  2.290
  @@ -1070,6 +1070,10 @@
   {
   int rc = 0;
   
  +#ifdef WITH_VALGRIND
  +_running_on_valgrind = RUNNING_ON_VALGRIND;
  +#endif
  +
   if (!defaultsInitialized) {
setDefaults();
defaultsInitialized = 1;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/librpmio.vers
  
  $ cvs diff -u -r2.199 -r2.200 librpmio.vers
  --- rpm/rpmio/librpmio.vers   11 Oct 2010 18:39:37 -  2.199
  +++ rpm/rpmio/librpmio.vers   25 Dec 2010 20:39:04 -  2.200
  @@ -881,6 +881,7 @@
   mongo_simple_int_command;
   mongo_simple_str_command;
   mongo_update;
  +_running_on_valgrind;
 local:
   *;
   };
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/lookup3.c
  
  $ cvs diff -u -r1.6 -r1.7 lookup3.c
  --- rpm/rpmio/lookup3.c   25 Dec 2008 18:36:36 -  1.6
  +++ rpm/rpmio/lookup3.c   25 Dec 2010 20:39:04 -  1.7
  @@ -255,7 +255,7 @@
   u.ptr = key;
   if (HASH_LITTLE_ENDIAN  ((u.i  0x3) == 0)) {
const rpmuint32_t *k = (const rpmuint32_t *)key;/* read 32-bit 
chunks */
  -#ifdef   VALGRIND
  +#ifdef   WITH_VALGRIND
const rpmuint8_t  *k8;
   #endif
   
  @@ -279,29 +279,13 @@
 * still catch it and complain.  The masking trick does make the hash
 * noticably faster for short strings (like English words).
 */
  -#ifndef VALGRIND
  -
  - switch (size) {
  - case 12:c += k[2]; b+=k[1]; a+=k[0]; break;
  - case 11:c += k[2]0xff; b+=k[1]; a+=k[0]; break;
  - case 10:c += k[2]0x; b+=k[1]; a+=k[0]; break;
  - case  9:c += k[2]0xff; b+=k[1]; a+=k[0]; break;
  - case  8:b += k[1]; a+=k[0]; break;
  - case  7:b += k[1]0xff; a+=k[0]; break;
  - case  6:b += k[1]0x; a+=k[0]; break;
  - case  5:b += k[1]0xff; a+=k[0]; break;
  - case  4:a += k[0]; break;
  - case  3:a += k[0]0xff; break;
  - case  2:a += k[0]0x; break;
  - case  1:a += k[0]0xff; break;
  - case  0:goto exit;
  - }
  -
  -#else /* make valgrind happy */
  +#ifdef WITH_VALGRIND
  + if(UNLIKELY(_running_on_valgrind)) {
  + /* make valgrind happy */
   
k8 = (const rpmuint8_t *)k;
switch (size) {
  - case 12:c += k[2]; b+=k[1]; a+=k[0] break;
  + case 12:c += k[2]; b+=k[1]; a+=k[0];break;
case 11:c += ((rpmuint32_t)k8[10])16; /*...@fallthrough@*/
case 10:c += ((rpmuint32_t)k8[9])8;   /*...@fallthrough@*/
case  9:c += k8[8]; /*...@fallthrough@*/
  @@ -316,6 +300,25 @@
case  0:goto exit;
}
   
  + } else {
  +#endif
  + switch (size) {
  + case 12:c += k[2]; b+=k[1]; a+=k[0]; break;
  + case 11:c += k[2]0xff; b+=k[1]; a+=k[0]; 

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

2009-05-15 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:   15-May-2009 14:28:45
  Branch: HEAD Handle: 2009051512284400

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
* make it possible to set macro files to load predefines from by defining 
PREMACROFILES at build time.
* ditch rpmRereadMacros()

  Summary:
RevisionChanges Path
1.2988  +2  -0  rpm/CHANGES
2.287   +9  -35 rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2987 -r1.2988 CHANGES
  --- rpm/CHANGES   14 May 2009 16:58:23 -  1.2987
  +++ rpm/CHANGES   15 May 2009 12:28:44 -  1.2988
  @@ -1,5 +1,7 @@
   
   5.2b1 - 5.3a1
  +- proyvind: make it possible to set macro files to load predefines from 
by
  + defining PREMACROFILES at build time.
   - jbj: rpmmi: rename the typedef and rpmmi{Init,Next,Free} methods.
   - jbj: rpmmi: split out a pool destructor (prior to using).
   - jbj: mire: handle items from _mirePool like all other pools.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.286 -r2.287 rpmrc.c
  --- rpm/lib/rpmrc.c   13 May 2009 15:32:54 -  2.286
  +++ rpm/lib/rpmrc.c   15 May 2009 12:28:44 -  2.287
  @@ -1062,8 +1062,8 @@
* Read macro configuration file(s).
* @return   0 on success
*/
  -static int rpmReadRC(void)
  - /*...@globals defaultsInitialized, rpmMacrofiles,
  +static int rpmReadRC(const char *macrofiles)
  + /*...@globals defaultsInitialized,
rpmGlobalMacroContext, rpmCLIMacroContext, h_errno,
fileSystem, internalState @*/
/*...@modifies defaultsInitialized, rpmGlobalMacroContext,
  @@ -1077,7 +1077,7 @@
   }
   
   /* Read macro files. */
  -{const char *mfpath = rpmExpand(rpmMacrofiles, NULL);
  +{const char *mfpath = rpmExpand(macrofiles, NULL);

if (mfpath != NULL) {
rpmInitMacros(NULL, mfpath);
  @@ -1088,40 +1088,17 @@
   return rc;
   }
   
  -#if defined(WITH_CPUINFO)
  -/* Since %{_prefer_target_cpu} hasn't been read before rpmReadRC(), we need 
to
  - * reread platform specific macros again to be sure to get the right ones.. 
*/
  -static inline void rpmRereadTargetMacros(const char *cpu) {
  -if(strcmp(current[ARCH], cpu) != 0) {
  - ARGV_t macroArgv = NULL;
  - int i, n;
  - const char delim[] = :;
  - char *macrofiles = xcalloc(strlen(rpmMacrofiles), 1);
  -
  - (void) argvSplit(macroArgv, rpmMacrofiles, delim);
  - for(i = 0, n = argvCount(macroArgv); i  n; i++) {
  - const char *macrofile = rpmExpand(macroArgv[i], NULL);
  - if(strcmp(macroArgv[i], macrofile) != 0  strstr(macrofile, cpu) 
!= NULL) {
  - if(strlen(macrofiles)  0)
  - strncat(macrofiles, delim, strlen(delim));
  - strncat(macrofiles, macrofile, strlen(macrofile));
  - }
  - macrofile = _free(macrofile);
  - }
  - if(strlen(macrofiles)  0)
  - rpmInitMacros(NULL, macrofiles);
  - macroArgv = argvFree(macroArgv);
  -}
  -}
  -#endif
  -
   int rpmReadConfigFiles(/*...@unused@*/ const char * file,
const char * target)
  - /*...@globals configTarget @*/
  + /*...@globals configTarget, rpmMacrofiles @*/
/*...@modifies configTarget @*/
   {
   mode_t mode = 0022;
   
  +#ifdef PREMACROFILES
  +if (rpmReadRC(PREMACROFILES)) return -1;
  +#endif
  +
   /* Reset umask to its default umask(2) value. */
   mode = umask(mode);
   
  @@ -1133,7 +1110,7 @@
   
   /* Read the files */
   /*...@-globs@*/
  -if (rpmReadRC()) return -1;
  +if (rpmReadRC(rpmMacrofiles)) return -1;
   /*...@=globs@*/
   
   /* Reset target macros */
  @@ -1142,9 +1119,6 @@
   
   /* Finally set target platform */
   {const char *cpu = rpmExpand(%{_target_cpu}, NULL);
  -#if defined(WITH_CPUINFO)
  - rpmRereadTargetMacros(cpu);
  -#endif
const char *os = rpmExpand(%{_target_os}, NULL);
rpmSetMachine(cpu, os);
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2009-05-03 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:   03-May-2009 19:02:11
  Branch: HEAD Handle: 2009050317021100

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
cpuinfo: change delimiter for %_prefer_buildarchs from ':' to ' '

  Summary:
RevisionChanges Path
1.2965  +1  -0  rpm/CHANGES
2.274   +1  -1  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2964 -r1.2965 CHANGES
  --- rpm/CHANGES   3 May 2009 16:57:33 -   1.2964
  +++ rpm/CHANGES   3 May 2009 17:02:11 -   1.2965
  @@ -1,5 +1,6 @@
   
   5.2a4 - 5.2b1:
  +- proyvind: cpuinfo: change delimiter for %_prefer_buildarchs from ':' 
to ' '.
   - jbj: js: add AutoFu to build --with-js=internal.
   - jbj: ruby: fix: global interpreter with contained object refcnts needs
early cleanup in rpmcliFini(), not in rpmioClean().
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.273 -r2.274 rpmrc.c
  --- rpm/lib/rpmrc.c   2 May 2009 13:29:34 -   2.273
  +++ rpm/lib/rpmrc.c   3 May 2009 17:02:11 -   2.274
  @@ -862,7 +862,7 @@
ARGV_t archs = NULL;
char *pref = rpmExpand(%{?_prefer_buildarchs}, NULL);
   
  - (void) argvSplit(archs, pref, :);
  + (void) argvSplit(archs, pref,  );
for(i = 0, n = argvCount(archs); (i  n  !*name); i++)
if((j = rpmPlatformScore(archs[i], platpat, nplatpat))  0)
*name = ((miRE)platpat)[j-1].pattern;
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2009-05-03 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:   03-May-2009 19:09:01
  Branch: HEAD Handle: 2009050317090001

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
cpuinfo: change name of '%_prefer_buildarchs' macro to
'%_prefer_targetarchs'.

  Summary:
RevisionChanges Path
1.2966  +1  -0  rpm/CHANGES
2.275   +1  -1  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2965 -r1.2966 CHANGES
  --- rpm/CHANGES   3 May 2009 17:02:11 -   1.2965
  +++ rpm/CHANGES   3 May 2009 17:09:01 -   1.2966
  @@ -1,5 +1,6 @@
   
   5.2a4 - 5.2b1:
  +- proyvind: cpuinfo: change name of '%_prefer_buildarchs' macro to 
'%_prefer_targetarchs'.
   - proyvind: cpuinfo: change delimiter for %_prefer_buildarchs from ':' 
to ' '.
   - jbj: js: add AutoFu to build --with-js=internal.
   - jbj: ruby: fix: global interpreter with contained object refcnts needs
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.274 -r2.275 rpmrc.c
  --- rpm/lib/rpmrc.c   3 May 2009 17:02:11 -   2.274
  +++ rpm/lib/rpmrc.c   3 May 2009 17:09:00 -   2.275
  @@ -860,7 +860,7 @@
{
int i, j, n;
ARGV_t archs = NULL;
  - char *pref = rpmExpand(%{?_prefer_buildarchs}, NULL);
  + char *pref = rpmExpand(%{?_prefer_targetarchs}, NULL);
   
(void) argvSplit(archs, pref,  );
for(i = 0, n = argvCount(archs); (i  n  !*name); i++)
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2009-03-18 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:   19-Mar-2009 01:20:18
  Branch: HEAD Handle: 2009031900201701

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
libcpuinfo may now return 64bit feature only if PER_LINUX_32BIT 
personality
isn't set, so don't check un.machine anymore.

  Summary:
RevisionChanges Path
1.2843  +2  -0  rpm/CHANGES
2.269   +4  -5  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2842 -r1.2843 CHANGES
  --- rpm/CHANGES   18 Mar 2009 23:23:55 -  1.2842
  +++ rpm/CHANGES   19 Mar 2009 00:20:17 -  1.2843
  @@ -1,5 +1,7 @@
   
   5.2a3 - 5.2a4:
  +- proyvind: libcpuinfo may now return 64bit feature only if 
PER_LINUX_32BIT
  + personality isn't set, so don't check un.machine anymore.
   - jbj: yarn: convert rpmtsi refcount to usage mutex.
   - jbj: yarn: convert rpmsx refcount to usage mutex.
   - jbj: yarn: convert rpmps refcount to usage mutex.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.268 -r2.269 rpmrc.c
  --- rpm/lib/rpmrc.c   17 Mar 2009 16:32:16 -  2.268
  +++ rpm/lib/rpmrc.c   19 Mar 2009 00:20:18 -  2.269
  @@ -514,7 +514,6 @@
   static rpmRC rpmCpuinfo(void)
   {
   rpmRC rc = RPMRC_FAIL;
  -static struct utsname un;
   const char *cpu;
   miRE mi_re = NULL;
   int mi_nre = 0;
  @@ -522,11 +521,10 @@
   CVOG_t cvog = NULL;
   rpmds cpuinfo = NULL;
   
  -uname(un);
   xx = rpmdsCpuinfo(cpuinfo, NULL);
   
   if(rpmCpuinfoMatch(cpuinfo([x86]), cpuinfo)) {
  - if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo)  strcmp(un.machine, 
x86_64) == 0)
  + if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo))
{
xx = mireAppend(RPMMIRE_REGEX, 0, x86_64, NULL, mi_re, mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, amd64, NULL, mi_re, mi_nre);
  @@ -555,7 +553,7 @@
   }
   
   if(rpmCpuinfoMatch(cpuinfo([ppc]), cpuinfo)) {
  - if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo)  strcmp(un.machine, 
ppc64) == 0)
  + if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, ppc64, NULL, mi_re, mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, ppc, NULL, mi_re, mi_nre);
xx = mireAppend(RPMMIRE_REGEX, 0, fat, NULL, mi_re, mi_nre);
  @@ -565,6 +563,7 @@
xx = mireAppend(RPMMIRE_REGEX, 0, ia64, NULL, mi_re, mi_nre);
   
   #if defined(__mips__)
  +/* XXX: Better ways to determine endianness? */
   #if defined(__MIPSEL__)
   #define mips32 mipsel
   #define mips64 mips64el
  @@ -573,7 +572,7 @@
   #define mips64 mips64
   #endif
   /* XXX: libcpuinfo only have irix support for now.. */
  -if(strcmp(un.machine, mips64) == 0)
  +if(rpmCpuinfoMatch(cpuinfo(64bit), cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, mips64, NULL, mi_re, mi_nre);
   xx = mireAppend(RPMMIRE_REGEX, 0, mips32, NULL, mi_re, mi_nre);
   #endif
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2009-03-16 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:   16-Mar-2009 22:44:38
  Branch: HEAD Handle: 2009031621443700

  Modified files:
rpm CHANGES macros.in
rpm/lib rpmrc.c

  Log:
change default %_topdir to $HOME/rpmbuild.

  Summary:
RevisionChanges Path
1.2824  +1  -0  rpm/CHANGES
2.266   +1  -1  rpm/lib/rpmrc.c
1.279   +2  -2  rpm/macros.in
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2823 -r1.2824 CHANGES
  --- rpm/CHANGES   16 Mar 2009 21:38:52 -  1.2823
  +++ rpm/CHANGES   16 Mar 2009 21:44:37 -  1.2824
  @@ -1,5 +1,6 @@
   
   5.2a3 - 5.2a4:
  +- proyvind: change default %_topdir to $HOME/rpmbuild.
   - proyvind: change %buildroot to 
%{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
to make it more unique and informative.
   - proyvind: do lazy mkdir of %_builddir, %_rpmdir  %_srcrpmdir when 
doing
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.265 -r2.266 rpmrc.c
  --- rpm/lib/rpmrc.c   14 Mar 2009 17:19:20 -  2.265
  +++ rpm/lib/rpmrc.c   16 Mar 2009 21:44:37 -  2.266
  @@ -325,7 +325,7 @@
   addMacro(NULL, ___build_pre, NULL, ___build_pre, RMIL_DEFAULT);
   
   addMacroDefault(_topdir,
  - %{_usr}/src/rpm,  NULL);
  + %{_usr}/src/rpm,  %(echo $HOME)/rpmbuild);
   addMacroDefault(_tmppath,
%{_var}/tmp,  NULL);
   addMacroDefault(_dbpath,
  @@ .
  patch -p0 '@@ .'
  Index: rpm/macros.in
  
  $ cvs diff -u -r1.278 -r1.279 macros.in
  --- rpm/macros.in 16 Mar 2009 21:38:52 -  1.278
  +++ rpm/macros.in 16 Mar 2009 21:44:37 -  1.279
  @@ -1,7 +1,7 @@
   #/*! \page config_macros Default configuration: @USRLIBRPM@/macros
   # \verbatim
   #
  -# $Id: macros.in,v 1.278 2009/03/16 21:38:52 pkarlsen Exp $
  +# $Id: macros.in,v 1.279 2009/03/16 21:44:37 pkarlsen Exp $
   #
   # This is a global RPM configuration file. All changes made here will
   # be lost when the rpm package is upgraded. Any per-system configuration
  @@ -254,7 +254,7 @@
   %tmpdir  %{_tmppath}
   
   #Path to top of build area.
  -%_topdir @PKGSRCDIR_MACRO@
  +%_topdir %(echo $HOME)/rpmbuild
   
   
#==
   #  Optional macros.
  @@ .
__
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:   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


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

2009-03-09 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:   10-Mar-2009 00:39:10
  Branch: HEAD Handle: 2009030923390901

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
fix order of archs added throuh libcpuinfo so that rpmPlatformScore() will
return correct value.

  Summary:
RevisionChanges Path
1.2810  +2  -0  rpm/CHANGES
2.252   +27 -23 rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2809 -r1.2810 CHANGES
  --- rpm/CHANGES   7 Mar 2009 14:00:46 -   1.2809
  +++ rpm/CHANGES   9 Mar 2009 23:39:09 -   1.2810
  @@ -1,5 +1,7 @@
   
   5.2a3 - 5.2a4:
  +- proyvind: fix order of archs added throuh libcpuinfo so that
  + rpmPlatformScore() will return correct value.
   
   5.2a2 - 5.2a3:
   - rse: use Pthreads under --with-pthreads controlled WITH_PTHREADS and 
not pthreads.h existance-derived HAVE_PTHREADS_H 
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.251 -r2.252 rpmrc.c
  --- rpm/lib/rpmrc.c   17 Feb 2009 21:25:06 -  2.251
  +++ rpm/lib/rpmrc.c   9 Mar 2009 23:39:10 -   2.252
  @@ -515,36 +515,38 @@
   uname(un);
   cpuinfo_t *cip = cpuinfo_new();
   
  -xx = mireAppend(RPMMIRE_REGEX, 0, noarch, NULL, mi_re, mi_nre);
  -
   #if defined(__i386__) || defined(__x86_64__)
  -if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86))
  - xx = mireAppend(RPMMIRE_REGEX, 0, i386, NULL, mi_re, mi_nre);
  -if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_AC))
  - xx = mireAppend(RPMMIRE_REGEX, 0, i486, NULL, mi_re, mi_nre);
  -if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_TSC))
  - xx = mireAppend(RPMMIRE_REGEX, 0, i586, NULL, mi_re, mi_nre);
  -if(cpuinfo_get_vendor(cip) == CPUINFO_VENDOR_NSC)
  - xx = mireAppend(RPMMIRE_REGEX, 0, geode, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_64BIT)  strcmp(un.machine, 
x86_64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, x86_64, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_SSE2))
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium4, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_SSE))
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium3, NULL, mi_re, mi_nre);
  +if(cpuinfo_get_vendor(cip) == CPUINFO_FEATURE_X86_3DNOW_PLUS)
  + xx = mireAppend(RPMMIRE_REGEX, 0, athlon, NULL, mi_re, mi_nre);
   if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_CMOV))
  - xx = mireAppend(RPMMIRE_REGEX, 0, i686, NULL, mi_re, mi_nre);
  +{
if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_MMX))
xx = mireAppend(RPMMIRE_REGEX, 0, pentium2, NULL, mi_re, 
mi_nre);
  -if(cpuinfo_get_vendor(cip) == CPUINFO_VENDOR_AMD  
cpuinfo_get_vendor(cip) == CPUINFO_FEATURE_X86_3DNOW_PLUS)
  - xx = mireAppend(RPMMIRE_REGEX, 0, athlon, NULL, mi_re, mi_nre);
  -if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_SSE))
  - xx = mireAppend(RPMMIRE_REGEX, 0, pentium3, NULL, mi_re, mi_nre);
  -if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_SSE2))
  - xx = mireAppend(RPMMIRE_REGEX, 0, pentium4, NULL, mi_re, mi_nre);
  -if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_64BIT)  strcmp(un.machine, 
x86_64) == 0)
  - xx = mireAppend(RPMMIRE_REGEX, 0, x86_64, NULL, mi_re, mi_nre);
  + xx = mireAppend(RPMMIRE_REGEX, 0, i686, NULL, mi_re, mi_nre);
  +}
  +if(cpuinfo_get_vendor(cip) == CPUINFO_FEATURE_X86_3DNOW)
  + xx = mireAppend(RPMMIRE_REGEX, 0, k6, NULL, mi_re, mi_nre);
  +if(cpuinfo_get_vendor(cip) == CPUINFO_VENDOR_NSC)
  + xx = mireAppend(RPMMIRE_REGEX, 0, geode, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_TSC))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i586, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_AC))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i486, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i386, NULL, mi_re, mi_nre);
   #endif
   
   #if defined(__powerpc__)
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_64BIT)  strcmp(un.machine, 
ppc64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, ppc64, NULL, mi_re, mi_nre);
   if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_PPC))
xx = mireAppend(RPMMIRE_REGEX, 0, ppc, NULL, mi_re, mi_nre);
  - 

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

2009-02-14 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:   15-Feb-2009 01:31:37
  Branch: HEAD Handle: 2009021500313601

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
add initial support for detecting automatically detecting architecture 
through
libcpuinfo. (more work needed!)

  Summary:
RevisionChanges Path
1.2774  +2  -0  rpm/CHANGES
2.250   +92 -0  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2773 -r1.2774 CHANGES
  --- rpm/CHANGES   11 Feb 2009 16:59:28 -  1.2773
  +++ rpm/CHANGES   15 Feb 2009 00:31:36 -  1.2774
  @@ -1,5 +1,7 @@
   
   5.2a2 - 5.2a3:
  +- proyvind: add initial support for detecting automatically detecting
  + architecture through libcpuinfo.
   - jbj: stub-in /usr/lib/rpm/helpers/makeshlibs proof-of-concept.
   - proyvind: add %mips  %mipsx macros for mips archictecture.
   - jbj: add rpmdsNSType() to -lrpm loader map.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.249 -r2.250 rpmrc.c
  --- rpm/lib/rpmrc.c   9 Nov 2008 13:58:16 -   2.249
  +++ rpm/lib/rpmrc.c   15 Feb 2009 00:31:37 -  2.250
  @@ -8,6 +8,10 @@
   #define __power_pc() 0
   #endif
   
  +#if defined(HAVE_CPUINFO_H)
  +#include cpuinfo.h
  +#endif
  +
   #define  _RPMIOB_INTERNAL/* XXX for rpmiobSlurp */
   #include rpmio.h
   #include rpmcb.h
  @@ -498,6 +502,92 @@
   }
   /*...@=onlytrans@*/
   
  +#if defined(HAVE_CPUINFO_H)
  +static rpmRC rpmCpuinfo(void)
  +{
  +rpmRC rc = RPMRC_FAIL;
  +static struct utsname un;
  +const char *cpu;
  +miRE mi_re = NULL;
  +int mi_nre = 0;
  +int xx;
  +CVOG_t cvog = NULL;
  +uname(un);
  +cpuinfo_t *cip = cpuinfo_new();
  +
  +xx = mireAppend(RPMMIRE_REGEX, 0, noarch, NULL, mi_re, mi_nre);
  +
  +#if defined(__i386__) || defined(__x86_64__)
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i386, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_AC))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i486, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_TSC))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i586, NULL, mi_re, mi_nre);
  +if(cpuinfo_get_vendor(cip) == CPUINFO_VENDOR_NSC)
  + xx = mireAppend(RPMMIRE_REGEX, 0, geode, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_CMOV))
  + xx = mireAppend(RPMMIRE_REGEX, 0, i686, NULL, mi_re, mi_nre);
  + if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_MMX))
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium2, NULL, mi_re, 
mi_nre);
  +if(cpuinfo_get_vendor(cip) == CPUINFO_VENDOR_AMD  
cpuinfo_get_vendor(cip) == CPUINFO_FEATURE_X86_3DNOW_PLUS)
  + xx = mireAppend(RPMMIRE_REGEX, 0, athlon, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_SSE))
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium3, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_X86_SSE2))
  + xx = mireAppend(RPMMIRE_REGEX, 0, pentium4, NULL, mi_re, mi_nre);
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_64BIT)  strcmp(un.machine, 
x86_64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, x86_64, NULL, mi_re, mi_nre);
  +#endif
  +
  +#if defined(__powerpc__)
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_PPC))
  + xx = mireAppend(RPMMIRE_REGEX, 0, ppc, NULL, mi_re, mi_nre);
  + if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_64BIT)  
strcmp(un.machine, ppc64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, ppc64, NULL, mi_re, mi_nre);
  +#endif
  +
  +#if defined(__ia64__)
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_IA64))
  + xx = mireAppend(RPMMIRE_REGEX, 0, ia64, NULL, mi_re, mi_nre);
  +#endif
  +
  +#if defined(__mips__)
  +#if defined(__MIPSEL__)
  +#define mips32 mipsel
  +#define mips64 mips64el
  +#elif define(__MIPSEB__)
  +#define mips32 mips
  +#define mips64 mips64
  +#endif
  +if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_MIPS)) {
  + xx = mireAppend(RPMMIRE_REGEX, 0, mips32, NULL, mi_re, mi_nre);
  + if(cpuinfo_has_feature(cip, CPUINFO_FEATURE_64BIT)  
strcmp(un.machine, mips64) == 0)
  + xx = mireAppend(RPMMIRE_REGEX, 0, mips64, NULL, mi_re, mi_nre);
  +#endif
  +
  +cpuinfo_destroy(cip);
  +
  +cpu = 

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c rpm/rpmio/ librpmio.vers rpml...

2008-10-26 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:   27-Oct-2008 05:05:22
  Branch: HEAD Handle: 2008102704052100

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/rpmio   librpmio.vers rpmlua.c rpmlua.h

  Log:
- jbj: lua: display rudimentary info about lua with --showrc.

  Summary:
RevisionChanges Path
1.2630  +1  -0  rpm/CHANGES
2.248   +14 -1  rpm/lib/rpmrc.c
2.77+2  -0  rpm/rpmio/librpmio.vers
2.59+6  -3  rpm/rpmio/rpmlua.c
2.14+6  -0  rpm/rpmio/rpmlua.h
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2629 -r1.2630 CHANGES
  --- rpm/CHANGES   27 Oct 2008 03:01:37 -  1.2629
  +++ rpm/CHANGES   27 Oct 2008 04:05:21 -  1.2630
  @@ -1,5 +1,6 @@
   
   5.2a2 - 5.2a3:
  +- jbj: lua: display rudimentary info about lua with --showrc.
   - jbj: lua: preload crypto in rpmlua.c.
   - jbj: lua: lom.lua has requires(lxp), so preload lxp in rpmlua.c.
   - jbj: WRlua: preserve forward linkage by avoiding vmefail/get_date.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.247 -r2.248 rpmrc.c
  --- rpm/lib/rpmrc.c   22 Aug 2008 04:45:44 -  2.247
  +++ rpm/lib/rpmrc.c   27 Oct 2008 04:05:21 -  2.248
  @@ -1010,10 +1010,23 @@
   {const char * s = rpmExpand(%{?optflags}, NULL);
fprintf(fp, %-21s : %s\n, optflags, ((s  *s) ? s : (not set)));
s = _free(s);
  +
  + fprintf(fp, \nLUA MODULES:\n);
   /[EMAIL PROTECTED]@*/
  - s = rpmExpand(rpmMacrofiles, NULL);
  + s = rpmExpand(rpmluaFiles, NULL);
  +/[EMAIL PROTECTED]@*/
  + fprintf(fp, %-21s : %s\n, luafiles, ((s  *s) ? s : (not set)));
  + s = _free(s);
  +/[EMAIL PROTECTED]@*/
  + s = rpmExpand(rpmluaPath, NULL);
   /[EMAIL PROTECTED]@*/
  + fprintf(fp, %-21s : %s\n, luapath, ((s  *s) ? s : (not set)));
  + s = _free(s);
  +
fprintf(fp, \nMACRO DEFINITIONS:\n);
  +/[EMAIL PROTECTED]@*/
  + s = rpmExpand(rpmMacrofiles, NULL);
  +/[EMAIL PROTECTED]@*/
fprintf(fp, %-21s : %s\n, macrofiles, ((s  *s) ? s : (not 
set)));
s = _free(s);
   }
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/librpmio.vers
  
  $ cvs diff -u -r2.76 -r2.77 librpmio.vers
  --- rpm/rpmio/librpmio.vers   22 Sep 2008 01:56:35 -  2.76
  +++ rpm/rpmio/librpmio.vers   27 Oct 2008 04:05:21 -  2.77
  @@ -337,6 +337,8 @@
   rpmlogGetCallback;
   rpmlogSetFile;
   rpmlogSetMask;
  +rpmluaFiles;
  +rpmluaPath;
   rpmluaCheckScript;
   rpmluaDelVar;
   rpmluaFiles;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmlua.c
  
  $ cvs diff -u -r2.58 -r2.59 rpmlua.c
  --- rpm/rpmio/rpmlua.c27 Oct 2008 03:01:37 -  2.58
  +++ rpm/rpmio/rpmlua.c27 Oct 2008 04:05:21 -  2.59
  @@ -59,7 +59,10 @@
/[EMAIL PROTECTED] L, fileSystem @*/;
   
   /[EMAIL PROTECTED]@*/
  -const char *rpmluaFiles = RPMLUAFILES;
  +const char * rpmluaFiles = RPMLUAFILES;
  +
  +/[EMAIL PROTECTED]@*/
  +const char * rpmluaPath = %{?_rpmhome}%{!?_rpmhome: USRLIBRPM 
}/lua/?.lua;
   
   rpmlua rpmluaGetGlobalState(void)
   {
  @@ -114,8 +117,8 @@
lua_call(L, 1, 0);
   /[EMAIL PROTECTED]@*/
   }
  -{const char * _lua_path = rpmGetPath(%{?_rpmhome}%{!?_rpmhome: 
USRLIBRPM }, /lua/?.lua, NULL);
  - if (_lua_path != NULL) {
  +{const char * _lua_path = rpmGetPath(rpmluaPath, NULL);
  + if (_lua_path != NULL) {
lua_pushliteral(L, LUA_PATH);
lua_pushstring(L, _lua_path);
_lua_path = _free(_lua_path);
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/rpmlua.h
  
  $ cvs diff -u -r2.13 -r2.14 rpmlua.h
  --- rpm/rpmio/rpmlua.h2 Aug 2008 22:37:39 -   2.13
  +++ rpm/rpmio/rpmlua.h27 Oct 2008 04:05:21 -  2.14
  @@ -47,6 +47,12 @@
   extern C {
   #endif
   
  +/[EMAIL PROTECTED]@*/
  +extern const char * rpmluaFiles;
  +
  +/[EMAIL PROTECTED]@*/
  +extern const char * rpmluaPath;
  +
   /[EMAIL PROTECTED]@*/
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/
   rpmlua 

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

2008-08-19 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:   19-Aug-2008 16:46:28
  Branch: HEAD Handle: 2008081914462701

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
- jbj: display sysinfo path with --showrc.

  Summary:
RevisionChanges Path
1.2529  +1  -0  rpm/CHANGES
2.245   +2  -1  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2528 -r1.2529 CHANGES
  --- rpm/CHANGES   18 Aug 2008 23:29:27 -  1.2528
  +++ rpm/CHANGES   19 Aug 2008 14:46:27 -  1.2529
  @@ -1,5 +1,6 @@
   
   5.1.0 - 5.2a0:
  +- jbj: display sysinfo path with --showrc.
   - jbj: remove internal zlib.
   - jbj: WR: eliminate most compiler warnings.
   - jbj: WR: eliminate duplicated AutoFu boilerplate, use system.h instead.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.244 -r2.245 rpmrc.c
  --- rpm/lib/rpmrc.c   17 Aug 2008 20:43:58 -  2.244
  +++ rpm/lib/rpmrc.c   19 Aug 2008 14:46:28 -  2.245
  @@ -1016,7 +1016,8 @@
xx = rpmdsSysinfo(PRCO, NULL);
ds = rpmdsFromPRCO(PRCO, RPMTAG_PROVIDENAME);
if (ds != NULL) {
  - fprintf(fp, _(Configured system provides (from 
/etc/rpm/sysinfo):\n));
  + const char * fn = (_sysinfo_path ? _sysinfo_path : 
/etc/rpm/sysinfo);
  + fprintf(fp, _(Configured system provides (from %s):\n), fn);
ds = rpmdsInit(ds);
while (rpmdsNext(ds) = 0) {
const char * DNEVR = rpmdsDNEVR(ds);
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c rpm/tests/ Makefile.am macros...

2008-06-06 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:   06-Jun-2008 19:25:31
  Branch: HEAD Handle: 2008060617252901

  Added files:
rpm/tests/ref   querytags showrc version
  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/tests   Makefile.am macros.in
rpm/tests/ref   .alldigests

  Log:
- tests: verify setup using --version/--querytags/--showrc.
- display noisy getconf()/uname() info with -vv --showrc instead.

  Summary:
RevisionChanges Path
1.2399  +2  -0  rpm/CHANGES
2.235   +2  -0  rpm/lib/rpmrc.c
1.18+12 -7  rpm/tests/Makefile.am
1.17+11 -5  rpm/tests/macros.in
1.2 +57 -0  rpm/tests/ref/.alldigests
1.1 +204 -0 rpm/tests/ref/querytags
1.1 +657 -0 rpm/tests/ref/showrc
1.1 +2  -0  rpm/tests/ref/version
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2398 -r1.2399 CHANGES
  --- rpm/CHANGES   6 Jun 2008 14:32:05 -   1.2398
  +++ rpm/CHANGES   6 Jun 2008 17:25:29 -   1.2399
  @@ -1,5 +1,7 @@
   
   5.1.0 - 5.2a0:
  +- jbj: tests: verify setup using --version/--querytags/--showrc.
  +- jbj: display noisy getconf()/uname() info with -vv --showrc instead.
   - jbj: shorten debugging messages, --queryformat strings passed to
headerSprintf are getting huge.
   - jbj: fix: NUL terminate dst on EXPR-ARRAY parser state transition
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.234 -r2.235 rpmrc.c
  --- rpm/lib/rpmrc.c   2 Apr 2008 18:35:26 -   2.234
  +++ rpm/lib/rpmrc.c   6 Jun 2008 17:25:30 -   2.235
  @@ -1011,7 +1011,9 @@
ds = rpmdsFree(ds);
fprintf(fp, \n);
}
  +}
   
  +if (rpmIsDebug()) {
xx = rpmdsGetconf(ds, NULL);
if (ds != NULL) {
fprintf(fp,
  @@ .
  patch -p0 '@@ .'
  Index: rpm/tests/Makefile.am
  
  $ cvs diff -u -r1.17 -r1.18 Makefile.am
  --- rpm/tests/Makefile.am 2 Jun 2008 21:00:47 -   1.17
  +++ rpm/tests/Makefile.am 6 Jun 2008 17:25:30 -   1.18
  @@ -5,7 +5,7 @@
   EXTRA_DIST = ref/*
   SUBDIRS =
   
  -macros = $(abs_top_builddir)/macros:@testdir@/macros
  +macros = $(abs_top_builddir)/macros:$(testdir)/macros
   rpm =$(abs_top_builddir)/rpm --macros $(macros)
   rpm2cpio =   $(abs_top_builddir)/tools/rpm2cpio
   rpmdigest =  $(abs_top_builddir)/tools/rpmdigest
  @@ -13,6 +13,16 @@
   rpmrepo =$(abs_top_builddir)/tools/rpmrepo
   cpio =   cpio
   
  +.PHONY:  check-init
  +check-init: macros
  + @mkdir -p tmp/repackage/
  + @${rpm} -v --version tmp/version
  + [EMAIL PROTECTED] -u {tmp,ref}/version
  + @${rpm} -v --querytags   tmp/querytags
  + [EMAIL PROTECTED] -u {tmp,ref}/querytags
  + @${rpm} -v --showrc | sed -e s,$(abs_top_builddir),..,g  tmp/showrc
  + [EMAIL PROTECTED] -u {tmp,ref}/showrc
  +
   POPTURI =http://rpm5.org/files/popt/
   POPTPKGS =   \
popt-1.14-1.src.rpm \
  @@ -23,7 +33,6 @@
   
   .PHONY:  check-markup
   check-markup: $(POPTPKGS)
  - @mkdir -p tmp
@-${rpmdigest} --alldigests ref/[a-z]*  tmp/.alldigests
@diff -u {tmp,ref}/.alldigests
@${rpmmtree} -c -p ref | ${rpmmtree} -p ref
  @@ -55,11 +64,7 @@
${rpm} -i --nosignature --nodeps [EMAIL PROTECTED]
(cd $@  ${rpm} -q --specfile [EMAIL PROTECTED]  ${rpm} -q 
--specsrpm [EMAIL PROTECTED]  ${rpm} -q --specfile --specedit [EMAIL 
PROTECTED]  ${rpm} -bb --nodeps [EMAIL PROTECTED])  /dev/null
   
  -check-local: check-markup $(BUILD_DIRS)
  - @${rpm} -v --version  /dev/null
  - @${rpm} -v --showrc  /dev/null
  - @${rpm} -v --querytags  /dev/null
  - @-rm -rf rpm
  +check-local: check-init check-markup $(BUILD_DIRS)
@${rpm} --initdb
@${rpm} --import $(top_srcdir)/pubkeys/JBJ-GPG-KEY
@${rpm} -qW .  /dev/null 21
  @@ .
  patch -p0 '@@ .'
  Index: rpm/tests/macros.in
  
  $ cvs diff -u -r1.16 -r1.17 macros.in
  --- rpm/tests/macros.in   7 May 2008 16:58:26 -   1.16
  +++ rpm/tests/macros.in   6 Jun 2008 17:25:30 -   1.17
  @@ -1,4 +1,7 @@
  -%_topdir  

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c rpm/rpmio/ librpmio.vers mire...

2008-02-15 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:   15-Feb-2008 20:04:38
  Branch: HEAD Handle: 2008021519043700

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/rpmio   librpmio.vers mire.c mire.h rpmgrep.c

  Log:
- mire: add mireApply() and mireFreeAll() routines.

  Summary:
RevisionChanges Path
1.2180  +1  -0  rpm/CHANGES
2.225   +0  -21 rpm/lib/rpmrc.c
2.39+2  -0  rpm/rpmio/librpmio.vers
1.21+36 -0  rpm/rpmio/mire.c
1.13+22 -0  rpm/rpmio/mire.h
1.44+0  -51 rpm/rpmio/rpmgrep.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2179 -r1.2180 CHANGES
  --- rpm/CHANGES   15 Feb 2008 17:01:24 -  1.2179
  +++ rpm/CHANGES   15 Feb 2008 19:04:37 -  1.2180
  @@ -1,4 +1,5 @@
   5.0.0 - 5.1a1:
  +- jbj: mire: add mireApply() and mireFreeAll() routines.
   - jbj: rpmgrep: attempt LZMA decompress with .lzma suffix.
   - jbj: rpmgrep: apply multiple --include/--exclude patterns to paths.
   - jbj: rpmgrep: permit multiple --file, --exclude, and --include options.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.224 -r2.225 rpmrc.c
  --- rpm/lib/rpmrc.c   10 Feb 2008 18:32:32 -  2.224
  +++ rpm/lib/rpmrc.c   15 Feb 2008 19:04:37 -  2.225
  @@ -378,27 +378,6 @@
   }
   
   /**
  - * Destroy platform patterns.
  - * @param mire   platform pattern array
  - * @param nreno of patterns in array
  - * @return   NULL always 
  - */
  -/[EMAIL PROTECTED]@*//* XXX miRE array, not refcounted. */
  -/[EMAIL PROTECTED]@*/
  -static void * mireFreeAll(/[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ miRE 
mire, int nre)
  - /[EMAIL PROTECTED] [EMAIL PROTECTED]/
  -{
  -if (mire != NULL) {
  - int i;
  - for (i = 0; i  nre; i++)
  - (void) mireClean(mire + i);
  - mire = _free(mire);
  -}
  -return NULL;
  -}
  -/[EMAIL PROTECTED]@*/
  -
  -/**
* Append pattern to array.
* @param mode   type of pattern match
* @param tagidentifier (like an rpmTag)
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/librpmio.vers
  
  $ cvs diff -u -r2.38 -r2.39 librpmio.vers
  --- rpm/rpmio/librpmio.vers   9 Feb 2008 23:12:33 -   2.38
  +++ rpm/rpmio/librpmio.vers   15 Feb 2008 19:04:37 -  2.39
  @@ -135,8 +135,10 @@
   lzdio;
   max_macro_depth;
   _mire_debug;
  +mireApply;
   mireClean;
   mireFree;
  +mireFreeAll;
   mireNew;
   mireRegexec;
   mireRegcomp;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/mire.c
  
  $ cvs diff -u -r1.20 -r1.21 mire.c
  --- rpm/rpmio/mire.c  11 Feb 2008 23:06:20 -  1.20
  +++ rpm/rpmio/mire.c  15 Feb 2008 19:04:37 -  1.21
  @@ -100,6 +100,19 @@
   return NULL;
   }
   
  +/[EMAIL PROTECTED]@*//* XXX miRE array, not refcounted. */
  +void * mireFreeAll(miRE mire, int nmire)
  +{
  +if (mire != NULL) {
  + int i;
  + for (i = 0; i  nmire; i++)
  + (void) mireClean(mire + i);
  + mire = _free(mire);
  +}
  +return NULL;
  +}
  +/[EMAIL PROTECTED]@*/
  +
   miRE mireNew(rpmMireMode mode, int tag)
   {
   miRE mire = xcalloc(1, sizeof(*mire));
  @@ -226,3 +239,26 @@
   /[EMAIL PROTECTED]@*/
   return rc;
   }
  +
  +int mireApply(miRE mire, int nmire, const char *s, size_t slen, int rc)
  +{
  +int i;
  +
  +if (slen == 0)
  + slen = strlen(s);
  +
  +if (mire)
  +for (i = 0; i  nmire; mire++, i++) {
  + int xx = mireRegexec(mire, s, slen);
  +
  + /* Check if excluding or including condition applies. */
  + if (rc  0  xx  0)
  + continue;   /* excluding: continue on negative matches. */
  + if (rc  0  xx = 0)
  + continue;   /* including: continue on positive matches. */
  + /* Save 1st found termination condition and exit. */
  + rc = xx;
  + break;
  +}
  +return rc;
  +}
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/mire.h
  
  $ cvs diff -u -r1.12 -r1.13 mire.h
  --- rpm/rpmio/mire.h  11 Feb 2008 00:30:29 -

[CVS] RPM: rpm/ CHANGES rpm/lib/ rpmrc.c rpm/rpmio/ librpmio.vers mire...

2008-02-15 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:   15-Feb-2008 20:37:12
  Branch: HEAD Handle: 2008021519371200

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/rpmio   librpmio.vers mire.c mire.h rpmgrep.c

  Log:
- jbj: mire: add mireAppend() routine.

  Summary:
RevisionChanges Path
1.2181  +1  -0  rpm/CHANGES
2.226   +2  -32 rpm/lib/rpmrc.c
2.40+1  -0  rpm/rpmio/librpmio.vers
1.22+18 -0  rpm/rpmio/mire.c
1.14+15 -0  rpm/rpmio/mire.h
1.45+6  -32 rpm/rpmio/rpmgrep.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2180 -r1.2181 CHANGES
  --- rpm/CHANGES   15 Feb 2008 19:04:37 -  1.2180
  +++ rpm/CHANGES   15 Feb 2008 19:37:12 -  1.2181
  @@ -1,4 +1,5 @@
   5.0.0 - 5.1a1:
  +- jbj: mire: add mireAppend() routine.
   - jbj: mire: add mireApply() and mireFreeAll() routines.
   - jbj: rpmgrep: attempt LZMA decompress with .lzma suffix.
   - jbj: rpmgrep: apply multiple --include/--exclude patterns to paths.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.225 -r2.226 rpmrc.c
  --- rpm/lib/rpmrc.c   15 Feb 2008 19:04:37 -  2.225
  +++ rpm/lib/rpmrc.c   15 Feb 2008 19:37:12 -  2.226
  @@ -378,36 +378,6 @@
   }
   
   /**
  - * Append pattern to array.
  - * @param mode   type of pattern match
  - * @param tagidentifier (like an rpmTag)
  - * @param patternpattern to compile
  - * @retval *mi_rep   platform pattern array
  - * @retval *mi_nrep  no. of patterns in array
  - */
  -/[EMAIL PROTECTED]@*//* XXX miRE array, not refcounted. */
  -/[EMAIL PROTECTED]@*/
  -static int mireAppend(rpmMireMode mode, int tag, const char * pattern,
  - miRE * mi_rep, int * mi_nrep)
  - /[EMAIL PROTECTED] *mi_rep, *mi_nrep @*/
  -{
  -miRE mire;
  -
  -mire = (*mi_rep);
  -/[EMAIL PROTECTED]@*/
  -mire = xrealloc(mire, ((*mi_nrep) + 1) * sizeof(*mire));
  -/[EMAIL PROTECTED]@*/
  -(*mi_rep) = mire;
  -mire += (*mi_nrep);
  -(*mi_nrep)++;
  -memset(mire, 0, sizeof(*mire));
  -mire-mode = mode;
  -mire-tag = tag;
  -return mireRegcomp(mire, pattern);
  -}
  -/[EMAIL PROTECTED]@*/
  -
  -/**
* Read and configure /etc/rpm/platform patterns.
* @param platform   path to platform patterns
* @return   RPMRC_OK on success
  @@ -452,7 +422,7 @@
while (--t  p  xisspace(*t))
*t = '\0';
if (t  p)
  - xx = mireAppend(RPMMIRE_REGEX, 0, p, mi_re, mi_nre);
  + xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, mi_re, mi_nre);
continue;
}
   
  @@ -470,7 +440,7 @@
(cvog  *cvog-gnu ? - : NULL),
(cvog ? cvog-gnu : NULL), NULL);
   #endif
  - xx = mireAppend(RPMMIRE_STRCMP, 0, p, mi_re, mi_nre);
  + xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, mi_re, mi_nre);
p = _free(p);

init_platform++;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/librpmio.vers
  
  $ cvs diff -u -r2.39 -r2.40 librpmio.vers
  --- rpm/rpmio/librpmio.vers   15 Feb 2008 19:04:37 -  2.39
  +++ rpm/rpmio/librpmio.vers   15 Feb 2008 19:37:12 -  2.40
  @@ -135,6 +135,7 @@
   lzdio;
   max_macro_depth;
   _mire_debug;
  +mireAppend;
   mireApply;
   mireClean;
   mireFree;
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/mire.c
  
  $ cvs diff -u -r1.21 -r1.22 mire.c
  --- rpm/rpmio/mire.c  15 Feb 2008 19:04:37 -  1.21
  +++ rpm/rpmio/mire.c  15 Feb 2008 19:37:12 -  1.22
  @@ -240,6 +240,24 @@
   return rc;
   }
   
  +/[EMAIL PROTECTED]@*//* XXX miRE array, not refcounted. */
  +int mireAppend(rpmMireMode mode, int tag, const char * pattern,
  + const unsigned char * table, miRE * mirep, int * nmirep)
  +{
  +/[EMAIL PROTECTED]@*/
  +miRE mire = xrealloc((*mirep), ((*nmirep) + 1) * sizeof(*mire));
  +/[EMAIL PROTECTED]@*/
  +
  +(*mirep) = mire;
  +mire += (*nmirep)++;
  +memset(mire, 0, sizeof(*mire));
  +mire-mode = mode;
  +mire-tag = tag;
  +mire-table = table;
  +return mireRegcomp(mire, 

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

2007-12-08 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:   08-Dec-2007 22:34:54
  Branch: HEAD Handle: 2007120821345300

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
- rpm.org: Yet More RPMRC_OK returns from functions.

  Summary:
RevisionChanges Path
1.1966  +1  -0  rpm/CHANGES
2.220   +8  -8  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1965 -r1.1966 CHANGES
  --- rpm/CHANGES   8 Dec 2007 21:30:19 -   1.1965
  +++ rpm/CHANGES   8 Dec 2007 21:34:53 -   1.1966
  @@ -1,4 +1,5 @@
   5.0a4 - 5.0b1:
  +- rpm.org: Yet More RPMRC_OK returns from functions.
   - rpm.org: use RPMRC_OK, not 0, returns in many functions.
   - rpm.org: @return, not @returns, in doxygen markup.
   - rpm.org: Don't do tilde expansion if HOME not set.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.219 -r2.220 rpmrc.c
  --- rpm/lib/rpmrc.c   6 Dec 2007 14:47:49 -   2.219
  +++ rpm/lib/rpmrc.c   8 Dec 2007 21:34:53 -   2.220
  @@ -430,10 +430,10 @@
   /**
* Read and configure /etc/rpm/platform patterns.
* @param platform   path to platform patterns
  - * @return   0 on success
  + * @return   RPMRC_OK on success
*/
   /[EMAIL PROTECTED]@*//* XXX miRE array, not refcounted. */
  -static int rpmPlatform(const char * platform)
  +static rpmRC rpmPlatform(const char * platform)
/[EMAIL PROTECTED] nplatpat, platpat,
rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/[EMAIL PROTECTED] nplatpat, platpat,
  @@ -446,13 +446,13 @@
   miRE mi_re = NULL;
   int mi_nre = 0;
   char * p, * pe;
  -int rc;
  +rpmRC rc;
   int xx;
   
   rc = rpmioSlurp(platform, b, blen);
   
   if (rc || b == NULL || blen = 0) {
  - rc = -1;
  + rc = RPMRC_FAIL;
goto exit;
   }
   
  @@ -495,7 +495,7 @@

init_platform++;
   }
  -rc = (init_platform ? 0 : -1);
  +rc = (init_platform ? RPMRC_OK : RPMRC_FAIL);
   
   exit:
   if (cvog) {
  @@ -505,7 +505,7 @@
   /[EMAIL PROTECTED]@*/
   b = _free(b);
   /[EMAIL PROTECTED]@*/
  -if (rc == 0) {
  +if (rc == RPMRC_OK) {
platpat = mireFreeAll(platpat, nplatpat);
platpat = mi_re;
nplatpat = mi_nre;
  @@ -608,9 +608,9 @@
cp = rpmExpand(%{?__platform}, NULL);
if (cp == NULL || cp[0] == '\0')
cp = platform;
  - if (!rpmPlatform(cp)) {
  + if (rpmPlatform(cp) == RPMRC_OK) {
   #else
  - if (!rpmPlatform(platform)) {
  + if (rpmPlatform(platform) == RPMRC_OK) {
   #endif
const char * s;
gotDefaults = 1;
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2007-11-09 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:   09-Nov-2007 22:23:51
  Branch: HEAD Handle: 2007110921235100

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
- rpm.org: Remove useless var parameter from setup helpers.

  Summary:
RevisionChanges Path
1.1785  +1  -0  rpm/CHANGES
2.215   +15 -16 rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1784 -r1.1785 CHANGES
  --- rpm/CHANGES   9 Nov 2007 21:18:43 -   1.1784
  +++ rpm/CHANGES   9 Nov 2007 21:23:51 -   1.1785
  @@ -1,4 +1,5 @@
   4.5 - 5.0:
  +- rpm.org: Remove useless var parameter from setup helpers.
   - rpm.org: Remove dead  unused RPMTAG_ARCHIVESIZE addition code ...
   - rpm.org: Remove rpmSetMachine() from API.
   - jbj: hmmm, headerGetExtension should not leak memory on failure. hack 
it.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.214 -r2.215 rpmrc.c
  --- rpm/lib/rpmrc.c   9 Nov 2007 21:15:45 -   2.214
  +++ rpm/lib/rpmrc.c   9 Nov 2007 21:23:51 -   2.215
  @@ -231,7 +231,7 @@
   return name;
   }
   
  -static void setVarDefault(/[EMAIL PROTECTED]@*/ int var, const char * 
macroname,
  +static void addMacroDefault(const char * macroname,
const char * val, /[EMAIL PROTECTED]@*/ const char * body)
/[EMAIL PROTECTED] rpmGlobalMacroContext, internalState @*/
/[EMAIL PROTECTED] rpmGlobalMacroContext, internalState @*/
  @@ -241,8 +241,7 @@
   addMacro(NULL, macroname, NULL, body, RMIL_DEFAULT);
   }
   
  -static void setPathDefault(/[EMAIL PROTECTED]@*/ int var, const char * 
macroname,
  - const char * subdir)
  +static void setPathDefault(const char * macroname, const char * subdir)
/[EMAIL PROTECTED] rpmGlobalMacroContext, h_errno, internalState @*/
/[EMAIL PROTECTED] rpmGlobalMacroContext, internalState @*/
   {
  @@ -285,30 +284,30 @@
   
   addMacro(NULL, ___build_pre, NULL, ___build_pre, RMIL_DEFAULT);
   
  -setVarDefault(-1,_topdir,
  +addMacroDefault(_topdir,
%{_usr}/src/rpm,  NULL);
  -setVarDefault(-1,_tmppath,
  +addMacroDefault(_tmppath,
%{_var}/tmp,  NULL);
  -setVarDefault(-1,_dbpath,
  +addMacroDefault(_dbpath,
%{_var}/lib/rpm,  NULL);
  -setVarDefault(-1,_defaultdocdir,
  +addMacroDefault(_defaultdocdir,
%{_usr}/share/doc,NULL);
   
  -setVarDefault(-1,_rpmfilename,
  +addMacroDefault(_rpmfilename,
%%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm,NULL);
   
  -setVarDefault(-1,optflags,
  +addMacroDefault(optflags,
-O2 -g,   NULL);
  -setVarDefault(-1,sigtype,
  +addMacroDefault(sigtype,
none, NULL);
  -setVarDefault(-1,_buildshell,
  +addMacroDefault(_buildshell,
/bin/sh,  NULL);
   
  -setPathDefault(-1,   _builddir,BUILD);
  -setPathDefault(-1,   _rpmdir,  RPMS);
  -setPathDefault(-1,   _srcrpmdir,   SRPMS);
  -setPathDefault(-1,   _sourcedir,   SOURCES);
  -setPathDefault(-1,   _specdir, SPECS);
  +setPathDefault(_builddir,  BUILD);
  +setPathDefault(_rpmdir,RPMS);
  +setPathDefault(_srcrpmdir, SRPMS);
  +setPathDefault(_sourcedir, SOURCES);
  +setPathDefault(_specdir,   SPECS);
   
   }
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2007-11-03 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:   03-Nov-2007 14:19:24
  Branch: HEAD Handle: 2007110313192201

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c
rpm/rpmdb   rpmdb.c
rpm/rpmio   macro.c rpmmacro.h

  Log:
- jbj: add a getter to retrieve macros with used and/or pattern filtering.
- jbj: macro macro table/element internals opaque.

  Summary:
RevisionChanges Path
1.1763  +2  -0  rpm/CHANGES
2.213   +1  -3  rpm/lib/rpmrc.c
1.197   +1  -1  rpm/rpmdb/rpmdb.c
2.148   +62 -1  rpm/rpmio/macro.c
2.41+24 -4  rpm/rpmio/rpmmacro.h
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1762 -r1.1763 CHANGES
  --- rpm/CHANGES   2 Nov 2007 03:07:46 -   1.1762
  +++ rpm/CHANGES   3 Nov 2007 13:19:22 -   1.1763
  @@ -1,4 +1,6 @@
   4.5 - 5.0:
  +- jbj: add a getter to retrieve macros with used and/or pattern 
filtering.
  +- jbj: macro macro table/element internals opaque.
   - jbj: fix --rebuilddb --root /path.
   - rse: fix linking of RPM against PCRE's POSIX API under --with-pcre
   - jbj: upgrade to F8  fix rpm-python. i18n tags w hdr_subscript are 
b0rked.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.212 -r2.213 rpmrc.c
  --- rpm/lib/rpmrc.c   6 Oct 2007 21:33:48 -   2.212
  +++ rpm/lib/rpmrc.c   3 Nov 2007 13:19:23 -   2.213
  @@ -8,15 +8,13 @@
   #define __power_pc() 0
   #endif
   
  +#define _MIRE_INTERNAL
   #include rpmio_internal.h /* for rpmioSlurp() */
   #include rpmcli.h
   #include rpmmacro.h
   #include rpmlua.h
   #include rpmds.h
   
  -#define _MIRE_INTERNAL
  -#include mire.h
  -
   #include misc.h
   #include debug.h
   
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmdb/rpmdb.c
  
  $ cvs diff -u -r1.196 -r1.197 rpmdb.c
  --- rpm/rpmdb/rpmdb.c 2 Nov 2007 03:07:46 -   1.196
  +++ rpm/rpmdb/rpmdb.c 3 Nov 2007 13:19:23 -   1.197
  @@ -11,6 +11,7 @@
   #include rpmio.h
   #include rpmpgp.h
   #include rpmurl.h
  +#define  _MIRE_INTERNAL
   #include rpmmacro.h
   #include rpmsq.h
   #include rpmtag.h
  @@ -27,7 +28,6 @@
   #endif
   
   #define  _RPMDB_INTERNAL
  -#define  _MIRE_INTERNAL
   #include rpmdb.h
   #include pkgio.h
   #include fprint.h
  @@ .
  patch -p0 '@@ .'
  Index: rpm/rpmio/macro.c
  
  $ cvs diff -u -r2.147 -r2.148 macro.c
  --- rpm/rpmio/macro.c 11 Oct 2007 13:04:28 -  2.147
  +++ rpm/rpmio/macro.c 3 Nov 2007 13:19:23 -   2.148
  @@ -68,6 +68,7 @@
   
   #endif
   
  +#define  _MACRO_INTERNAL
   #include rpmmacro.h
   
   #include debug.h
  @@ -201,7 +202,7 @@
   if (mc == NULL || mc-macroTable == NULL)
return;
   
  -qsort(mc-macroTable, mc-firstFree, sizeof(*(mc-macroTable)),
  +qsort(mc-macroTable, mc-firstFree, sizeof(mc-macroTable[0]),
compareMacroName);
   
   /* Empty pointers are now at end of table. Reset first free index. */
  @@ -213,6 +214,31 @@
   }
   }
   
  +static char * dupMacroEntry(MacroEntry me)
  +{
  +char * t, * te;
  +size_t nb;
  +
  +assert(me != NULL);
  +nb = strlen(me-name) + sizeof(%) - 1;
  +if (me-opts)
  + nb += strlen(me-opts) + sizeof(()) - 1;
  +if (me-body)
  + nb += strlen(me-body) + sizeof(\t) - 1;
  +nb++;
  +
  +te = t = xmalloc(nb);
  +*te = '\0';
  +te = stpcpy( stpcpy(te, %), me-name);
  +if (me-opts)
  + te = stpcpy( stpcpy( stpcpy(te, (), me-opts), ));
  +if (me-body)
  + te = stpcpy( stpcpy(te, \t), me-body);
  +*te = '\0';
  +
  +return t;
  +}
  +
   void
   rpmDumpMacroTable(MacroContext mc, FILE * fp)
   {
  @@ -246,6 +272,41 @@
nactive, nempty);
   }
   
  +int
  +rpmGetMacroEntries(MacroContext mc, miRE mire, int used,
  + const char *** avp)
  +{
  +const char ** av;
  +int ac;
  +int i;
  +
  +if (mc == NULL)
  + mc = rpmGlobalMacroContext;
  +
  +if (avp == NULL)
  + return mc-firstFree;
  +
  +av = xcalloc( (mc-firstFree+1), sizeof(mc-macroTable[0]));
  +if (mc-macroTable != NULL)
  +for (i = 0; i  mc-firstFree; i++) {
  + MacroEntry me;
  + me = mc-macroTable[i];

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

2007-07-11 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:   11-Jul-2007 13:22:22
  Branch: HEAD Handle: 200707111200

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
- set a default 0022 umask value always (#83006).

  Summary:
RevisionChanges Path
1.1454  +1  -1  rpm/CHANGES
2.207   +4  -0  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1453 -r1.1454 CHANGES
  --- rpm/CHANGES   10 Jul 2007 20:13:43 -  1.1453
  +++ rpm/CHANGES   11 Jul 2007 11:22:22 -  1.1454
  @@ -1,6 +1,6 @@
   4.5 - 5.0:
   - jbj: revert the _GetPass() hack-a-round.
  -- jbj: set a sane 0002 umask always (#83006).
  +- jbj: set a default 0022 umask value always (#83006).
   - rse: remove the already obsolete rpm.c
   - rse/jbj: eliminated all major compile-time warnings
   - rse: cleanup API by changing argument 2 of rpmDigestFinal() from void 
** to void *
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.206 -r2.207 rpmrc.c
  --- rpm/lib/rpmrc.c   10 Jul 2007 19:04:55 -  2.206
  +++ rpm/lib/rpmrc.c   11 Jul 2007 11:22:22 -  2.207
  @@ -851,6 +851,10 @@
/[EMAIL PROTECTED] configTarget @*/
/[EMAIL PROTECTED] configTarget @*/
   {
  +mode_t mode = 0022;
  +
  +/* Reset umask to its default umask(2) value. */
  +mode = umask(mode);
   
   configTarget = target;
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


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

2007-07-06 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:   06-Jul-2007 21:05:57
  Branch: HEAD Handle: 2007070620055700

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
- eliminate recursive parser helpers.

  Summary:
RevisionChanges Path
1.1440  +1  -0  rpm/CHANGES
2.202   +2  -541rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1439 -r1.1440 CHANGES
  --- rpm/CHANGES   6 Jul 2007 18:45:52 -   1.1439
  +++ rpm/CHANGES   6 Jul 2007 19:05:57 -   1.1440
  @@ -1,4 +1,5 @@
   4.5 - 5.0:
  +- jbj: eliminate recursive parser helpers.
   - jbj: expunge every occurence of Rcfiles.
   - jbj: eliminate rcfile reading everywhere.
   - jbj: eliminate last known internal usage of rpmrc files.
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.201 -r2.202 rpmrc.c
  --- rpm/lib/rpmrc.c   6 Jul 2007 18:22:05 -   2.201
  +++ rpm/lib/rpmrc.c   6 Jul 2007 19:05:57 -   2.202
  @@ -65,16 +65,6 @@
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ struct rpmvarValue * next;
   };
   
  -struct rpmOption {
  -const char * name;
  -int var;
  -int archSpecific;
  -/[EMAIL PROTECTED]@*/ int required;
  -int macroize;
  -int localize;
  -/[EMAIL PROTECTED]@*/ struct rpmOptionValue * value;
  -};
  -
   typedef struct defaultEntry_s {
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ const char * name;
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ const char * defName;
  @@ -110,26 +100,8 @@
   { buildarch, 0, 1 },
   { buildos, 0, 1 }
   };
  -
  -/* this *must* be kept in alphabetical order */
  -/* The order of the flags is archSpecific, required, macroize, localize */
  -
  -#define  RPMVAR_OPTFLAGS 3
  -#define  RPMVAR_INCLUDE  43
  -#define  RPMVAR_MACROFILES   49
  -
  -#define  RPMVAR_NUM  55  /* number of RPMVAR 
entries */
  -/[EMAIL PROTECTED]@*/
  -static struct rpmOption optionTable[] = {
  -{ include, RPMVAR_INCLUDE, 0, 1,   0, 2 },
  -{ macrofiles,  RPMVAR_MACROFILES,  0, 0,   0, 1 },
  -{ optflags,RPMVAR_OPTFLAGS,1, 0,   1, 0 },
  -};
   /[EMAIL PROTECTED]@*/
   
  -/[EMAIL PROTECTED]@*/
  -static int optionTableSize = sizeof(optionTable) / sizeof(*optionTable);
  -
   #define OS   0
   #define ARCH 1
   
  @@ -140,9 +112,6 @@
   static int currTables[2] = { RPM_MACHTABLE_INSTOS, RPM_MACHTABLE_INSTARCH };
   
   /[EMAIL PROTECTED]@*/
  -static struct rpmvarValue values[RPMVAR_NUM];
  -
  -/[EMAIL PROTECTED]@*/
   static int defaultsInitialized = 0;
   
   /* prototypes */
  @@ -151,13 +120,6 @@
/[EMAIL PROTECTED] *canontarget, rpmGlobalMacroContext,
fileSystem, internalState @*/;
   
  -static int optionCompare(const void * a, const void * b)
  - /[EMAIL PROTECTED]/
  -{
  -return xstrcasecmp(((struct rpmOption *) a)-name,
  -   ((struct rpmOption *) b)-name);
  -}
  -
   static /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ machCacheEntry
   machCacheFindEntry(const machCache cache, const char * key)
/[EMAIL PROTECTED]/
  @@ -170,76 +132,6 @@
   return NULL;
   }
   
  -static int machCompatCacheAdd(char * name, const char * fn, int linenum,
  - machCache cache)
  - /[EMAIL PROTECTED] internalState @*/
  - /[EMAIL PROTECTED] *name, cache-cache, cache-size, internalState @*/
  -{
  -machCacheEntry entry = NULL;
  -char * chptr;
  -char * equivs;
  -int delEntry = 0;
  -int i;
  -
  -while (*name  xisspace(*name)) name++;
  -
  -chptr = name;
  -while (*chptr  *chptr != ':') chptr++;
  -if (!*chptr) {
  - rpmError(RPMERR_RPMRC, _(missing second ':' at %s:%d\n), fn, linenum);
  - return 1;
  -} else if (chptr == name) {
  - rpmError(RPMERR_RPMRC, _(missing architecture name at %s:%d\n), fn,
  -  linenum);
  - return 1;
  -}
  -
  -while (*chptr == ':' || xisspace(*chptr)) chptr--;
  -*(++chptr) = '\0';
  -equivs = chptr + 1;
  -while (*equivs  xisspace(*equivs)) equivs++;
  -if (!*equivs) {
  - delEntry = 1;
  -}
  -
  -if (cache-size) {
  - entry = machCacheFindEntry(cache, name);
  - if (entry) {
  -  

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

2007-06-29 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:   29-Jun-2007 14:28:41
  Branch: HEAD Handle: 2007062913284001

  Modified files:
rpm CHANGES
rpm/lib rpmrc.c

  Log:
Correctly restore SIGILL signal handler in machine detection code.

Submitted by: OpenSUSE via Panu Matilainen at rpm.org
Obtained from: http://hg.rpm.org/rpm?cs=8a1bbb5918b9

  Summary:
RevisionChanges Path
1.1415  +1  -0  rpm/CHANGES
2.199   +10 -2  rpm/lib/rpmrc.c
  

  patch -p0 '@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.1414 -r1.1415 CHANGES
  --- rpm/CHANGES   29 Jun 2007 11:56:06 -  1.1414
  +++ rpm/CHANGES   29 Jun 2007 12:28:40 -  1.1415
  @@ -1,4 +1,5 @@
   4.5 - 5.0:
  +- rse: correctly restore SIGILL signal handler in machine detection 
code. 
   - pmatilaj: nuke antique Red Hat Linux reference baddeps list (in 
lib/depends.c)
   - rse: allow one to explicitly select the RPM DB API with 
--with-dbapi={db,sqlite}
   - rse: provide automatically Autoconf chosen RPM DB API selection and 
configuration
  @@ .
  patch -p0 '@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.198 -r2.199 rpmrc.c
  --- rpm/lib/rpmrc.c   19 Jun 2007 06:49:49 -  2.198
  +++ rpm/lib/rpmrc.c   29 Jun 2007 12:28:41 -  2.199
  @@ -1149,19 +1149,27 @@
   {
int cpu;
unsigned int tfms, junk, cap, capamd;
  + struct sigaction oldsa;

  + sigaction(SIGILL, NULL, oldsa);
signal(SIGILL, model3);

  - if (sigsetjmp(jenv, 1))
  + if (sigsetjmp(jenv, 1)) {
  + sigaction(SIGILL, oldsa, NULL);
return 3;
  + }

  - if (cpuid_eax(0x0)==0)
  + if (cpuid_eax(0x0)==0) {
  + sigaction(SIGILL, oldsa, NULL);
return 4;
  + }
   
cpuid(0x0001, tfms, junk, junk, cap);
cpuid(0x8001, junk, junk, junk, capamd);

cpu = (tfms8)15;
  +
  + sigaction(SIGILL, oldsa, NULL);

if (cpu  6)
return cpu;
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org