[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rpm-cvs
Subject:    [CVS] RPM: rpm-4_5: rpm/ CHANGES rpm/python/ rpmmodule.c
From:       "Robert Scheck" <robert () rpm5 ! org>
Date:       2008-06-22 18:12:25
Message-ID: 20080622181225.903C034844C () rpm5 ! org
[Download RAW message or body]

  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Robert Scheck
  Root:   /v/rpm/cvs                       Email:  robert@rpm5.org
  Module: rpm                              Date:   22-Jun-2008 20:12:25
  Branch: rpm-4_5                          Handle: 2008062218122401

  Modified files:           (Branch: rpm-4_5)
    rpm                     CHANGES
    rpm/python              rpmmodule.c

  Log:
    - robert: python: backport rpm.archscore() and rpm.platformscore() for
    smart depsolving usage

  Summary:
    Revision    Changes     Path
    1.1360.2.112+2  -0      rpm/CHANGES
    1.148.2.5   +42 -0      rpm/python/rpmmodule.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1360.2.111 -r1.1360.2.112 CHANGES
  --- rpm/CHANGES	21 Jun 2008 19:45:19 -0000	1.1360.2.111
  +++ rpm/CHANGES	22 Jun 2008 18:12:24 -0000	1.1360.2.112
  @@ -1,4 +1,6 @@
   4.4.9 -> 4.5:
  +	- robert: python: backport rpm.archscore() and rpm.platformscore()
  +	    for smart depsolving usage
   	- robert: rpmrepo: enable/disable sqlite dependent on rest of rpm
   	- jbj: fix: allocate Icon: buffer after iconsize is initialized.
   	- jbj: fix: skip %exclude/%ghost files to get more accurate RPMTAG_SIZE.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/python/rpmmodule.c
  ============================================================================
  $ cvs diff -u -r1.148.2.4 -r1.148.2.5 rpmmodule.c
  --- rpm/python/rpmmodule.c	28 Aug 2007 16:47:31 -0000	1.148.2.4
  +++ rpm/python/rpmmodule.c	22 Jun 2008 18:12:25 -0000	1.148.2.5
  @@ -62,6 +62,43 @@
   }
   
   /**
  + *  */
  +static PyObject * archScore(PyObject * s, PyObject * args,
  +                PyObject * kwds)
  +{
  +    char * arch;
  +    char * platform;
  +    int score;
  +    char * kwlist[] = {"arch", NULL};
  +
  +    if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
  +	return NULL;
  +
  +    platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
  +    score = rpmPlatformScore(platform, NULL, 0);
  +    platform = _free(platform);
  +
  +    return Py_BuildValue("i", score);
  +}
  +
  +/**
  + *  */
  +static PyObject * platformScore(PyObject * s, PyObject * args,
  +                PyObject * kwds)
  +{
  +    char * platform;
  +    int score;
  +    char * kwlist[] = {"platform", NULL};
  +
  +    if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &platform))
  +	return NULL;
  +
  +    score = rpmPlatformScore(platform, NULL, 0);
  +
  +    return Py_BuildValue("i", score);
  +}
  +
  +/**
    */
   static PyObject * signalsCaught(PyObject * self, PyObject * check)
   {
  @@ -193,6 +230,11 @@
       { "expandMacro", (PyCFunction) expandMacro, METH_VARARGS|METH_KEYWORDS,
   	NULL },
   
  +    { "archscore", (PyCFunction) archScore, METH_VARARGS|METH_KEYWORDS,
  +	NULL },
  +    { "platformscore", (PyCFunction) platformScore, METH_VARARGS|METH_KEYWORDS,
  +	NULL },
  +
       { "signalsCaught", (PyCFunction) signalsCaught, METH_O,
   	NULL },
       { "checkSignals", (PyCFunction) checkSignals, METH_VARARGS,
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic