RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm-4_5: rpm/ CHANGES rpm/python/ rpmmodule.c

From: Jeff Johnson <jbj@rpm5.org>
Date: Tue 28 Aug 2007 - 18:47:31 CEST
Message-Id: <20070828164731.EDBFC34845B@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   28-Aug-2007 18:47:31
  Branch: rpm-4_5                          Handle: 2007082817473100

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

  Log:
    - rpm.org: python: add method for expanding macros.

  Summary:
    Revision    Changes     Path
    1.1360.2.37 +2  -1      rpm/CHANGES
    1.148.2.4   +15 -0      rpm/python/rpmmodule.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1360.2.36 -r1.1360.2.37 CHANGES
  --- rpm/CHANGES	28 Aug 2007 16:14:07 -0000	1.1360.2.36
  +++ rpm/CHANGES	28 Aug 2007 16:47:31 -0000	1.1360.2.37
  @@ -1,5 +1,6 @@
   4.4.9 -> 4.5:
  -    - rpm.org: avoid truncating /var/log/rpmpkgs in case of errors (rhbz#232830)
  +    - rpm.org: python: add method for expanding macros.
  +    - rpm.org: avoid truncating /var/log/rpmpkgs in case of errors (#232830).
       - jbj: update debugedit to include buildid changes.
       - jbj: update id.po (Translation Project).
       - jbj: prepare for open as a macro in bleeding edge glibc-2.6.90+.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/python/rpmmodule.c
  ============================================================================
  $ cvs diff -u -r1.148.2.3 -r1.148.2.4 rpmmodule.c
  --- rpm/python/rpmmodule.c	16 Aug 2007 12:25:47 -0000	1.148.2.3
  +++ rpm/python/rpmmodule.c	28 Aug 2007 16:47:31 -0000	1.148.2.4
  @@ -48,6 +48,19 @@
   typedef int Py_ssize_t;
   #endif
   
  +
  +/**
  + */
  +static PyObject * expandMacro(PyObject * self, PyObject * args, PyObject * kwds)
  +{
  +    char * macro;
  +
  +    if (!PyArg_ParseTuple(args, "s", &macro))
  +	return NULL;
  +
  +    return Py_BuildValue("s", rpmExpand(macro, NULL));
  +}
  +
   /**
    */
   static PyObject * signalsCaught(PyObject * self, PyObject * check)
  @@ -177,6 +190,8 @@
   	NULL },
       { "delMacro", (PyCFunction) rpmrc_DelMacro, METH_VARARGS|METH_KEYWORDS,
   	NULL },
  +    { "expandMacro", (PyCFunction) expandMacro, METH_VARARGS|METH_KEYWORDS,
  +	NULL },
   
       { "signalsCaught", (PyCFunction) signalsCaught, METH_O,
   	NULL },
  @@ .
Received on Tue Aug 28 18:47:32 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.