platform/upstream/rpm.git
15 years agoGeneralize access to ob_type so that they work with both Python 2.* and Python 3.*
David Malcolm [Thu, 15 Oct 2009 19:14:56 +0000 (15:14 -0400)]
Generalize access to ob_type so that they work with both Python 2.* and Python 3.*

Python 2's various object structs use macros to implement common fields at the top of each
struct.

Python 3's objects instead embed a PyObject struct as the first member within the more refined
object structs.

Use the Py_TYPE() macro when accessing ob_type in order to encapsulate this difference.

15 years agoAvoid using python's print for Python 3.x compatibility
Panu Matilainen [Mon, 19 Oct 2009 07:30:48 +0000 (10:30 +0300)]
Avoid using python's print for Python 3.x compatibility
- print chanced from statement to a function in python 3, for our
  purposes sys.stdout.write() is sufficient and avoids dealing with
  the incompatibilities between Python 2.x and 3.x
- suggested by David Malcolm / Ville Skyttä

15 years agoUnbreak lzdio/xzdio
Panu Matilainen [Sat, 17 Oct 2009 09:15:29 +0000 (12:15 +0300)]
Unbreak lzdio/xzdio
- revert part of b0d1038190be5cb4b45e2c2c7c84ee7022164ba2 which broke
  the split-personality lzdio/xzdio

15 years agoSkip posttrans scripts of failed transaction elements
Panu Matilainen [Sat, 17 Oct 2009 08:25:53 +0000 (11:25 +0300)]
Skip posttrans scripts of failed transaction elements

15 years agoSince we really want a FILE* then get one in the first place
Panu Matilainen [Fri, 16 Oct 2009 10:36:39 +0000 (13:36 +0300)]
Since we really want a FILE* then get one in the first place
- this is visible in the librpmbuild exported goo, rename the member
  to force build-breakage on the poor souls trying to use librpmbuild API

15 years agoUse a helper function for finding fileno of specific io type
Panu Matilainen [Thu, 15 Oct 2009 11:51:28 +0000 (14:51 +0300)]
Use a helper function for finding fileno of specific io type
- also differentiate between lzdio and xzdio here

15 years agoLose unnecessary url type checking from fdSize()
Panu Matilainen [Thu, 15 Oct 2009 11:33:45 +0000 (14:33 +0300)]
Lose unnecessary url type checking from fdSize()
- we're only dealing with local files once fd is opened

15 years agoLose unused leftover definitions
Panu Matilainen [Thu, 15 Oct 2009 11:23:20 +0000 (14:23 +0300)]
Lose unused leftover definitions

15 years agoEliminate ufdio-specific read, write, seek and close
Panu Matilainen [Fri, 16 Oct 2009 09:49:08 +0000 (12:49 +0300)]
Eliminate ufdio-specific read, write, seek and close
- we dont do network IO anymore so ufdio only differs from fdio by
  downloading the file on open if necessary, after that it's just fdio

15 years agoUse fd.tell() instead of going around through os.lseek() with fdno
Panu Matilainen [Thu, 15 Oct 2009 08:36:46 +0000 (11:36 +0300)]
Use fd.tell() instead of going around through os.lseek() with fdno

15 years agoAdd tell() method to rpm.fd class
Panu Matilainen [Thu, 15 Oct 2009 08:34:26 +0000 (11:34 +0300)]
Add tell() method to rpm.fd class

15 years agoAdd ftell() clone to FD_t
Panu Matilainen [Thu, 15 Oct 2009 08:33:18 +0000 (11:33 +0300)]
Add ftell() clone to FD_t

15 years agoAvoid unnecessary dup'ing of file descriptors on header list operations
Panu Matilainen [Thu, 15 Oct 2009 08:01:00 +0000 (11:01 +0300)]
Avoid unnecessary dup'ing of file descriptors on header list operations
- convert to rpm.fd on python side already add use internal helper
  which only accepts rpm.fd type to avoid having to dup around on
  every item

