platform/upstream/rpm.git
14 years agoUse rpmTag as psm scriptTag for type correctness
Panu Matilainen [Tue, 21 Sep 2010 13:39:59 +0000 (16:39 +0300)]
Use rpmTag as psm scriptTag for type correctness

14 years agoDefault to the common case wrt dir name/index tags, not relocation
Panu Matilainen [Tue, 21 Sep 2010 13:35:10 +0000 (16:35 +0300)]
Default to the common case wrt dir name/index tags, not relocation
- Avoids an unnecessary extra initialization in the common case, and
  also avoids int/enum mismatch from initializing to 0.

14 years agoMove PTOK type enum out of the sprintfToken struct
Panu Matilainen [Tue, 21 Sep 2010 13:28:34 +0000 (16:28 +0300)]
Move PTOK type enum out of the sprintfToken struct
- While legal in C++, the enum and its values are only visible within
  the scope it was declared in, making it invisible to the rest of
  the program.

14 years agoRemove bunch of double consts in librpmbuild
Panu Matilainen [Tue, 21 Sep 2010 13:18:22 +0000 (16:18 +0300)]
Remove bunch of double consts in librpmbuild

14 years agoInitialize nametag to RPMTAG_NOT_FOUND in parseRCPOT()
Panu Matilainen [Tue, 21 Sep 2010 12:55:02 +0000 (15:55 +0300)]
Initialize nametag to RPMTAG_NOT_FOUND in parseRCPOT()
- Doesn't matter what the value is, the switch (somewhat hysterically)
  makes it default to RPMTAG_REQUIRENAME in unknown cases anyway

14 years agoConst pedantry: taropts only ever points to string constants
Panu Matilainen [Tue, 21 Sep 2010 12:53:38 +0000 (15:53 +0300)]
Const pedantry: taropts only ever points to string constants

14 years agoMove expression type enum out of the struct
Panu Matilainen [Tue, 21 Sep 2010 12:38:41 +0000 (15:38 +0300)]
Move expression type enum out of the struct
- While legal in C++, the enum and its values are only visible within
  the scope it was declared in, making it invisible to the rest of
  the program.

14 years agoUse actual enum values in tag table sentinel to avoid int/enum mismatch
Panu Matilainen [Tue, 21 Sep 2010 12:25:53 +0000 (15:25 +0300)]
Use actual  enum values in tag table sentinel to avoid int/enum mismatch
- tagLoadIndex() looks for NULL in tag name, the other values aren't
  looked at so it doesn't matter...

14 years agoAdd "c++ protection" to (hopefully) all of our internal headers
Panu Matilainen [Tue, 21 Sep 2010 12:21:12 +0000 (15:21 +0300)]
Add "c++ protection" to (hopefully) all of our internal headers

14 years agoMissing c++ end marker in rpmdb_internal.h, oops
Panu Matilainen [Tue, 21 Sep 2010 12:17:46 +0000 (15:17 +0300)]
Missing c++ end marker in rpmdb_internal.h, oops

14 years agoAdd "C++ protection" to the public rpmutil.h header, oops...
Panu Matilainen [Tue, 21 Sep 2010 12:13:02 +0000 (15:13 +0300)]
Add "C++ protection" to the public rpmutil.h header, oops...

14 years agovoid stepping on toes of relatives, part 5
Panu Matilainen [Tue, 21 Sep 2010 12:11:04 +0000 (15:11 +0300)]
void stepping on toes of relatives, part 5
- Eliminate remaining (hopefully) C++ reserved keywords in rpmbuild cli tool

14 years agoAvoid stepping on toes of relatives, part 4
Panu Matilainen [Tue, 21 Sep 2010 12:08:08 +0000 (15:08 +0300)]
Avoid stepping on toes of relatives, part 4
- Eliminate remaining (hopefully) C++ reserved keywords in librpm

14 years agoAvoid stepping on toes of relatives, part 3
Panu Matilainen [Tue, 21 Sep 2010 12:07:08 +0000 (15:07 +0300)]
Avoid stepping on toes of relatives, part 3
- Eliminate remaining (hopefully) C++ reserved keywords in librpmbuild

14 years agoAvoid stepping on toes of relatives, part 2
Panu Matilainen [Tue, 21 Sep 2010 12:02:43 +0000 (15:02 +0300)]
Avoid stepping on toes of relatives, part 2
- Eliminate uses of "class" which is a reserved keyword in C++

