RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-4_5: rpm/lib/ rpmrc.c

From: Olivier Thauvin <nanardon@rpm5.org>
Date: Mon 16 Jul 2007 - 02:39:14 CEST
Message-Id: <20070716003914.CEE753484F3@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Olivier Thauvin
  Root:   /v/rpm/cvs                       Email:  nanardon@rpm5.org
  Module: rpm                              Date:   16-Jul-2007 02:39:14
  Branch: rpm-4_5                          Handle: 2007071601391400

  Modified files:           (Branch: rpm-4_5)
    rpm/lib                 rpmrc.c

  Log:
    - hack rpmMachineScore to make it using platform instead rpmrc config,
    and so working again in compatibility mode

  Summary:
    Revision    Changes     Path
    2.195.2.4   +19 -2      rpm/lib/rpmrc.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrc.c
  ============================================================================
  $ cvs diff -u -r2.195.2.3 -r2.195.2.4 rpmrc.c
  --- rpm/lib/rpmrc.c	3 Jul 2007 16:49:00 -0000	2.195.2.3
  +++ rpm/lib/rpmrc.c	16 Jul 2007 00:39:14 -0000	2.195.2.4
  @@ -1614,8 +1614,25 @@
   
   int rpmMachineScore(int type, const char * name)
   {
  -    machEquivInfo info = machEquivSearch(&tables[type].equiv, name);
  -    return (info != NULL ? info->score : 0);
  +    const char * fakeplatform;
  +    int score = 0;
  +    switch (type) {
  +        case RPM_MACHTABLE_INSTARCH:
  +            fakeplatform = rpmExpand(name, "%{_host_vendor}-%{_host_os}%{?_gnu}", NULL);
  +            break;
  +        case RPM_MACHTABLE_BUILDARCH:
  +            fakeplatform = rpmExpand(name, "%{_target_vendor}-%{_target_os}%{?_gnu}", NULL);
  +            break;
  +        case RPM_MACHTABLE_INSTOS:
  +            fakeplatform = rpmExpand("%{_host_arch}-%{_host_vendor}-", name, "%{?_gnu}", NULL);
  +            break;
  +        case RPM_MACHTABLE_BUILDOS:
  +            fakeplatform = rpmExpand("%{_target_arch}-%{_target_vendor}-", name, "%{?_gnu}", NULL);
  +            break;
  +    }
  +    score = rpmPlatformScore(fakeplatform, NULL, 0);
  +    _free(fakeplatform);
  +    return(score);
   }
   
   /*@-modnomods@*/
  @@ .
Received on Mon Jul 16 02:39:14 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.