Panu Matilainen
fae1edeb93
Lose padding argument from formatters
...
- formatPrefix already contains the padding, just use rasprintf() on that
to get properly allocated buffer without messing with it manually
- xml format doesn't honor padding anyway so don't bother with it
2008-05-21 12:04:50 +03:00
Panu Matilainen
845eb8fc70
Avoid leaking memory on legacy header interface emulation
2008-05-21 12:04:50 +03:00
Panu Matilainen
86bd819cee
Treat all integer types as unsigned in formatting
2008-05-21 12:04:50 +03:00
Panu Matilainen
efa130cee8
Simplify xmlFormat()
...
- use rpmtdFormat() to convert all data, xmlFormat() only adds the
xml markup now
2008-05-21 12:04:50 +03:00
Panu Matilainen
9b32e58e17
Add rpmtdFormat() method and enumeration of supported formats
...
- permits formatting any rpmtd data to our supported formats over
iteration
2008-05-21 12:04:50 +03:00
Panu Matilainen
d5381c16a7
Handle RPM_CHAR_TYPE too in stringFormat()
...
- used by filestates and nothing else apparently, duh..
2008-05-21 12:04:50 +03:00
Panu Matilainen
2bfc0fad38
Add stringFormat() for barebones string representation
...
- use for everything not specifically overridden
- pushes practically all formatting out of formatValue() into formats.c
2008-05-21 12:04:50 +03:00
Panu Matilainen
f12983793e
Make formatter functions operate on rpmtd current item
...
- avoids extra abuse of the element field and simplifies things a bit
(eventually, not really yet)
2008-05-21 12:04:50 +03:00
Panu Matilainen
a40e326683
Push rpmtd a bit deeper into formatting
...
- use rpmtd methods for pulling current integer/string values
- allows collapsing string and string array handling into one case
- CHAR/INT8 type aren't handled atm, but then nothing at all uses them...
2008-05-21 12:04:50 +03:00
Panu Matilainen
91c13fbf4f
Minimally convert formatting to pass around rpmtd
2008-05-21 12:04:50 +03:00
Panu Matilainen
246c2e2be2
Remove unused datafree handling from formatValue()
...
- the data is always cached and cleared elsewhere..
2008-05-21 12:04:50 +03:00
Jindrich Novy
1a11aa6640
Ignore quotes in expression
2008-05-20 14:07:10 +02:00
Panu Matilainen
75f62d7c5f
Teach rpmtd about the raw i18n string (array) type
2008-05-19 08:27:10 +03:00
Panu Matilainen
405bbc571f
Move all i18n string munging into separate function
2008-05-17 20:15:53 +03:00
Panu Matilainen
7fedc20570
Add HEADERGET_RAW flag to disable i18n lookups
2008-05-17 09:50:39 +03:00
Panu Matilainen
89b8f53621
Push header getter flags down to internal helpers
2008-05-17 09:37:32 +03:00
Panu Matilainen
ea0cdcc0dd
Oops, thinko/typo in headerGetFlags
2008-05-17 09:28:32 +03:00
Panu Matilainen
0c75369d46
Add typedefs for header get/put flags, use instead of int
2008-05-17 09:25:04 +03:00
Panu Matilainen
7be1b1bafc
Remove unused hRET_s and HE_s definitions for good
2008-05-16 18:17:53 +03:00
Panu Matilainen
72e4b1ae7e
Use rpmTag enumeration for finding tag format func instead of names
...
- comparing strings when we only care about the tag number is waste of time
2008-05-16 18:15:08 +03:00
Panu Matilainen
019ee37f62
Eliminate rpmHeaderFormats and rpmHeaderTagExtensions from the API
2008-05-16 17:46:49 +03:00
Panu Matilainen
cbf1a479ee
Push finding of formatter and tag extension functions down to formats.c
2008-05-16 16:56:32 +03:00
Panu Matilainen
eef5417dea
Make extension formatter functions opaque
...
- tag extensions are only needed by headerGet(), formats only by headerFormat()
2008-05-16 16:26:19 +03:00
Panu Matilainen
696184533a
Eliminate the now unnecessary extension type fields
2008-05-16 16:07:41 +03:00
Panu Matilainen
44bdb776b7
Split format and tag extensions to separate tables
2008-05-16 15:55:44 +03:00
Jindrich Novy
a81863d443
Update Portugese/Brasilian RPM translation (rhbz#446795)
...
- thanks to Igor Pires Soares
2008-05-16 06:05:25 +02:00
Panu Matilainen
62f53dbc66
Dumb segfault in %posttrans
2008-05-15 18:52:18 +03:00
Panu Matilainen
504ff9ce06
Unbreak conditional formatting
2008-05-15 18:28:50 +03:00
Panu Matilainen
7df706ac16
Let rpmtdFreeData() do it's job...
2008-05-15 17:17:45 +03:00
Panu Matilainen
aaa93e9008
Don't look into extensions when adding tags to python
...
- tagtable knows all our extensions too, there's no need to
2008-05-15 15:24:16 +03:00
Panu Matilainen
a06b172d8d
Change headerTagTagFunction() to take tag container as arg
...
- minimal, crude conversion of all formatTag() functions for now
2008-05-15 15:13:03 +03:00
Panu Matilainen
25edcbcf4b
Minimal conversion of in-rpm python bindings to new headerGet()
...
- hopefully preserving legacy quirks and all...
2008-05-15 14:55:59 +03:00
Panu Matilainen
5198c91280
Eliminate unnecessary extension fields
...
- push default extensions yet deeper into format parsing
- single bounds-checked function to retrieve from cache
2008-05-15 13:42:12 +03:00
Panu Matilainen
6f18834d4e
Permit tags down to HEADER_IMAGE in queries to match previous behavior
2008-05-15 12:27:20 +03:00
Panu Matilainen
445671ee82
Unify header and extension tag handling of headerFormat()
...
- retrieve both header and extension tag data through headerGet,
- cache the return data for both types for an enormous speedup especially
for array types
2008-05-15 12:04:17 +03:00
Panu Matilainen
91540f5359
Convert rpmtsAddInstallElement() to new headerGet()
2008-05-15 08:01:45 +03:00
Panu Matilainen
bbb566a261
Commentary fixes
...
- "return" is not our registered trademark :)
- document the intent to make rpmtd opaque
2008-05-14 15:08:40 +03:00
Panu Matilainen
65100c8e1d
Teach headerGet() to retrieve extension tags if enabled with flags
...
- bit of a kludgery until fooTag() formatters have been converted
to take rpmtd struct as argument
- idea lifted from rpm5.org, implemented independently (and probably quite
differently)
2008-05-14 14:36:36 +03:00
Panu Matilainen
b94a187adc
Simplify rpmDisplayQueryTags()
...
- all relevant tags are now visible in tagtable, don't bother looking up
extensions separately
2008-05-14 13:26:58 +03:00
Panu Matilainen
7bb210e0af
Teach rpm tag table about extensions
...
- add rpmTag_e enumerations for all extension tags
- add extension field to headerTagTableEntry_s for things that are "pure"
extensions (instead of just extension overrides) so we have a chance to
catch out anybody trying to insert such tags to headers
2008-05-14 13:20:46 +03:00
Panu Matilainen
c0bdbb0946
Convert headerRegenSigHeader() to new header iterator interface
2008-05-14 10:29:07 +03:00
Panu Matilainen
df23089b1f
Convert headerMergeLegacySigs() to new header iterator interface
2008-05-14 10:20:56 +03:00
Panu Matilainen
c66f0b5008
Convert file color calculation in rpmfcGenerateDepends() to new interface
2008-05-14 09:46:04 +03:00
Panu Matilainen
b31eef9e9b
Convert headerGetColor() to use new headerGet() interface
2008-05-14 09:31:24 +03:00
Panu Matilainen
7e0f6408ba
Convert addTE() to new headerGet() interface
...
- streamline things a bit while at it...
2008-05-14 09:20:51 +03:00
Panu Matilainen
49a892fae1
Convert rpmteNew() to use new headerGet() interface
2008-05-14 09:12:40 +03:00
Panu Matilainen
abbf9a2c8d
Simplify rpmInstallLoadMacros() a bit
...
- use new style headerGet() and let rpmtd work out the string presentation
2008-05-13 18:12:13 +03:00
Panu Matilainen
30c4e29d33
Add some more rpmtd access methods
...
- rpmtdGetUint() for 16 and 32 bit integer types, similar to
rpmtdGetString() (equally usable with scalar types and arrays)
- rpmtdToString() which converts "any" header data into string presentation
2008-05-13 18:09:35 +03:00
Panu Matilainen
e7ec2339b4
Convert runInstScript() to use new style headerGet()
...
- simplifies things quite a bit when we can just iterate over the
prog arg container, no matter if it's string or string array
2008-05-13 17:35:32 +03:00
Panu Matilainen
2d0a4329bd
Simplify prefix shuffling in psm runScript()
...
- use new style headerGet() and pass the entire tag container down to
doScriptExec(), removing need for big bunch of local variables
- use rpmtd (iterator) methods for processing the prefixes in doScriptExec(),
it does the right thing for legacy non-array RPMTAG_INSTALLPREFIX too
2008-05-13 17:10:42 +03:00