14 years agoAvoid stepping on toes of relatives, part 1
Panu Matilainen [Tue, 21 Sep 2010 11:55:03 +0000 (14:55 +0300)]
Avoid stepping on toes of relatives, part 1
- Eliminate uses of "this" which is a reserved keyword in C++

14 years agoQueryformat string sanity in queryArgCallback()
Panu Matilainen [Tue, 21 Sep 2010 11:50:40 +0000 (14:50 +0300)]
Queryformat string sanity in queryArgCallback()
- Use our string helper functions instead of manual length calculations
  and allocations

14 years agoUse rasprintf() instead of manual alloc + sprintf()
Panu Matilainen [Tue, 21 Sep 2010 11:49:36 +0000 (14:49 +0300)]
Use rasprintf() instead of manual alloc + sprintf()

14 years agoRename tagtbl.c -> tagtbl.C
Panu Matilainen [Tue, 21 Sep 2010 11:47:46 +0000 (14:47 +0300)]
Rename tagtbl.c -> tagtbl.C
- This isn't a regular source file: its not compiled as such but only
  included from tagname.c. Rename to disambiguate, and make it similar
  to rpmhash.[CH]

14 years agoUse the macro allocator variants within librpm*
Panu Matilainen [Tue, 21 Sep 2010 11:47:14 +0000 (14:47 +0300)]
Use the macro allocator variants within librpm*

14 years agoUse _free() instead of rfree() where "return value" is assigned
Panu Matilainen [Tue, 21 Sep 2010 11:33:57 +0000 (14:33 +0300)]
Use _free() instead of rfree() where "return value" is assigned

14 years agoReturn explicit NULL from various fooFree() functions everywhere
Panu Matilainen [Tue, 21 Sep 2010 11:26:29 +0000 (14:26 +0300)]
Return explicit NULL from various fooFree() functions everywhere

14 years agoReturn typed pointers from rpmluaFree() and rpmluavFree()
Panu Matilainen [Tue, 21 Sep 2010 11:22:29 +0000 (14:22 +0300)]
Return typed pointers from rpmluaFree() and rpmluavFree()

14 years agoReturn typed pointer from headerformat cacheFree()
Panu Matilainen [Tue, 21 Sep 2010 11:19:11 +0000 (14:19 +0300)]
Return typed pointer from headerformat cacheFree()

14 years agoReturn typed pointer from freeHardLink()
Panu Matilainen [Tue, 21 Sep 2010 11:16:23 +0000 (14:16 +0300)]
Return typed pointer from freeHardLink()

14 years agoUse typed instead of void pointer for fsm dnl iterator
Panu Matilainen [Tue, 21 Sep 2010 11:14:29 +0000 (14:14 +0300)]
Use typed instead of void pointer for fsm dnl iterator
- Passing a void pointer for an internal helper function which
  casts to the destination is just ... pfff.

14 years agoUse typed instead of void pointer for fsm map iterator
Panu Matilainen [Tue, 21 Sep 2010 11:12:55 +0000 (14:12 +0300)]
Use typed instead of void pointer for fsm map iterator
- Passing a void pointer for an internal helper function which
  casts to the destination is just ... pfff.

14 years agoAdjust pgpMpiSet() dest type to match actual use
Panu Matilainen [Tue, 21 Sep 2010 11:04:44 +0000 (14:04 +0300)]
Adjust pgpMpiSet() dest type to match actual use

14 years agoError string is const char *, not void pointer
Panu Matilainen [Tue, 21 Sep 2010 11:03:43 +0000 (14:03 +0300)]
Error string is const char *, not void pointer

14 years agoAdjust internal io read, write and digest update to take buf as void pointer
Panu Matilainen [Tue, 21 Sep 2010 10:43:48 +0000 (13:43 +0300)]
Adjust internal io read, write and digest update to take buf as void pointer
- This matches ffread() and read() much better, avoiding pile of casts.
- By some stroke of genious, glibc cookie interfaces disagree with the
  other file stream protos by using char * for buf. Argh. Add explicit
  cast for the schizophrenia.

14 years agoAvoid using void pointer when we have a real type for the memfail function
Panu Matilainen [Tue, 21 Sep 2010 10:41:25 +0000 (13:41 +0300)]
Avoid using void pointer when we have a real type for the memfail function