15 years agoAccept rpm.fd() types file objects everywhere in python bindings
Panu Matilainen [Thu, 15 Oct 2009 07:11:37 +0000 (10:11 +0300)]
Accept rpm.fd() types file objects everywhere in python bindings
- turn rpmfdFromPyObject() into a python-level object converter, add
  a separate C-level getter for the fd pointer itself
- take advantage of python refcounting to handle differences between
  native vs converted rpm.fd in callers so we can simply decref the
  rpmfdFromPyObject() result without having to worry whether it was
  converted or not (ie should we close it or not)

15 years agoMake fdUpdateDigests() static now that its possible
Panu Matilainen [Wed, 14 Oct 2009 14:22:25 +0000 (17:22 +0300)]
Make fdUpdateDigests() static now that its possible

15 years agoMake FD_t struct opaque, finally
Panu Matilainen [Wed, 14 Oct 2009 14:19:09 +0000 (17:19 +0300)]
Make FD_t struct opaque, finally

15 years agoEliminate last remaining FD_t struct privacy violation
Panu Matilainen [Wed, 14 Oct 2009 14:14:38 +0000 (17:14 +0300)]
Eliminate last remaining FD_t struct privacy violation
- add getter for fd digest bundle, uninline the setter

15 years agoRemove cpio stuff from FD_t
Panu Matilainen [Wed, 14 Oct 2009 14:03:14 +0000 (17:03 +0300)]
Remove cpio stuff from FD_t
- only the FSM cares about cpio position, move it there - there's only
  ever one fd active inside FSM, no need to track it per-fd

15 years agoMove debug goo defs to rpmio.c
Panu Matilainen [Wed, 14 Oct 2009 13:15:05 +0000 (16:15 +0300)]
Move debug goo defs to rpmio.c

15 years agoMove pile of helpers from rpmio_internal.h to rpmio.c, remove unused stuff
Panu Matilainen [Wed, 14 Oct 2009 13:10:08 +0000 (16:10 +0300)]
Move pile of helpers from rpmio_internal.h to rpmio.c, remove unused stuff
- nothing outside rpmio.c needs these, make 'em static there
- uninlining reveals quite a few completely unused helpers...

15 years agoMove fd statistics foo inside rpmio.c now that it can
Panu Matilainen [Wed, 14 Oct 2009 13:02:00 +0000 (16:02 +0300)]
Move fd statistics foo inside rpmio.c now that it can

15 years agoMove fdDigest*() to rpmio.c where they better belong
Panu Matilainen [Wed, 14 Oct 2009 12:59:39 +0000 (15:59 +0300)]
Move fdDigest*() to rpmio.c where they better belong

15 years agoRemove pointless inlining of stuff in rpmio
Panu Matilainen [Wed, 14 Oct 2009 12:12:43 +0000 (15:12 +0300)]
Remove pointless inlining of stuff in rpmio

15 years agoUse common "not implemented" implementation of Fseek()
Panu Matilainen [Wed, 14 Oct 2009 11:45:54 +0000 (14:45 +0300)]
Use common "not implemented" implementation of Fseek()

15 years agoAdd first rough-cut python bindings for rpmio fd
Panu Matilainen [Wed, 14 Oct 2009 11:14:51 +0000 (14:14 +0300)]
Add first rough-cut python bindings for rpmio fd
- attempt to mimic python file object where possible, but nowhere near
  all methods are supported, either just not yet done or due to
  underlying limitations

15 years agoRaise exception in the converter, not caller
Panu Matilainen [Mon, 12 Oct 2009 12:15:39 +0000 (15:15 +0300)]
Raise exception in the converter, not caller

15 years agoPermit changing rpm.td tag from python
Panu Matilainen [Mon, 12 Oct 2009 12:05:50 +0000 (15:05 +0300)]
Permit changing rpm.td tag from python

15 years agoAdd limited support for modifying headers to python
Panu Matilainen [Mon, 12 Oct 2009 11:43:44 +0000 (14:43 +0300)]
Add limited support for modifying headers to python
- for now we only support tag deletion and assigning rpmtd objects, limiting
  this to copying data from other headers

15 years agoFix format extension memleak on empty strings
Panu Matilainen [Mon, 12 Oct 2009 10:49:50 +0000 (13:49 +0300)]
Fix format extension memleak on empty strings

