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

2009-03-19 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 18:46:24
  Branch: HEAD Handle: 2009031917462300

  Modified files:
rpm/lib rpmds.c rpmrc.c

  Log:
add cpuinfo(endianness)

  Summary:
RevisionChanges Path
2.133   +11 -0  rpm/lib/rpmds.c
2.270   +28 -28 rpm/lib/rpmrc.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmds.c
  
  $ cvs diff -u -r2.132 -r2.133 rpmds.c
  --- rpm/lib/rpmds.c   18 Mar 2009 22:11:21 -  2.132
  +++ rpm/lib/rpmds.c   19 Mar 2009 17:46:23 -  2.133
  @@ -5,6 +5,7 @@
   
   #if defined(SUPPORT_LIBCPUINFO)
   #include 
  +#include 
   #endif
   
   #if defined(HAVE_GELF_H) && !defined(__FreeBSD__)
  @@ -1217,6 +1218,16 @@
   rpmdsNSAdd(dsp, NS, "cpu_cores", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
   snprintf(tmp, 19, "%d", cpuinfo_get_threads(cip));
   rpmdsNSAdd(dsp, NS, "cpu_threads", tmp, RPMSENSE_PROBE|RPMSENSE_EQUAL);
  +#ifdef __BYTE_ORDER
  +#if __BYTE_ORDER == LITTLE_ENDIAN
  +#define endian "little"
  +#elif __BYTE_ORDER == BIG_ENDIAN
  +#define endian "big"
  +#elif __BYTE_ORDER == PDP_ENDIAN
  +#define endian "pdp"
  +#endif
  +rpmdsNSAdd(dsp, NS, "endianness", endian, RPMSENSE_PROBE|RPMSENSE_EQUAL);
  +#endif
   
   for (feature = cpuinfo_feature_common; feature != 
cpuinfo_feature_architecture_max; feature++) {
if(feature == cpuinfo_feature_common_max)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.269 -r2.270 rpmrc.c
  --- rpm/lib/rpmrc.c   19 Mar 2009 00:20:18 -  2.269
  +++ rpm/lib/rpmrc.c   19 Mar 2009 17:46:23 -  2.270
  @@ -503,9 +503,9 @@
   /*...@=onlytrans@*/
   
   #if defined(SUPPORT_LIBCPUINFO)
  -static inline int rpmCpuinfoMatch(const char * feature, rpmds cpuinfo)
  +static inline int rpmCpuinfoMatch(const char * feature, const char * EVR, 
rpmds cpuinfo)
   {
  -rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, "", 
RPMSENSE_PROBE);
  +rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, EVR, 
RPMSENSE_PROBE);
   int ret = rpmdsMatch(cpufeature, cpuinfo);
   cpufeature = rpmdsFree(cpufeature);
   return ret;
  @@ -523,59 +523,59 @@
   
   xx = rpmdsCpuinfo(&cpuinfo, NULL);
   
  -if(rpmCpuinfoMatch("cpuinfo([x86])", cpuinfo)) {
  - if(rpmCpuinfoMatch("cpuinfo(64bit)", cpuinfo))
  +if(rpmCpuinfoMatch("cpuinfo([x86])", "", cpuinfo)) {
  + 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);
}
  - if(rpmCpuinfoMatch("cpuinfo(cmov)", cpuinfo)) {
  - if(rpmCpuinfoMatch("cpuinfo(mmx)", cpuinfo)) {
  - if(rpmCpuinfoMatch("cpuinfo(sse)", cpuinfo)) {
  - if(rpmCpuinfoMatch("cpuinfo(sse2)", cpuinfo))
  + 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(3dnowext)", 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);
}
xx = mireAppend(RPMMIRE_REGEX, 0, "i686", NULL, &mi_re, &mi_nre);
}
  - if(rpmCpuinfoMatch("cpuinfo(3dnow)", cpuinfo) && 
rpmCpuinfoMatch("cpuinfo(mmx)", cpuinfo))
  + 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))
  + if(rpmCpuinfoMatch("cpuinfo(tsc)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "i586", NULL, &mi_re, &mi_nre);
  - if(rpmCpuinfoMatch("cpuinfo(ac)", cpuinfo))
  + if(rpmCpuinfoMatch("cpuinfo(ac)", "", cpuinfo))
xx = mireAppend(RPMMIRE_REGEX, 0, "i486", NULL, &mi_re, &mi_nre);
xx =

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

2007-07-02 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:   02-Jul-2007 10:53:29
  Branch: HEAD Handle: 2007070209532900

  Modified files:
rpm/lib rpmds.c rpmrc.c

  Log:
do not hard-code the config directory /etc/rpm, use the existing
SYSCONFIGDIR #define which especially can be configured to a different
directory during build-time, too

  Summary:
RevisionChanges Path
2.59+1  -1  rpm/lib/rpmds.c
2.200   +1  -1  rpm/lib/rpmrc.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmds.c
  
  $ cvs diff -u -r2.58 -r2.59 rpmds.c
  --- rpm/lib/rpmds.c   21 Jun 2007 12:00:08 -  2.58
  +++ rpm/lib/rpmds.c   2 Jul 2007 08:53:29 -   2.59
  @@ -1607,7 +1607,7 @@
   return rc;
   }
   
  -#define  _ETC_RPM_SYSINFO"/etc/rpm/sysinfo"
  +#define  _ETC_RPM_SYSINFOSYSCONFIGDIR "/sysinfo"
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ /[EMAIL 
PROTECTED]@*/
   static const char *_sysinfo_path = NULL;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrc.c
  
  $ cvs diff -u -r2.199 -r2.200 rpmrc.c
  --- rpm/lib/rpmrc.c   29 Jun 2007 12:28:41 -  2.199
  +++ rpm/lib/rpmrc.c   2 Jul 2007 08:53:29 -   2.200
  @@ -31,7 +31,7 @@
   static const char * configTarget = NULL;
   
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/
  -static const char * platform = "/etc/rpm/platform";
  +static const char * platform = SYSCONFIGDIR "/platform";
   /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/
   void * platpat = NULL;
   /[EMAIL PROTECTED]@*/
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org