14 years agoMove the RPMVERSION constant among its friends in depends.c
Panu Matilainen [Tue, 21 Sep 2010 10:39:25 +0000 (13:39 +0300)]
Move the RPMVERSION constant among its friends in depends.c
- Doesn't make any difference, just grouping similar goo in one spot.

14 years agostrrchr() family considered harmful, part 666
Panu Matilainen [Tue, 21 Sep 2010 10:29:01 +0000 (13:29 +0300)]
strrchr() family considered harmful, part 666
- strrchr() was silently casting away a const on a string coming
  from rpmtdGetString(). Add an explicit cast and warning/fixme commentary
  to the compressFilelist() hack which modifies (and then restores) the
  const string.

14 years agostrstr() considered harmful, part 541
Panu Matilainen [Tue, 21 Sep 2010 10:14:20 +0000 (13:14 +0300)]
strstr() considered harmful, part 541
- buf isn't const here, it's modified through pointer acquired through
  strstr() which silently casts away the const.

14 years agoUse RPMTAG_NOT_FOUND instead of for "invalid tag" value
Panu Matilainen [Tue, 21 Sep 2010 10:11:56 +0000 (13:11 +0300)]
Use RPMTAG_NOT_FOUND instead of for "invalid tag" value

14 years agoMove RPMTAG_NOT_FOUND into rpmTag enumeration
Panu Matilainen [Tue, 21 Sep 2010 10:02:53 +0000 (13:02 +0300)]
Move RPMTAG_NOT_FOUND into rpmTag enumeration
- Permits presenting "invalid tag" cleanly via the rpmTag enum type
  on function returns etc

14 years agoMove rpmHeaderTagFunc() a bit to avoid unnecessary forward declaration
Panu Matilainen [Tue, 21 Sep 2010 09:49:46 +0000 (12:49 +0300)]
Move  rpmHeaderTagFunc() a bit to avoid unnecessary forward declaration

14 years agoMove format extension table a bit to avoid unnecessary forward declaration
Panu Matilainen [Tue, 21 Sep 2010 09:45:53 +0000 (12:45 +0300)]
Move format extension table a bit to avoid unnecessary forward declaration

14 years agoUse the new tag type/return type getters everywhere
Panu Matilainen [Tue, 21 Sep 2010 09:40:33 +0000 (12:40 +0300)]
Use the new tag type/return type getters everywhere
- Instead of masking and bitfiddling all over the place, use the
  new getters to get the exact (enum) type directly. rpmTagGetType()
  is now unused within rpm but leaving around for backwards compatibility

14 years agoAdd yet more rpmTagTagTagFoo() functions
Panu Matilainen [Tue, 21 Sep 2010 09:30:05 +0000 (12:30 +0300)]
Add yet more rpmTagTagTagFoo() functions
- Two stupid new getters: one for the real tag type, and another
  for the return type. rpmTagGetType() returns both requiring bitmasking
  all over the place

14 years agoSplit tag type and return type to separate fields in tag table
Panu Matilainen [Tue, 21 Sep 2010 09:27:27 +0000 (12:27 +0300)]
Split tag type and return type to separate fields in tag table
- rpmTagType is a pure enum really, avoid mixing it up unnecessarily

14 years agoUse the enum name instead of value when generating the tagtable source
Panu Matilainen [Tue, 21 Sep 2010 09:26:23 +0000 (12:26 +0300)]
Use the enum name instead of value when generating the tagtable source
- This makes the table populated with actual enums instead of the
  numbers they present

14 years agoUse proper types for tag and format extension functions
Panu Matilainen [Tue, 21 Sep 2010 09:23:18 +0000 (12:23 +0300)]
Use proper types for tag and format extension functions
- Stuff the tag prototypes into misc.h in lack of better place
- Actually use the headerTagFooFunction prototypes instead of void *

14 years agoDifferentiate between the possible te types and iterator selector values
Panu Matilainen [Tue, 21 Sep 2010 09:15:44 +0000 (12:15 +0300)]
Differentiate between the possible te types and iterator selector values
- Transaction elements can only be of one type (hence the enum),
  but the transaction set iteration permits selecting more than
  one. Add a new typedef dummy for this purpose only.