15 years agoOutput dependency type on --requires etc queries if verbose (RhBug:528342)
Panu Matilainen [Mon, 12 Oct 2009 08:03:14 +0000 (11:03 +0300)]
Output dependency type on --requires etc queries if verbose (RhBug:528342)

15 years agoAdd RPMTAG_VERBOSE extension
Panu Matilainen [Mon, 12 Oct 2009 08:02:56 +0000 (11:02 +0300)]
Add RPMTAG_VERBOSE extension
- hack to permit different query formatting based on rpm's verbosity level

15 years agoPermit conditional query formats on not yet cached data too
Panu Matilainen [Mon, 12 Oct 2009 07:48:59 +0000 (10:48 +0300)]
Permit conditional query formats on not yet cached data too

15 years agoOops, configuring wrong ts in rpm.ts() initialization
Panu Matilainen [Sat, 10 Oct 2009 09:36:38 +0000 (12:36 +0300)]
Oops, configuring wrong ts in rpm.ts() initialization

15 years agoMove further initialization from python ts tp_new to tp_init
Panu Matilainen [Fri, 9 Oct 2009 12:44:06 +0000 (15:44 +0300)]
Move further initialization from python ts tp_new to tp_init
- lose the unnecessary rpmts_Wrap(), it's not needed and just gets
  in the way of things

15 years agoRevert explicit PyErr_NoMemory() returns to just returning NULL
Panu Matilainen [Fri, 9 Oct 2009 08:57:46 +0000 (11:57 +0300)]
Revert explicit PyErr_NoMemory() returns to just returning NULL
- tp_alloc failing is likely to be OOM but we dont know that for a fact,
  and the failing method is responsible for setting the exception

15 years agoHandle NULL in ts get/setKeyring as python None
Panu Matilainen [Fri, 9 Oct 2009 08:44:41 +0000 (11:44 +0300)]
Handle NULL in ts get/setKeyring as python None

15 years agoKill off _rpmb.error exception type
Panu Matilainen [Fri, 9 Oct 2009 06:35:42 +0000 (09:35 +0300)]
Kill off _rpmb.error exception type
- import of _rpmb messes up rpm.error to point to _rpmb.error which we
  do not want
- use ValueError for unparsable spec for now, need to figure something
  saner there still

15 years agoPermit setting and getting ts keyring from python
Panu Matilainen [Fri, 9 Oct 2009 06:30:37 +0000 (09:30 +0300)]
Permit setting and getting ts keyring from python

15 years agoAdd bindings for rpm keyring and pubkey types
Panu Matilainen [Fri, 9 Oct 2009 06:02:19 +0000 (09:02 +0300)]
Add bindings for rpm keyring and pubkey types

15 years agoAdd an interface to parse armored OpenPGP from memory
Panu Matilainen [Fri, 9 Oct 2009 05:48:13 +0000 (08:48 +0300)]
Add an interface to parse armored OpenPGP from memory
- refactor the decoding part out of pgpReadPkts() to separate helper,
  and add pgpParsePkts() around that

15 years agoSupport passing extra options to dep generator scripts
Panu Matilainen [Wed, 7 Oct 2009 09:09:00 +0000 (12:09 +0300)]
Support passing extra options to dep generator scripts

15 years agoLose unused python/perl/java stringbuffers from rpmfc
Panu Matilainen [Tue, 6 Oct 2009 12:05:06 +0000 (15:05 +0300)]
Lose unused python/perl/java stringbuffers from rpmfc

15 years agoBah, get the new ocaml-scripts into tarballs too
Panu Matilainen [Tue, 6 Oct 2009 10:22:22 +0000 (13:22 +0300)]
Bah, get the new ocaml-scripts into tarballs too
- should've been in commit 82e7dd702013d3679fda438333de30afdec17a4f

15 years agoPython namespace import fiddling
Panu Matilainen [Tue, 6 Oct 2009 10:13:23 +0000 (13:13 +0300)]
Python namespace import fiddling
- import rpm instead of _rpm for exception name compatibility
- import the lowlevel transaction class as _rpmts, makes it slightly
  easier to see which is which

