Commit Graph

10959 Commits

Author SHA1 Message Date
Ville Skyttä bcad08867d Add lzip support.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-29 08:48:56 +03:00
Panu Matilainen fe8d88872b Remove duplicate fpLookup() doxygen annotation 2011-04-28 15:24:09 +03:00
Panu Matilainen 44ce440509 Remove redundant strlen()'s on sha1 digest verification
- string comparison notices different length anyway, avoid going
  through the same data twice
2011-04-28 15:24:09 +03:00
Panu Matilainen 60bb36b90c Avoid malloc() + redundant strlen() calls in dbiFindByLabel() 2011-04-28 15:24:09 +03:00
Jindrich Novy ffae32e463 Simplify findTag() 2011-04-28 13:22:41 +02:00
Jindrich Novy b19a896ecd Fix find-lang so that it finds *@*.qm QT i18n files (RhBug:699945) 2011-04-27 10:28:43 +02:00
Jindrich Novy 7b352a1de2 Understand 'PK00' zip archives (RhBug:699529)
- it is historically used by PKZIP when storing archive to removable
  media (floppy), some java apps still use it
- thanks to Karel Klic
2011-04-26 06:33:19 +02:00
Jindrich Novy 756aea37fe Do not compile unused functions when SELinux support is disabled 2011-04-22 09:30:45 +02:00
Panu Matilainen eada0e3e47 Handle errors from moving target file into place in rpmSign()
- Signing isn't successful unless we manage to replace the original
  file with the signed one, take the stat() etc returns into count.
2011-04-21 11:09:28 +03:00
Panu Matilainen e393393ff7 headerPut() and headerDel() returns aren't interesting here 2011-04-21 10:55:00 +03:00
Panu Matilainen c798aed743 Remove redundant indentation block from rpmSign()
- No code changes, just formatting sanity/prettiness
2011-04-21 10:48:42 +03:00
Panu Matilainen 96c4f818a5 Just ignore miFreeHeader() return on rpmdbNextIterator() too
- There's no meaningful way to return a write-error here,
  rpmdbNextIterator() caller wouldn't know whether NULL at termination
  is early due to error or not. So just ignore the return from
  miFreeHeader(), it can only fail on rewrite mode (ie markReplacedFiles())
  so impact is rather limited anyway.
2011-04-21 10:44:09 +03:00
Panu Matilainen 29fffe9aa5 Ignore dbiSync() return code everywhere
- Since we're not checking the return then dont bother storing it either.
  The sync is fairly unlikely to fail if other operations succeed
  as sync failures generally revolve around invalid file descriptors etc.
2011-04-21 10:03:11 +03:00
Panu Matilainen 3336259e0f Oops, thinko/typo in commit 8215e17c24 2011-04-20 16:11:41 +03:00
Panu Matilainen 70ca20161b Remove pointless xx tmp return code from dbiAppendSet() result 2011-04-20 15:51:04 +03:00
Panu Matilainen 909d3cdc92 Eliminate last three assert()'s from the backend
- We can trivially handle these "can't happen" cases as EINVAL returns
  instead of blowing up, do so.
2011-04-20 15:46:42 +03:00
Panu Matilainen 7d7a9a24b6 And finally at six feet, the old cursor api is officially dead
- Inline the last remains into the new api, handling NULL pointers
  more gracefully than the old version
2011-04-20 15:46:36 +03:00
Panu Matilainen e05e92d4ed And another foot deeper...
- Inline dbiGet(), dbiPut(), dbiDel() and dbiCount() implementations
  to the new interface
2011-04-20 15:46:32 +03:00
Panu Matilainen d8d63645a0 Bury the old cursor api one foot deeper
- Make it static and move doxygen bits to the new API, adjust as necessary
2011-04-20 15:46:24 +03:00
Panu Matilainen 8215e17c24 Convert the other (rpmdb iterators etc) uses to the new cursor api 2011-04-20 15:45:55 +03:00
Panu Matilainen 3d82d922ef Convert local-only uses of DBC to dbiCursor interface 2011-04-20 14:23:37 +03:00
Panu Matilainen fb548c0612 Add a db cursor abstraction and interfaces for using it
- Callers are currently required to pass all sorts of unnecessary
  gunk to the cursor operations just for performance statistics
  etc, and the interface doesn't match the uses inside rpmdb.c
  very well. This adds a more "rpm-style" interface around the
  BDB API.