14 years agoChange fdstat functions to take fdOpx enum to fix int/enum mismatches
Panu Matilainen [Tue, 21 Sep 2010 09:07:27 +0000 (12:07 +0300)]
Change fdstat functions to take fdOpx enum to fix int/enum mismatches

14 years agoFix up silly int/enum and type vs variable name mixups in urlPath()
Panu Matilainen [Tue, 21 Sep 2010 09:06:24 +0000 (12:06 +0300)]
Fix up silly int/enum and type vs variable name mixups in urlPath()

14 years agoUse actual rpmTags in place of the old HEADER_FOO defines everywhere
Panu Matilainen [Tue, 21 Sep 2010 08:58:08 +0000 (11:58 +0300)]
Use actual rpmTags in place of the old HEADER_FOO defines everywhere

14 years agoRename specdFlags to remove unnecessary type vs variable name confusion
Panu Matilainen [Tue, 21 Sep 2010 08:40:49 +0000 (11:40 +0300)]
Rename specdFlags to remove unnecessary type vs variable name confusion

14 years agoFix up bunch of silly int vs rpmRC return code mismatches
Panu Matilainen [Tue, 21 Sep 2010 08:37:21 +0000 (11:37 +0300)]
Fix up bunch of silly int vs rpmRC return code mismatches

14 years agoStop abusing enum typedefs for bitfield types
Panu Matilainen [Tue, 21 Sep 2010 08:10:14 +0000 (11:10 +0300)]
Stop abusing enum typedefs for bitfield types
- Enums are fine for defining the bitfield flags, but the bitfield
  itself is not an enumeration. Add a separate typedef on "rpmFlags"
  type (presenting a bitfield of flags) for all of these. Compilers
  hardly care, but the typedefs give a nice visual clue for
  us humans using these flags far away from ho^H^H definitions.

14 years agoExpel Tarjan from his nest
Panu Matilainen [Fri, 17 Sep 2010 06:03:34 +0000 (09:03 +0300)]
Expel Tarjan from his nest
- Nested functions are a gcc-extension and very non-portable. Refactor
  to eliminate the nesting by passing the "global" variables via
  a struct from detectSCCs().

14 years agoDont check source packages against installed obsoletes
Panu Matilainen [Wed, 15 Sep 2010 08:54:11 +0000 (11:54 +0300)]
Dont check source packages against installed obsoletes
- Regression originating from somewhere around commit
  781cfed0fd9c9651a2dd49175a85536f0b34b95b, obsoletes from installed
  packages were matched against the package being built.
  Building obsoleted packages needs to be possible, they could be for
  an older distro for example.

14 years agoPlug memleak from rpmSpecCheckDeps()
Panu Matilainen [Tue, 14 Sep 2010 06:44:06 +0000 (09:44 +0300)]
Plug memleak from rpmSpecCheckDeps()
- We need to call rpmtsEmpty(), not rpmtsClean() to purge the
  transaction elements in the set...

14 years agol10n: Updated Spanish (Castilian) (es) translation to 100%
Héctor Daniel Cabrera [Mon, 13 Sep 2010 15:33:00 +0000 (15:33 +0000)]
l10n: Updated Spanish (Castilian) (es) translation to 100%

New status: 744 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (www.transifex.net).

14 years agol10n: Updated Portuguese (Brazilian) (pt_BR) translation to 100%
Taylon Silmer [Mon, 13 Sep 2010 13:30:27 +0000 (13:30 +0000)]
l10n: Updated Portuguese (Brazilian) (pt_BR) translation to 100%

New status: 732 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (www.transifex.net).

14 years agoReplace dbi walking copy-slop with an internal helper function
Panu Matilainen [Mon, 13 Sep 2010 12:03:18 +0000 (15:03 +0300)]
Replace dbi walking copy-slop with an internal helper function

14 years agoRearrange newRpmdb() a bit for clarity
Panu Matilainen [Mon, 13 Sep 2010 11:16:44 +0000 (14:16 +0300)]
Rearrange newRpmdb() a bit for clarity
- Avoid allocating the structure until we know its ok.

14 years agoEliminate broken "can't happen" early return
Panu Matilainen [Mon, 13 Sep 2010 11:05:02 +0000 (14:05 +0300)]
Eliminate broken "can't happen" early return
- Opening RPMDBI_PACKAGES should indeed never fail, but if it does
  this would return way too early, leaking memory and references
  left and right. Also the dbi is rarely used for anything, only
  the rewrite mode used by markReplacedFiles() needs it, dbi
  is actually unused on dbiCclose()

14 years agoRearrange rpmdbInitIterator() a bit for clarity
Panu Matilainen [Mon, 13 Sep 2010 10:46:15 +0000 (13:46 +0300)]
Rearrange rpmdbInitIterator() a bit for clarity
- Avoid allocating the iterator until we know it's not an error.
  Doing the chaining earlier doesn't help anything here as the
  cursor used here wasn't linked to the mi at this point, and avoids
  having to free up partially initialized structure in case of errors.
- Group the mi initialization to make the actual initialization
  stand out from the (unnecessary) zeroing of the calloc()'ed struct.

14 years agoEliminate all fooUnlink() functions out of the API
Panu Matilainen [Mon, 13 Sep 2010 10:08:33 +0000 (13:08 +0300)]
Eliminate all fooUnlink() functions out of the API
- These are internal helpers only, all refcount users need to use
  fooFree() or similar for correct operation. Add fwd declarations
  where necessary to avoid moving code around unnecessarily.
- We could add these back later as aliases to fooFree() but for now,
  just get them out of the way.

14 years agoUnify header creation between headerNew() and headerLoad()
Panu Matilainen [Mon, 13 Sep 2010 10:06:31 +0000 (13:06 +0300)]
Unify header creation between headerNew() and headerLoad()
- Use internal helper instead of copy-slop code to allocate + init
  the structure

14 years agoFix some broken fooUnlink() usages
Panu Matilainen [Mon, 13 Sep 2010 10:05:55 +0000 (13:05 +0300)]
Fix some broken fooUnlink() usages
- unreferencing should always go through fooFree() which does
  the real refcounting and frees when references go out

14 years agoLift header verifying out of rpmdbNextIterator()
Panu Matilainen [Mon, 13 Sep 2010 08:25:24 +0000 (11:25 +0300)]
Lift header verifying out of rpmdbNextIterator()
- No functional changes, just splicing up the ugly function

14 years agoMinor optimizations on DBT initializations
Panu Matilainen [Mon, 13 Sep 2010 07:44:14 +0000 (10:44 +0300)]
Minor optimizations on DBT initializations
- Move the DBT key+data to local scope where possible, only bother
  zeroing them if they're actually going to be accessed.

14 years ago...and now eliminate the unnecessary pointer variables
Panu Matilainen [Mon, 13 Sep 2010 07:27:42 +0000 (10:27 +0300)]
...and now eliminate the unnecessary pointer variables
- Also check for NULL keyp in rpmdbExtendIterator() early to
  avoid unnecessary zeroing + potential segfault from strlen(NULL)

14 years agoEliminate mi_key and mi_data from match iterator structure
Panu Matilainen [Mon, 13 Sep 2010 07:16:50 +0000 (10:16 +0300)]
Eliminate mi_key and mi_data from match iterator structure
- These are not used to hold iterator state but just for temporary
  storage. Temporary data belongs to temporary variables.
- Assimilate rpmdbGrowIterator() into rpmdbExtendIterator() which
  was just (ab)using mi_key for passing arguments into rpmdbGrowIterator()
  and pass as argument instead.
- Declare local structs + pointers to them for this step to keep changes
  minimal and "obvious"

14 years agoAdd test for manifest query in testsuite
Panu Matilainen [Wed, 8 Sep 2010 10:52:30 +0000 (13:52 +0300)]
Add test for manifest query in testsuite

14 years agoFix _USE_LIBIO test
Panu Matilainen [Wed, 8 Sep 2010 10:41:03 +0000 (13:41 +0300)]
Fix _USE_LIBIO test
- Commit 05b2d979e8097d648f91c773f2535a1f6013cb79 caused the
  _USE_LIBIO test in rpmio.c to always fail as <stdio.h> wasn't included
  yet at the time of the check, causing silent fallback to not
  using libio even if actually available. Which in turn revealed
  funky other little bugs, addressed in commits
  d960e8c18764f7206ad723963f407e960dfb8ad9 and
  be3c34dd15814d70a410b6fd646a2be7de14a1b5. Ptooey.

14 years agoDifferentiate between IO-errors and non-package "error" in rpmgi foo
Panu Matilainen [Wed, 8 Sep 2010 10:31:25 +0000 (13:31 +0300)]
Differentiate between IO-errors and non-package "error" in rpmgi foo
- rpmgiLoadReadHeader() tested errno, but this isn't realiable:
  rpmgiReadHeader() didn't differentiate between IO and other errors
  properly so errno would be tested even when no errors (other than
  not being a header) were present. This could be pretty much whatever
  when no IO errors occurred in rpmgiReadHeader() but the file just
  wasn't a header. With libio errno was typically EBADF, causing the
  remaining code to execute, but without libio this happened to be
  ENOENTRY, causing a silent failure on manifest query.
- This junk needs to die, really.

14 years agoFix rpmReadPackageManifest() on non-fpio FD when libio isn't available
Panu Matilainen [Wed, 8 Sep 2010 10:01:57 +0000 (13:01 +0300)]
Fix rpmReadPackageManifest() on non-fpio FD when libio isn't available
- With libio, fdGetFILE() works on any io-type, but that's not the
  case when libio isn't available. Using fdopen() makes it work
  on both.

14 years agoTurn rpmQueryVerify() into query iterator initializer
Panu Matilainen [Tue, 7 Sep 2010 20:15:08 +0000 (23:15 +0300)]
Turn rpmQueryVerify() into query iterator initializer
- Eliminates quite a bunch of redundant error code return hoop-jumping
  and makes the iterator init + frees nicely paired all together
  inside rpmcliArgIter().

14 years agoLift the remaining oddball case out of rpmQueryVerify()
Panu Matilainen [Tue, 7 Sep 2010 20:04:12 +0000 (23:04 +0300)]
Lift the remaining oddball case out of rpmQueryVerify()
- specfile queries are handled differently from everything else,
  handle the special case in rpmcliArgIter()

14 years agoEliminate qva_mi and qva_gi from rpmQVKArguments
Panu Matilainen [Tue, 7 Sep 2010 19:52:26 +0000 (22:52 +0300)]
Eliminate qva_mi and qva_gi from rpmQVKArguments
- These are internal only stuff and have no business being exported
  in the API. Pass the iterators around in, duh, arguments as needed.

14 years agoEliminate some dozen redundant rpmcliShowMatches() calls
Panu Matilainen [Tue, 7 Sep 2010 19:39:14 +0000 (22:39 +0300)]
Eliminate some dozen redundant rpmcliShowMatches() calls
- Simply call it once at the end, its common for all the cases

14 years agoCut some extra twists from the query maze
Panu Matilainen [Tue, 7 Sep 2010 19:22:25 +0000 (22:22 +0300)]
Cut some extra twists from the query maze
- RPMQV_ALL and RPMQV_RPM do nothing but call rpmcli/giShowMatches()
  in rpmQueryVerify(), call them directly from rpmcliArgIter() instead
- Make iterator allocation + deallocation symmetric: both
  rpmcliArgIter() and rpmQueryVerify() now free what they alloced,
  rpmfooShowMatches() is a weird place for freeing

14 years agoEliminate rpmQueryVerify() from librpm API
Panu Matilainen [Tue, 7 Sep 2010 19:02:53 +0000 (22:02 +0300)]
Eliminate rpmQueryVerify() from librpm API
- This is an inconsistent oddball interface which only works for
  limited query types, "cli" level API users are better off calling
  rpmcliQuery() / rpmcliArgIter() instead

14 years agoUrk, mixed up in branches and wrong stuff getting pushed. Revert.
Panu Matilainen [Wed, 8 Sep 2010 04:48:04 +0000 (07:48 +0300)]
Urk, mixed up in branches and wrong stuff getting pushed. Revert.
- This reverts commits 9ac127c35272772e0fc862608f4bde9748862b3d and
  7abc26e300afd4da71f220db496f813571a37f5a

14 years agoBeat a little bit of sense into rpmQueryVerify()
Panu Matilainen [Tue, 7 Sep 2010 18:32:17 +0000 (21:32 +0300)]
Beat a little bit of sense into rpmQueryVerify()
- Single point of exit, assume failure
- Replace about a dozen rpmcliShowMatches() calls with one at the
  bottom.

14 years agoMark ts argument unused in bunch of query APIs
Panu Matilainen [Tue, 7 Sep 2010 18:13:34 +0000 (21:13 +0300)]
Mark ts argument unused in bunch of query APIs
- The ts argument used to be necessary and used for rpmfiNew() and spec
  query but not any more...

14 years agoEliminate rpmcliShowMatches() from librpm API
Panu Matilainen [Tue, 7 Sep 2010 17:44:59 +0000 (20:44 +0300)]
Eliminate rpmcliShowMatches() from librpm API
- This is really just an internal helper which only even works with
  limited set of queries.

14 years agoAdd bunch of verification tests to the test suite
Panu Matilainen [Tue, 7 Sep 2010 08:14:56 +0000 (11:14 +0300)]
Add bunch of verification tests to the test suite
- Basic tests for dependency, file and verifyscript error + success
  behavior.
- Using lua for verifyscript to avoid issues with empty test-root

14 years agoFix error code on verify scriptlet failure
Panu Matilainen [Tue, 7 Sep 2010 06:49:29 +0000 (09:49 +0300)]
Fix error code on verify scriptlet failure
- Verify scriptlet failures were only logged but didn't reflect error
  codes as they were considered "warn only" along with most others

14 years agol10n: Updated Polish (pl) translation to 100%
Piotr Drąg [Sat, 4 Sep 2010 06:49:44 +0000 (06:49 +0000)]
l10n: Updated Polish (pl) translation to 100%

New status: 744 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (www.transifex.net).

14 years agoAnd yet another translation update to pick up stuff moving around
Panu Matilainen [Fri, 3 Sep 2010 14:19:04 +0000 (17:19 +0300)]
And yet another translation update to pick up stuff moving around

14 years agoRip IAM_RPMDB, ie --initdb, --rebuilddb etc modes out of rpmqv.c and librpm
Panu Matilainen [Fri, 3 Sep 2010 13:57:50 +0000 (16:57 +0300)]
Rip IAM_RPMDB, ie --initdb, --rebuilddb etc modes out of rpmqv.c and librpm
- Add popt exec aliases to rpmdb for backwards compatibility
- Change test-suite to use 'rpmdb --initdb' instead of 'rpm --initdb'
  as popt exec aliases with absolute paths dont play very well
  with the test-suite, duh...

14 years agoAdd a brand new rpmdb utility for rpmdb maintenance (dejavu again)
Panu Matilainen [Fri, 3 Sep 2010 13:48:21 +0000 (16:48 +0300)]
Add a brand new rpmdb utility for rpmdb maintenance (dejavu again)
- rpmdb maintenance only requires privileges on the rpmdb directory,
  not elsewhere on the system. Splitting to separate tool allows
  finer grained SELinux policies and makes adding new db-specific
  switches saner.

14 years agoRip IAM_RPMK, ie --import and --checksig modes out of rpmqv.c + librpm
Panu Matilainen [Fri, 3 Sep 2010 13:31:13 +0000 (16:31 +0300)]
Rip IAM_RPMK, ie --import and --checksig modes out of rpmqv.c + librpm
- Add popt exec aliases to rpmkeys for backwards compatibility

14 years agoAdd a brand new rpmkeys utility for keyring operations
Panu Matilainen [Fri, 3 Sep 2010 13:09:47 +0000 (16:09 +0300)]
Add a brand new rpmkeys utility for keyring operations
- Keyring operations (adding/viewing/removing keys and verifying
  packages against a given keyring) are different from main rpm operations
  in that they only need access to the rpm keyring, and no write access
  anywhere else in the system. At the moment the rpm keyring happens
  to be the rpmdb but that's just an implementation detail that is
  likely to change sooner or later. Besides paving way to separating
  the rpm keyring from the rpmdb, splitting this to a small, separate
  utility allows limiting its required access from SELinux POV etc.
- For now, this only implements what's already in rpm: --import and
  --checksig, remaining operations like listing and manipulating
  keyring contents is left as an exercise for another day...

14 years agoFurther simplify rpmcliVerifySignatures()
Panu Matilainen [Fri, 3 Sep 2010 12:57:14 +0000 (15:57 +0300)]
Further simplify rpmcliVerifySignatures()
- Since this is a rpmcliFoo() function, we can assume rpmcliInit()
  is used and the verify disabling bits are set through the common
  rpmcliQueryFlags set, making qva argument unnecessary.

14 years agoUpdate translations again again to pick up changes from recent churn
Panu Matilainen [Fri, 3 Sep 2010 12:18:17 +0000 (15:18 +0300)]
Update translations again again to pick up changes from recent churn

14 years agoPut the rpmLookupSignature() and rpmGetPassPhrase() out of their misery
Panu Matilainen [Fri, 3 Sep 2010 12:08:01 +0000 (15:08 +0300)]
Put the rpmLookupSignature() and rpmGetPassPhrase() out of their misery

14 years agoRrrriiip the addsign/resign/delsign bits out of rpmqv.c + friends
Panu Matilainen [Fri, 3 Sep 2010 12:01:47 +0000 (15:01 +0300)]
Rrrriiip the addsign/resign/delsign bits out of rpmqv.c + friends
- Add popt exec aliases to rpmsign for backwards compatibility (dejavu...)

14 years agoAdd a brand new rpmsign utility for package signing
Panu Matilainen [Fri, 3 Sep 2010 11:40:18 +0000 (14:40 +0300)]
Add a brand new rpmsign utility for package signing
- Signing (and deleting) are different from everything else in rpm
  in that it needs very little of rpm's facilities. For example access
  to the rpmdb is not needed at all. Splitting this to a separate,
  small utility allows various possibilities, like severely limiting
  its access from SELinux POV, control of signature generation with
  cli arguments (the main rpm executable is already overcrowded with
  options). It's also the first step to allow reasonably splitting
  rpm signing to a separate package; not everybody needs to sign
  packages, yet signing support needs to drag in GPG and whatnot.
- Reimplement / refactor various librpm signature generation helpers
  into somewhat saner internal versions.

14 years agoLookup signature type from cli utility already
Panu Matilainen [Fri, 3 Sep 2010 11:03:48 +0000 (14:03 +0300)]
Lookup signature type from cli utility already
- Avoid relying on the murky rpmLookupSignatureType() foobar on
  low API level, pass the wanted tag explicitly from caller
- rpmLookupSignature(), rpmGetPassPhrase() + the bits they rely on
  are now free of users within librpm itself

14 years agorpmcliSign() only creates or deletes signatures
Panu Matilainen [Fri, 3 Sep 2010 09:02:17 +0000 (12:02 +0300)]
rpmcliSign() only creates or deletes signatures
- Lose the "this has got something to do with signatures and stuff"
  dispatcher mode, rpmcliSign() now only does what it says. It also
  doesn't need transaction set for anything. It doesn't need much
  else than files to operate on, what to do and possibly a passphrase.
  It probably will need more when rpmLookupSignatureType()
  is put out of its misery, but this'll do for now.
- Lose the now unnecessary passPhrase member from QVA_t

14 years agoSplit argv loop out of the actual signing function, sanitize args
Panu Matilainen [Fri, 3 Sep 2010 08:35:35 +0000 (11:35 +0300)]
Split argv loop out of the actual signing function, sanitize args
- The signing monster is big enough without extra loops. Also
  signing as such doesn't need any of the QVA foo, just the package,
  whether its adding or deleting and passhprase. Make it so.
- Remove some now unnecessary double cleanup of intermediate target

14 years agoSigning doesn't need transaction set, eliminate the unused argument
Panu Matilainen [Fri, 3 Sep 2010 08:18:27 +0000 (11:18 +0300)]
Signing doesn't need transaction set, eliminate the unused argument

14 years agoSplit package signing out of rpmchecksig.c
Panu Matilainen [Fri, 3 Sep 2010 08:11:55 +0000 (11:11 +0300)]
Split package signing out of rpmchecksig.c
- No functional changes, supposedly

14 years agoUse rpmcliVerifySignatures() directly from rpmqv.c main
Panu Matilainen [Fri, 3 Sep 2010 07:54:09 +0000 (10:54 +0300)]
Use rpmcliVerifySignatures() directly from rpmqv.c main

14 years agoExport the cli-level signature checking as rpmcliVerifySignatures()
Panu Matilainen [Fri, 3 Sep 2010 07:38:38 +0000 (10:38 +0300)]
Export the cli-level signature checking as rpmcliVerifySignatures()
- Signature verification is completely different from package signing,
  another step towards making rpmcliSign() do what it's named after