15 years agoTeach the internal dep generator about OCaml
Panu Matilainen [Tue, 6 Oct 2009 09:34:44 +0000 (12:34 +0300)]
Teach the internal dep generator about OCaml
- OCaml seems to have fairly well detectable magic in its files, nice
- Dont call the regular find-requires from the scripts now that internal
  is working

15 years agoAdd OCaml dependency generator scripts (Richard W.M. Jones)
Panu Matilainen [Tue, 6 Oct 2009 09:29:37 +0000 (12:29 +0300)]
Add OCaml dependency generator scripts (Richard W.M. Jones)

15 years agoDeprecate %__lzma, use %__xz in it.
Ville Skyttä [Mon, 3 Aug 2009 21:48:32 +0000 (00:48 +0300)]
Deprecate %__lzma, use %__xz in it.

15 years agoDecompress lzma files with xz.
Ville Skyttä [Mon, 3 Aug 2009 18:08:55 +0000 (21:08 +0300)]
Decompress lzma files with xz.

15 years agoImprove perl.req here-doc skipping.
Ville Skyttä [Tue, 22 Sep 2009 18:11:20 +0000 (21:11 +0300)]
Improve perl.req here-doc skipping.

This version is stricter in finding the end identifier by using equality test
instead of a regex (as a side effect, fixes rhbz#524929) as well as parsing
quoted identifiers, and adds support for identifiers in backticks.

15 years agoDelete ancient and defunc python test programs
Panu Matilainen [Mon, 5 Oct 2009 15:23:55 +0000 (18:23 +0300)]
Delete ancient and defunc python test programs

15 years agoDont leak memory from rpm.fi() methods
Panu Matilainen [Mon, 5 Oct 2009 14:23:34 +0000 (17:23 +0300)]
Dont leak memory from rpm.fi() methods
- Py_BuildValue() always copies the data mallocing here is just wrong

15 years agoHandle all rpmds variants in its constructor
Panu Matilainen [Mon, 5 Oct 2009 13:42:52 +0000 (16:42 +0300)]
Handle all rpmds variants in its constructor
- either it takes a header + tag, or (name, flags, version) tuple + tag
  to generate a single dep
- push rpm.dsSingle() compatibility out to python side
- hdr.dsFromHeader() and hdr.dsOfHeader() no longer need to be in rpmds-py.c

15 years agorpmdb open failing is certainly an rpm error, not TypeError
Panu Matilainen [Mon, 5 Oct 2009 12:38:45 +0000 (15:38 +0300)]
rpmdb open failing is certainly an rpm error, not TypeError

15 years agoDead code removal
Panu Matilainen [Mon, 5 Oct 2009 12:36:54 +0000 (15:36 +0300)]
Dead code removal

15 years agoPermit threads during rpmReadPackageFile()
Panu Matilainen [Mon, 5 Oct 2009 12:25:59 +0000 (15:25 +0300)]
Permit threads during rpmReadPackageFile()

15 years agoType mismatch is TypeError, not rpm.error
Panu Matilainen [Mon, 5 Oct 2009 12:22:12 +0000 (15:22 +0300)]
Type mismatch is TypeError, not rpm.error

15 years agoPush hdrFromFdno() error code handling over to python side
Panu Matilainen [Mon, 5 Oct 2009 12:19:01 +0000 (15:19 +0300)]
Push hdrFromFdno() error code handling over to python side
- return (rpmrc, header) tuple from C to let python do whatever it
  wishes with the information
- let python side worry about generating backwards compatible returns

15 years agoPush hdrCheck() error code handling over to python side
Panu Matilainen [Mon, 5 Oct 2009 11:55:37 +0000 (14:55 +0300)]
Push hdrCheck() error code handling over to python side
- return (rpmrc, message) tuple from C to let python do whatever it
  wishes with the information
- let python side worry about generating backwards compatible returns

15 years agoTeach python about the lowlevel RPMRC codes
Panu Matilainen [Mon, 5 Oct 2009 11:30:27 +0000 (14:30 +0300)]
Teach python about the lowlevel RPMRC codes

15 years agoPush ts.check() return tuple-o-doom generation over to python side
Panu Matilainen [Mon, 5 Oct 2009 11:25:43 +0000 (14:25 +0300)]
Push ts.check() return tuple-o-doom generation over to python side

15 years agoTeach python about RPMSENSE_ANY
Panu Matilainen [Mon, 5 Oct 2009 11:08:48 +0000 (14:08 +0300)]
Teach python about RPMSENSE_ANY

15 years agoEnable retrieving problem key from python too
Panu Matilainen [Mon, 5 Oct 2009 10:12:05 +0000 (13:12 +0300)]
Enable retrieving problem key from python too

15 years agoPush transaction problem filter to python side
Panu Matilainen [Mon, 5 Oct 2009 09:16:26 +0000 (12:16 +0300)]
Push transaction problem filter to python side
- make C-level ts.run() require ignoreSet just like the real one does
  and keep the value on python side of things

15 years agoPush the interpretation of ts.run() result code to python side
Panu Matilainen [Mon, 5 Oct 2009 09:09:26 +0000 (12:09 +0300)]
Push the interpretation of ts.run() result code to python side
- at least this lets sub-typers override the hysterical return values

15 years agoAdd minimal python wrapping for rpmProblem objects
Panu Matilainen [Mon, 5 Oct 2009 08:09:05 +0000 (11:09 +0300)]
Add minimal python wrapping for rpmProblem objects
- for now, only expose the basic attributes and return problem string
  representation on %s
- return problem objects on rpmps iteration

15 years agoUgh, forgot to add the new _rpmb module to git
Panu Matilainen [Mon, 5 Oct 2009 06:26:43 +0000 (09:26 +0300)]
Ugh, forgot to add the new _rpmb module to git
- should've been in commit 8169bbde6934637ed7be58e18103330c1d5e4546

15 years agoPush most work of ts.addErase() over to python
Panu Matilainen [Fri, 2 Oct 2009 19:48:03 +0000 (22:48 +0300)]
Push most work of ts.addErase() over to python
- minimize the stuff done in C: rpmtsAddEraseElement() only cares about
  header, so that's what we accept on C-level bindings
- on python side, handle db recno's and labels like we've always done,
  additionally accept match iterators and plain headers too

15 years agoReturn error code from rpmtsAddEraseElement() failure
Panu Matilainen [Fri, 2 Oct 2009 19:15:51 +0000 (22:15 +0300)]
Return error code from rpmtsAddEraseElement() failure
- trying to remove non-installed header counts as an error

15 years agoPermit file objects and file names to ts.addInstall()
Panu Matilainen [Fri, 2 Oct 2009 18:41:41 +0000 (21:41 +0300)]
Permit file objects and file names to ts.addInstall()
- largely removes the need for the klunky ts.hdrFromFdno()

15 years agoPush most work of ts.addInstall() over to python
Panu Matilainen [Fri, 2 Oct 2009 18:18:27 +0000 (21:18 +0300)]
Push most work of ts.addInstall() over to python
- minimize the stuff done in C: require all arguments in final format
  and report status back with a boolean, handle everything else including
  keylist refcounting hack over to python side

15 years agoOops, missing self in bunch of calls... been too long since writing Python ;)
Panu Matilainen [Fri, 2 Oct 2009 18:14:19 +0000 (21:14 +0300)]
Oops, missing self in bunch of calls... been too long since writing Python ;)