- Cursor open + close can only fail on invalid arguments (which would
  be programmer errors), and various conditions on replication which
  we dont care about. So we essentially ignore the errors, except
  for cursor open which will return NULL to indicate an error.
- As an intermediate step, these are just wrappers to the older
  dbiFoo interfaces to permit converting things to the new interfaces
  piece by piece.
2011-04-20 14:04:17 +03:00
Panu Matilainen 9ae37ce58a Rename _dbConfig and _dbiIndex structs to common foo_s style
- No functional changes, just renaming to be in line with everything
  else (for better or worse)
2011-04-20 13:23:57 +03:00
Panu Matilainen 0f112aa9f9 Remove non-cursor support from dbiDel(), dbiPut() and dbiGet()
- Previously these functions would silently fall back to non-cursor
  access when (accidentally) called with NULL cursor. This can lead
  to different results for cases where cursor is actually required,
  without any indication of it being an error. Make them fail
  with EINVAL for NULL cursors so it gets trapped in rpmdb.c uses.
2011-04-20 13:18:54 +03:00
Panu Matilainen be40e1fb92 Return explicit NULL's from db iterator free functions for clarity 2011-04-19 14:55:43 +03:00
Panu Matilainen 7ba2c62fb3 Ignore error codes in rpmdbIndexIteratorFree()
- Similarly to commit b35081600135b4a3d54fa7e832125a89d3bdee48,
  we can't do anything about dbiCclose() failure here, just ignore.
2011-04-19 14:55:43 +03:00
Panu Matilainen 149d9a84b3 Ignore error codes in rpmdbFreeIterator()
- We can't do anything about miFreeHeader() or dbiClose() errors
  here, no point storing them to temp variable either. Error on
  miFreeHeader() will at least log something on header rewrite-failure.
2011-04-19 14:55:43 +03:00
Jindrich Novy e0c941ab51 Attempt to fetch sources/patches when they are missing from %_sourcedir
- use _default_source_url macro to specify default URL when it is
  missing from the spec Source/Patch line
- this feature can be disabled by defining _disable_source_fetch to 1
2011-04-19 13:24:34 +02:00
Panu Matilainen 7ea4fcd87f Give at least some indication of error from fchdir() failures
- Failure to return to current dir is likely to be lethal, at least
  log an error and return a different code for it.
2011-04-19 13:21:36 +03:00
Panu Matilainen b2abe49578 Use rpmsqFork() return code instead of semi-private struct member for pid
- rpmsqFork() behaves like regular fork() in this regard so this
  just makes the code more obvious and eliminates an set-but-unused
  warning while at it.
2011-04-19 13:09:53 +03:00
Panu Matilainen 6e731e2832 Fclose() and unlink() errors aren't fatal here, just ignore 2011-04-19 13:04:28 +03:00
Panu Matilainen 6f75f9e764 Catch write errors when generating scriptlet temporary files
- If the write fails scripts are likely to fail anyway, but executing
  partial scriptlets (unlikely as that might be) could have funny
  side-effects besides just failing.
- Also cleans up runExtScript() a little bit by moving the
  tmp file creation to a separate function.
2011-04-19 13:02:51 +03:00
Panu Matilainen 3eb92ff6d3 Improve fsm error code handling in psm
- Move the fsm execution to separate helper function, returning
  the most relevant exit code: if fsmSetup() failed then teardown
  return doesn't matter, but fsmTeardown() can report errors
  from missing hardlinks which we haven't checked until now.
- This also fixes enum vs int abuse on the exit code: fsm return
  codes are cpio error codes whereas psm codes are simple ok/fails.
2011-04-19 11:37:11 +03:00
Panu Matilainen 643626a32e Actually handle headerGet() / pgpPrtPkts() failure on signature verify
- Failure to decode the hash algo here would probably trip up something
  later on in the verification but...
2011-04-19 10:32:31 +03:00
Panu Matilainen 92ccb5f822 Eliminate unused variable in rpmpluginsAdd()
- dlsym() can return NULL without it being an error, and since we
  use dlerror() for determining the error anyway, supportedHooks
  is simply unneeded here.
2011-04-19 10:21:26 +03:00
Panu Matilainen e4124b0806 Restore previous vsflags on return from rpmInstall() and rpmErase()
- Nobody is going to care really but since we bother remembering
  them we might as well restore them too, silencing another two
  set-but-unused warnings (this time semi-meaningful even)
2011-04-19 10:09:22 +03:00
Panu Matilainen b45622b5b9 Eliminate another set-but-unused xx warning
- There's no meaningful way to return error from rpmdbExtendIterator()
  in rpmFindBaseNamesInDB() so dont bother collecting the result.
  At least there'll be rpmlog spew on errors so it wouldn't be
  silently failing.
2011-04-19 10:02:23 +03:00
Panu Matilainen f6579c0ac3 Reflect file classifier errors in rpmdeps exit code
- rpmfcClassify() or rpmfcApply() failing is pretty fatal to rpmdeps,
  exit with error code
- OTOH argvAdd() and argvSort() can't really fail, ignore their return
  codes, shutting up another set-but-not-used whine
2011-04-18 12:25:43 +03:00
Panu Matilainen a1ea30c5c7 Remove yet another pointless tmp variable
- Since we're not really interested in rpmdbClose() or
  rpmdbRemoveDatabase() error codes when rebuilding, just ignore
  their returns
2011-04-18 12:08:24 +03:00
Panu Matilainen b021491203 Collect proper exit status from rpmdbRemoveDatabase()
- The single caller doesn't actually care about its exit code
  as its not particularly important in that case but .. shrug,
  at least it silences a warning.
2011-04-18 12:04:34 +03:00
Panu Matilainen 0d0ccea1f3 Ignore rpmdbClose() return on failed rpmdbOpen()
- We can't do anything about it so just ignore and remove the
  unused variable
2011-04-18 12:00:44 +03:00
Panu Matilainen 1a89593cd0 Clean up urlGetFile() return values
- Its callers only care about success vs failure, so only ever return
  0 or -1 and take waitpid() errors into account too. As a side effect
  shuts up a set-but-unused compiler warning too
2011-04-18 10:20:19 +03:00
Panu Matilainen ac524256f7 Remember to free db index iterators too on forced termination 2011-04-15 10:36:21 +03:00
Panu Matilainen 3544062a6e Fix dangling databases from iterators (ticket #820)
- Call rpmdbClose() instead of rpmdbUnlink() on iterator free to
  actually close the db when refcount goes to zero. This
  fixes the situation where a caller closes a database handle
  while iterators are active: the iterators stay usable and close
  the db when the last one exits.
2011-04-15 10:11:41 +03:00
Panu Matilainen dcf650f5a7 Only muck with signals on first and last db open/close
- Signals are per-process global, as long as there are other
  databases open (or references to the same db) we shouldn't mess
  with them. Less important on open, but if somebody is changing
  rpmsq-handling we shouldn't override that either.
2011-04-15 09:18:15 +03:00
Ville Skyttä 2511b09679 Extract perl dependecies from "use parent qw(Foo)".
parent is a successor to base, with similar functionality.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-13 14:53:08 +03:00
Ville Skyttä 6331fec6e4 Honor $TMPDIR in various scripts.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-04-13 14:49:36 +03:00
Panu Matilainen 76bc4429c2 Unbreak obsoletes from commit b1a4b57315
- rpmdsMatchesDep() only works with RPMDBI_PROVIDES, not RPMDBI_NAME.
  Revert that part of the change.
2011-04-13 10:07:33 +03:00
Panu Matilainen 077d2c850c Dont reference transaction set from transaction elements
- Elements referencing ts prevents rpmtsFree() from freeing anything
  unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
  from commit 8f7c2d7063.
2011-04-05 17:33:12 +03:00
Jindrich Novy 94fb6eed6a Don't list packages which will not be created in spec query (RhBug:693338)
- particularly, while doing "rpm -q --specfile <a spec file>"
2011-04-04 16:03:11 +02:00