Panu Matilainen [Fri, 2 Oct 2009 13:36:53 +0000 (16:36 +0300)]
Move ts flag & color setting to python side
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
Panu Matilainen [Thu, 1 Oct 2009 12:25:01 +0000 (15:25 +0300)]
Add python method for retrieving header "instance" (db recno) number
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
Panu Matilainen [Thu, 1 Oct 2009 11:55:55 +0000 (14:55 +0300)]
Oops, these are mappings, not dicts...
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...
Panu Matilainen [Thu, 1 Oct 2009 11:06:41 +0000 (14:06 +0300)]
Fix couple of recently introduced compiler warnings
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...
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
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
Panu Matilainen [Thu, 1 Oct 2009 08:17:38 +0000 (11:17 +0300)]
Add python getter for transaction id
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
Panu Matilainen [Wed, 30 Sep 2009 13:45:46 +0000 (16:45 +0300)]
Deprecate custom foo.count() methods, support len() instead
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)
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
Panu Matilainen [Wed, 30 Sep 2009 11:51:33 +0000 (14:51 +0300)]
Add iterator support to python header objects
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
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
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
Panu Matilainen [Wed, 30 Sep 2009 09:11:43 +0000 (12:11 +0300)]
Turn hdrGetHeader() into argument parsing converter interface
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
Panu Matilainen [Mon, 28 Sep 2009 15:22:14 +0000 (18:22 +0300)]
Require expected type in PyArg_ParseTupleAndKeywords() already
Panu Matilainen [Mon, 28 Sep 2009 14:23:28 +0000 (17:23 +0300)]
Support numeric expansion in rpm.expandMacro()
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
Panu Matilainen [Mon, 28 Sep 2009 13:19:22 +0000 (16:19 +0300)]
Implement rpm.readHeaderFromFD() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 13:07:09 +0000 (16:07 +0300)]
Implement rpm.readHeaderListFromFD() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 11:50:33 +0000 (14:50 +0300)]
Implement rpmreadHeaderListFromFile() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 10:48:19 +0000 (13:48 +0300)]
A few cases of Py_RETURN_NONE missed on the first round
Panu Matilainen [Mon, 28 Sep 2009 10:30:28 +0000 (13:30 +0300)]
Arrange rpm.headerLoad() compatibility on python level
Panu Matilainen [Mon, 28 Sep 2009 08:09:32 +0000 (11:09 +0300)]
OSGi dependency generator fixes from Alphonse Van Assche (ticket #101)
- This patch fix some minor bug, remove unused code and increase drastically
the perf by threading execution of tasks and using zip command instead of
jar to get meta-data
Panu Matilainen [Thu, 24 Sep 2009 10:57:55 +0000 (13:57 +0300)]
Enable subtyping on the rest of our type-objects
- not very useful atm as various places return hard-wired built-in types
Panu Matilainen [Thu, 24 Sep 2009 10:40:44 +0000 (13:40 +0300)]
Eliminate all custom tp_free() type methods
- tp_free()'s purpose is only to free up the memory used by the python
object structure, cleaning up our own allocations belongs to tp_dealloc()
Panu Matilainen [Thu, 24 Sep 2009 10:19:20 +0000 (13:19 +0300)]
Enable subtyping on rpm.ts class
Panu Matilainen [Thu, 24 Sep 2009 10:05:36 +0000 (13:05 +0300)]
Call generic python setattr if not scriptFd
- yet more preliminaries for subtyping
Panu Matilainen [Thu, 24 Sep 2009 10:04:34 +0000 (13:04 +0300)]
tp_setattro() is supposed to return -1 on errors
Panu Matilainen [Thu, 24 Sep 2009 09:52:32 +0000 (12:52 +0300)]
Call (sub)type tp_free from destructors
- more preliminaries for subtyping
- remove pointless NULL checks
Panu Matilainen [Thu, 24 Sep 2009 08:42:17 +0000 (11:42 +0300)]
Make object allocation type agnostic
- pass (sub)type down to wrappers
- call subtype tp_alloc() instead of PyObject_New()
- preliminaries for allowing subtyping
Panu Matilainen [Wed, 23 Sep 2009 14:44:07 +0000 (17:44 +0300)]
Remove unnecessary header type checking
- the type is already validated by PyArg_ParseTupleAndKeywords(),
no need to doublecheck
Panu Matilainen [Wed, 23 Sep 2009 11:41:30 +0000 (14:41 +0300)]
Remove the broken tp_print method from spec
Panu Matilainen [Wed, 23 Sep 2009 11:21:13 +0000 (14:21 +0300)]
Decouple python spec objects from transaction objects
- ts structure is only necessary for hysterically passing back the
parse result from parseSpec(), hide this in the bindings
- deprecate ts.parseSpec() for later ripping
Panu Matilainen [Wed, 23 Sep 2009 10:12:43 +0000 (13:12 +0300)]
Oops, binary data can and should be presented as python strings
Panu Matilainen [Wed, 23 Sep 2009 09:49:15 +0000 (12:49 +0300)]
Add rpmtd to python object converter, change header code to use that
- vastly simpler than the former goo in hdr_subscribe
Panu Matilainen [Wed, 23 Sep 2009 09:28:47 +0000 (12:28 +0300)]
Turn tagNumFromPyObject() into an object converter interface
- permits direct validation and conversion from arg parsing
Panu Matilainen [Wed, 23 Sep 2009 09:05:02 +0000 (12:05 +0300)]
Turn rpmFdFromPyObject() into an object converter interface
- permits direct validation and conversion from arg parsing
Panu Matilainen [Wed, 23 Sep 2009 08:51:55 +0000 (11:51 +0300)]
Permit any file object in rpm.readHeaderListFromFD()
Panu Matilainen [Wed, 23 Sep 2009 08:42:59 +0000 (11:42 +0300)]
Permit file objects in python header constructor
Panu Matilainen [Wed, 23 Sep 2009 08:41:20 +0000 (11:41 +0300)]
Add write() method to python headers
Panu Matilainen [Wed, 23 Sep 2009 08:10:38 +0000 (11:10 +0300)]
Accept any file object in ts.hdrFromFdno()
Panu Matilainen [Wed, 23 Sep 2009 08:09:19 +0000 (11:09 +0300)]
Add helper to convert python file objects to rpmio FD_t type
Panu Matilainen [Wed, 23 Sep 2009 07:49:47 +0000 (10:49 +0300)]
Add te.NEVRA() method, adjust docs
Panu Matilainen [Wed, 23 Sep 2009 07:44:41 +0000 (10:44 +0300)]
Remove tp_print methods from all rpm-python objects
- these violate the intended use of tp_print, python docs state
"A type should never implement tp_print in a way that produces
different output than tp_repr or tp_str would."
Panu Matilainen [Wed, 23 Sep 2009 07:39:40 +0000 (10:39 +0300)]
Lose the debug junk from python bindings
Panu Matilainen [Wed, 23 Sep 2009 07:31:46 +0000 (10:31 +0300)]
Add hdr.format(), deprecate hdr.sprintf()
- sprintf() is a C'ism and format() is closer to current librpm anyway
Panu Matilainen [Wed, 23 Sep 2009 07:19:46 +0000 (10:19 +0300)]
Make fiFromHeader() static inside header-py, deprecate
Panu Matilainen [Wed, 23 Sep 2009 07:11:45 +0000 (10:11 +0300)]
Deprecate rpm.headerLoad()
- this is not needed now, just call rpm.hdr(<blob) to load
Panu Matilainen [Wed, 23 Sep 2009 06:56:08 +0000 (09:56 +0300)]
Deprecate header filelist munging methods
- hdr.convert() is the generic way, the old stuff is not needed anymore
- macro to issue warnings just once
Panu Matilainen [Wed, 23 Sep 2009 06:27:47 +0000 (09:27 +0300)]
Eliminate unnecessary function
Panu Matilainen [Wed, 23 Sep 2009 06:24:23 +0000 (09:24 +0300)]
Permit headerConvert() from python
Panu Matilainen [Wed, 23 Sep 2009 06:03:25 +0000 (09:03 +0300)]
Add has_key() method to header object
Panu Matilainen [Wed, 23 Sep 2009 05:51:12 +0000 (08:51 +0300)]
Add support for creating new header objects
- without arguments, rpm.hdr() creates an empty header
- with another header as argument, make a copy
- string argument is considered an unloaded header blob and copy-loaded
Panu Matilainen [Wed, 23 Sep 2009 05:41:03 +0000 (08:41 +0300)]
Rpm's allocators dont return on OOM, remove unnecessary check
Panu Matilainen [Tue, 22 Sep 2009 21:06:13 +0000 (00:06 +0300)]
Add type checking macros for all rpm python type objects
Panu Matilainen [Tue, 22 Sep 2009 20:02:47 +0000 (23:02 +0300)]
Rename python system.h for disambiguation
Panu Matilainen [Tue, 22 Sep 2009 19:42:06 +0000 (22:42 +0300)]
Lose the empty doxygen markers
- nothing wrong with comments but empty comment placeholders
are not exactly useful
Panu Matilainen [Tue, 22 Sep 2009 18:53:21 +0000 (21:53 +0300)]
Put some consistency to python object creation
- all type object creation goes through foo_Wrap() which handle OOM
and all type specific initialization
Panu Matilainen [Tue, 22 Sep 2009 18:24:55 +0000 (21:24 +0300)]
Make all python object creation wrappers return PyObject pointers
- this way the only place where casts are needed are in the wrapper itself
Panu Matilainen [Tue, 22 Sep 2009 18:01:01 +0000 (21:01 +0300)]
Dont leak memory on rpm.ds iteration
Panu Matilainen [Tue, 22 Sep 2009 17:50:41 +0000 (20:50 +0300)]
Lose unnecessary next() methods
- python adds next() methods for objects supporting iterators
Panu Matilainen [Tue, 22 Sep 2009 17:20:07 +0000 (20:20 +0300)]
All rpm-python iterators are self-iterators, just use PyObject_SelfIter
Panu Matilainen [Tue, 22 Sep 2009 16:55:34 +0000 (19:55 +0300)]
Dont leak memory from rpm.dsSingle()
Panu Matilainen [Tue, 22 Sep 2009 16:44:59 +0000 (19:44 +0300)]
Simplify fiFromHeader()
- just call the fi object, no need to manually redo all this stuff
Panu Matilainen [Tue, 22 Sep 2009 16:42:53 +0000 (19:42 +0300)]
Simplify dsFromHeader()
- just call the ds object, no need to manually redo all this stuff
Panu Matilainen [Tue, 22 Sep 2009 16:19:02 +0000 (19:19 +0300)]
Sanitize python object -> tag number exception handling
- raise exception in tagNumFromPyObject(), not in 12 different callers
- check against RPMTAG_NOT_FOUND consistently instead of -1 and whatnot
- unknown tags are value, not key or type errors
Panu Matilainen [Tue, 22 Sep 2009 15:55:09 +0000 (18:55 +0300)]
Move allocations out of rpmps object init method
- tp_init can be called several times, allocating from there leaks memory
- tp_init gets called automatically on object creation, dont call manually
- nothing to initialize for rpmps...
Panu Matilainen [Tue, 22 Sep 2009 15:53:15 +0000 (18:53 +0300)]
Move allocations out of rpmds object init method
- tp_init can be called several times, allocating from there leaks memory
- tp_init gets called automatically on object creation, dont call manually
Panu Matilainen [Tue, 22 Sep 2009 15:50:32 +0000 (18:50 +0300)]
Move allocations out of rpmfi object init method
- tp_init can be called several times, allocating from there leaks memory
- tp_init gets called automatically on object creation, dont call manually
Panu Matilainen [Tue, 22 Sep 2009 15:22:50 +0000 (18:22 +0300)]
Remove useless rpmts python initialization
Panu Matilainen [Tue, 22 Sep 2009 15:17:49 +0000 (18:17 +0300)]
Realize the remaining bits of direct rpmdb interface are dead too
- the code hasn't been enabled in a long long time despite being built...
Panu Matilainen [Tue, 22 Sep 2009 14:49:53 +0000 (17:49 +0300)]
Use Py_RETURN_NONE macro for returning None everywhere
Panu Matilainen [Tue, 22 Sep 2009 14:33:07 +0000 (17:33 +0300)]
Eliminate unnecessary custom object allocation functions
- these are just calling python defaults, no point at all...
Panu Matilainen [Tue, 22 Sep 2009 14:27:44 +0000 (17:27 +0300)]
Use generic python get/set attribute functions directly where appropriate
- no point in wrapping all this stuff in our own functions
Panu Matilainen [Tue, 22 Sep 2009 14:12:22 +0000 (17:12 +0300)]
Python initialization spring clean
- split rpmtag enum additions to seprate function
- PyModule_AddIntConstant() does exactly what we need for the rest
Panu Matilainen [Tue, 22 Sep 2009 13:47:07 +0000 (16:47 +0300)]
Make the python object structures opaque
Panu Matilainen [Tue, 22 Sep 2009 13:39:39 +0000 (16:39 +0300)]
Lose the utterly broken rpmio FD_t wrappers
Panu Matilainen [Tue, 22 Sep 2009 13:36:48 +0000 (16:36 +0300)]
Lose the useless python debug stuff
Panu Matilainen [Tue, 22 Sep 2009 13:28:58 +0000 (16:28 +0300)]
We dont support ancient python versions...
Panu Matilainen [Tue, 22 Sep 2009 13:24:32 +0000 (16:24 +0300)]
Kick out mummified rpmdb python interface remnants
Panu Matilainen [Tue, 22 Sep 2009 13:02:39 +0000 (16:02 +0300)]
Missing <string.h> include
Panu Matilainen [Tue, 22 Sep 2009 12:36:11 +0000 (15:36 +0300)]
Clean up + fix bad recno erasure in python ts.addErase()
- now that we can loop over RPMDBI_PACKAGES matches, the code can
be simplified quite a bit
- walk through the iterator always to get a reliable installed status,
previously ts.addErase() with bad record number wouldn't raise exception
Panu Matilainen [Tue, 22 Sep 2009 11:53:56 +0000 (14:53 +0300)]
Remove no longer necessary RPMDBI_PACKAGES special casing
Panu Matilainen [Tue, 22 Sep 2009 11:52:57 +0000 (14:52 +0300)]
Fix endless loop on RPMDBI_PACKAGES iteration when offset specified
Panu Matilainen [Tue, 22 Sep 2009 09:32:02 +0000 (12:32 +0300)]
Unbreak --tid and --querybynumber
- broken ages ago somewhere between 4.4.x and 4.6.x by typing changes
presumably
- C99 strtoul() can figure the base on its own, remove unnecessary work
Panu Matilainen [Tue, 22 Sep 2009 07:21:47 +0000 (10:21 +0300)]
DB_INCOMPLETE was removed in BDB 4.1 and we dont support older versions
Panu Matilainen [Tue, 22 Sep 2009 06:26:39 +0000 (09:26 +0300)]
Remove ancient, unused code to filter duplicates on rpmdb rebuild
- enabling this as-is would be murderous to multilib systems
- getting duplicates in the db would be a bug elsewhere
Panu Matilainen [Mon, 21 Sep 2009 11:36:59 +0000 (14:36 +0300)]
Rip out dependency caching
- it doesn't speed up things that much, is broken in some chroot
scenarios and is ugly ugly hardwired BDB hackery where it doesn't belong
Panu Matilainen [Mon, 21 Sep 2009 11:04:34 +0000 (14:04 +0300)]
Move rpmdb home creation from backends to one level higher
- this is a common operation for any backends, avoid duplication
- only try to create it once instead of every index open, and if it
doesn't exist and cant be created, error out instead of trying to continue
in vain
Panu Matilainen [Mon, 21 Sep 2009 11:00:46 +0000 (14:00 +0300)]
Add an internal API for getting rpmdb home wrt chroot state, use it
Panu Matilainen [Mon, 21 Sep 2009 08:59:25 +0000 (11:59 +0300)]
Remove pointless per-index api version
Panu Matilainen [Mon, 21 Sep 2009 08:36:16 +0000 (11:36 +0300)]
DB config stuff not needed outside dbconfig.c, make them static
- additionally make the popt struct const since it can...
Panu Matilainen [Mon, 21 Sep 2009 08:32:43 +0000 (11:32 +0300)]
BDB is not optional at least currently, remove useless ifdefs