15 years agoPush the rpmtsGetKeys() stuff over to python completely
Panu Matilainen [Fri, 2 Oct 2009 17:35:20 +0000 (20:35 +0300)]
Push the rpmtsGetKeys() stuff over to python completely
- trivially implemented in python by iterating over transaction element
  keys, we dont need no stinking extra librpm APIs for this

15 years agoAdd rpmlog() wrapper to python bindings
Panu Matilainen [Fri, 2 Oct 2009 16:19:31 +0000 (19:19 +0300)]
Add rpmlog() wrapper to python bindings

15 years agoTeach python about RPMDBI_LABEL
Panu Matilainen [Fri, 2 Oct 2009 15:55:16 +0000 (18:55 +0300)]
Teach python about RPMDBI_LABEL

15 years agoSplit rpmbuild dependencies to separate _rpmb module
Panu Matilainen [Fri, 2 Oct 2009 15:31:32 +0000 (18:31 +0300)]
Split rpmbuild dependencies to separate _rpmb module
- installers and the like dont need the pile of poo called librpmbuild for
  anything, avoid dragging it in needlessly
- import _rpmb into rpm namespace if available but dont complain if
  its not there
- arrange ts.parseSpec() compatibility on python side by dynamically
  importing _rpmb if possible

15 years agoMove ts flag & color setting to python side
Panu Matilainen [Fri, 2 Oct 2009 13:36:53 +0000 (16:36 +0300)]
Move ts flag & color setting to python side

