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:   12-May-2009 23:16:45
  Branch: HEAD                             Handle: 2009051221164500

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

  Log:
    make cpuinfoP in lib/depends.c non-static and reuse it rather than
    recreating another in rpmCpuinfo()

  Summary:
    Revision    Changes     Path
    1.442       +1  -1      rpm/lib/depends.c
    2.283       +4  -10     rpm/lib/rpmrc.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/lib/depends.c
  ============================================================================
  $ cvs diff -u -r1.441 -r1.442 depends.c
  --- rpm/lib/depends.c 6 Apr 2009 00:21:21 -0000       1.441
  +++ rpm/lib/depends.c 12 May 2009 21:16:45 -0000      1.442
  @@ -821,7 +821,7 @@
   /*...@refcounted@*/ /*...@null@*/ /*...@unchecked@*/
   static rpmds rpmlibP = NULL;
   /*...@refcounted@*/ /*...@null@*/ /*...@unchecked@*/
  -static rpmds cpuinfoP = NULL;
  +rpmds cpuinfoP = NULL;
   /*...@refcounted@*/ /*...@null@*/ /*...@unchecked@*/
   static rpmds getconfP = NULL;
   /*...@refcounted@*/ /*...@null@*/ /*...@unchecked@*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrc.c
  ============================================================================
  $ cvs diff -u -r2.282 -r2.283 rpmrc.c
  --- rpm/lib/rpmrc.c   12 May 2009 19:17:53 -0000      2.282
  +++ rpm/lib/rpmrc.c   12 May 2009 21:16:45 -0000      2.283
  @@ -509,6 +509,7 @@
   {
       rpmds cpufeature = rpmdsSingle(RPMTAG_REQUIRENAME, feature, EVR, 
RPMSENSE_PROBE);
       int ret = rpmdsMatch(cpufeature, cpuinfo);
  +
       (void)rpmdsFree(cpufeature);
       cpufeature = NULL;
       return ret;
  @@ -521,7 +522,7 @@
       miRE mi_re = NULL;
       int mi_nre = 0, xx, i;
       CVOG_t cvog = NULL;
  -    rpmds cpuinfo = NULL;
  +    extern rpmds cpuinfoP;
       struct stat st;
       char *yaml;
       rpmsyck_node *tmp, node;
  @@ -538,10 +539,6 @@
       Fread(yaml, 1, st.st_size, fd);
       Fclose(fd);
   
  -    /* XXX: Probably not right..? */
  -    cpuinfo = rpmdsSingle(RPMTAG_PROVIDENAME, "", "", RPMSENSE_PROBE);
  -    xx = rpmdsCpuinfo(&cpuinfo, NULL);
  -
       cpuinfoYaml = rpmSyckLoad(yaml);
       yaml = _free(yaml);
       htGetEntry(cpuinfoYaml->firstNode->value.map, "cpuinfo", &tmp, NULL, 
NULL);
  @@ -556,7 +553,7 @@
                const char *family = tmp[0]->value.key;
                int j;
                hashTable cpus = NULL; 
  -             if(rpmCpuinfoMatch(family, "", cpuinfo)) {
  +             if(rpmCpuinfoMatch(family, "", cpuinfoP)) {
                    if(htHasEntry(node[i].value.map, "Arch")) {
                        htGetEntry(node[i].value.map, "Arch", &tmp, NULL, NULL);
                        rpmsyck_node arch = tmp[0]->value.seq;
  @@ -573,7 +570,7 @@
                                rpmsyck_node features = tmp[0]->value.seq;
                                int k, match = 0;
                                for(k = 0; features[k].type != T_END; k++)
  -                                 if(features[k].type == T_STR && !(match = 
rpmCpuinfoMatch(features[k].value.key, "", cpuinfo))) break;
  +                                 if(features[k].type == T_STR && !(match = 
rpmCpuinfoMatch(features[k].value.key, "", cpuinfoP))) break;
                                if(!match) continue;
                            }
                            if(htHasEntry(arch[j].value.map, "Name")) {
  @@ -613,9 +610,6 @@
   
       cpuinfoYaml = rpmSyckFree(cpuinfoYaml);
   
  -    (void)rpmdsFree(cpuinfo);
  -    cpuinfo = NULL;
  -
       xx = mireAppend(RPMMIRE_REGEX, 0, "noarch", NULL, &mi_re, &mi_nre);
   
       cpu = mi_re[0].pattern;
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to