15 years agoAdd a dummy python-level transaction set class, use it always
Panu Matilainen [Fri, 2 Oct 2009 13:18:59 +0000 (16:18 +0300)]
Add a dummy python-level transaction set class, use it always
- move the rpm.ts() vs rpm.TransactionSet() compatibility to python
- this will enable doing only the lowest level stuff in C and rest
  in python

15 years agoAdd python method for retrieving header "instance" (db recno) number
Panu Matilainen [Thu, 1 Oct 2009 12:25:01 +0000 (15:25 +0300)]
Add python method for retrieving header "instance" (db recno) number

15 years agoDeprecation tweaks
Panu Matilainen [Thu, 1 Oct 2009 12:12:06 +0000 (15:12 +0300)]
Deprecation tweaks
- use PyErr_WarnEx() for better control and leave the tracking up to python
- use PendingDeprecationWarning for now
- document the replacing functionality in the deprecation messages
- make hdr.sprintf() just an alias to hdr.format() without deprecating,
  at least for now it'd be only a gratuitous incompatible change on python side

15 years agoOops, these are mappings, not dicts...
Panu Matilainen [Thu, 1 Oct 2009 11:55:55 +0000 (14:55 +0300)]
Oops, these are mappings, not dicts...

15 years agoGeneralize python ts flags and colors set/get foo
Panu Matilainen [Thu, 1 Oct 2009 11:27:42 +0000 (14:27 +0300)]
Generalize python ts flags and colors set/get foo
- make flags, vsflags, color, prefcolor (previously not available)
  and probFilter appear as internal attributes of ts objects, each
  with their own setter/getter methods
- make the old custom set/get methods access the internal attributes instead
- keeping them "internal only" leaves room for adding further sanity
  checking and nicer interface on python side while giving direct access
  bits for those who want it
- not deprecating the old get/set methods at least yet...

15 years agoFix couple of recently introduced compiler warnings
Panu Matilainen [Thu, 1 Oct 2009 11:06:41 +0000 (14:06 +0300)]
Fix couple of recently introduced compiler warnings

15 years agoInclude structmembers.h centrally from rpmsystem-py.h
Panu Matilainen [Thu, 1 Oct 2009 10:21:44 +0000 (13:21 +0300)]
Include structmembers.h centrally from rpmsystem-py.h
- pretty much everything might need this...

15 years agoAdd API for setting preferred transaction file color
Panu Matilainen [Thu, 1 Oct 2009 08:37:45 +0000 (11:37 +0300)]
Add API for setting preferred transaction file color
- not strictly needed as it gets its default from a macro but .. shrug

15 years agoMake python ts rootDir appear as a read-only attribute
Panu Matilainen [Thu, 1 Oct 2009 08:21:58 +0000 (11:21 +0300)]
Make python ts rootDir appear as a read-only attribute
- there's no need to change the rootdir after object creation, better
  not permit at all

15 years agoAdd python getter for transaction id
Panu Matilainen [Thu, 1 Oct 2009 08:17:38 +0000 (11:17 +0300)]
Add python getter for transaction id

15 years agoEliminate python ts scriptFd kludgery
Panu Matilainen [Thu, 1 Oct 2009 07:59:53 +0000 (10:59 +0300)]
Eliminate python ts scriptFd kludgery
- make the scriptFd appear as regular attribute by providing a setter
  method for it, permit any file object to be used and allow disabling too
- readonly for now as we dont have rpmfd wrapped yet
- remove now unnecessary custom get/setattr functions

15 years agoDeprecate custom foo.count() methods, support len() instead
Panu Matilainen [Wed, 30 Sep 2009 13:45:46 +0000 (16:45 +0300)]
Deprecate custom foo.count() methods, support len() instead

15 years agoEliminate unused python ts iterator filter stuff
Panu Matilainen [Wed, 30 Sep 2009 13:10:24 +0000 (16:10 +0300)]
Eliminate unused python ts iterator filter stuff
- iterators dont take arguments so there's no convenient way to filter
  while iterating, let python users filter themselves (like they've
  always been doing)

15 years agoTake advantage of headerNextTag() in python hdr.keys()
Panu Matilainen [Wed, 30 Sep 2009 12:04:39 +0000 (15:04 +0300)]
Take advantage of headerNextTag() in python hdr.keys()
- avoids whole lotta unnecessary copying of data, we're only interested
  in tag numbers here
- dont filter out stuff - python consumers can look at i18n data too

15 years agoAdd iterator support to python header objects
Panu Matilainen [Wed, 30 Sep 2009 11:51:33 +0000 (14:51 +0300)]
Add iterator support to python header objects

15 years agoAdd alternative header iterator method
Panu Matilainen [Wed, 30 Sep 2009 11:48:19 +0000 (14:48 +0300)]
Add alternative header iterator method
- we dont always want the actual contents of the tag to be copied
  on iteration, so add an interface that returns the next tag in the
  header
- this lets callers to decide what to do with the tag and how to
  retrieve it

15 years agoAdd some flags to rpmtd creation
Panu Matilainen [Wed, 30 Sep 2009 10:05:24 +0000 (13:05 +0300)]
Add some flags to rpmtd creation
- permit disabling extension retrieval and "raw" (untranslated i18n) tags
- always use HEADERGET_ALLOC for data availability sanity

15 years agoAdd beginnings of rpmtd wrappings to python
Panu Matilainen [Wed, 30 Sep 2009 09:45:07 +0000 (12:45 +0300)]
Add beginnings of rpmtd wrappings to python
- unlike other types, store the C-level td structure directly in the
  python object, this lets us selectively expose some members directly,
  avoids having to deal with rpmtd allocation separately and as leaves
  the reference counting to python as rpmtd's aren't refcounted on C-level

15 years agoTurn hdrGetHeader() into argument parsing converter interface
Panu Matilainen [Wed, 30 Sep 2009 09:11:43 +0000 (12:11 +0300)]
Turn hdrGetHeader() into argument parsing converter interface

15 years agoSanitize getattr behavior of header objects
Panu Matilainen [Wed, 30 Sep 2009 07:33:52 +0000 (10:33 +0300)]
Sanitize getattr behavior of header objects
- when generic getattr fails, only try retrieving header tag as attribute
  if it's a valid tag
- clear any python errors if generic getattr failed
- split generating a python object from header + tag to an internal helper

15 years agoRequire expected type in PyArg_ParseTupleAndKeywords() already
Panu Matilainen [Mon, 28 Sep 2009 15:22:14 +0000 (18:22 +0300)]
Require expected type in PyArg_ParseTupleAndKeywords() already

15 years agoSupport numeric expansion in rpm.expandMacro()
Panu Matilainen [Mon, 28 Sep 2009 14:23:28 +0000 (17:23 +0300)]
Support numeric expansion in rpm.expandMacro()

15 years agoPush rpm.signalsCaught() to python level
Panu Matilainen [Mon, 28 Sep 2009 13:37:14 +0000 (16:37 +0300)]
Push rpm.signalsCaught() to python level
- only implement the bare minimum in C by adding a thin wrapper for
  rpmsqIsCaught(), the rest can easily be done in python

15 years agoImplement rpm.readHeaderFromFD() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 13:19:22 +0000 (16:19 +0300)]
Implement rpm.readHeaderFromFD() in python instead of C