Commit Graph

9370 Commits

Author SHA1 Message Date
Panu Matilainen 28919a1677 Have BDB use our allocation routines now that we can
- rfree() prototype doesn't match free() but it doesn't matter in this
  case as it's just a convencience wrapper with no extra functionality
  and setting NULL is ok according to BDB docs
- db->set_alloc() can't be used if environment is used, fix the condition
2009-09-17 12:32:04 +03:00
Panu Matilainen 5722f2d65c Add runtime settable custom memory allocation failure callback routine
- lets API users perform theirn own cleanup / exit through their own
  routines in case of allocation failure, or even try to free up
  some memory and retry allocation
2009-09-17 12:32:04 +03:00
Panu Matilainen 1492581139 Always use build + use our own allocator functions
- Consistent across platforms and will allow some things macros dont and
  memory checkers these days are smart enough to get decent output anyway
- Minimal namespacing with r-prefix, add compatibility macros to system.h
  for now so we dont have to change the entire codebase for this
- Also make rpmutil.h where the declarations and gcc __attribute__ macros
  are available everywhere
2009-09-17 12:32:04 +03:00
Panu Matilainen 3ef73d4d9d Eliminate unnecessary variable 2009-09-17 12:31:46 +03:00
Florian Festi 23dd010c57 Remove unused local variable 2009-09-16 14:59:48 +02:00
Panu Matilainen f3d2c4a9f9 Remove db environment on close on chrooted operations
- As we open the db from outside the chroot, the environment ends up
  containing paths that are not valid once we enter the chroot causing
  dumb issues like RhBug:513699 and RhBug:507309.
- We'd be better off removing the environment always after access but
  limiting to chroots for now as the rpmdb open/close path is full of races
  when environment is not present. Chroots are somewhat special environemnts
  anyway and typically not concurrently accessed so it's less of an issue
  there.
- While this still has all sorts of issues, it at least leaves the rpmdb
  in chroot in a functional state after initial install.
2009-09-16 15:47:11 +03:00
Panu Matilainen c339c36144 Move the default transaction lock out of BDB environment namespace
- We dont want the transaction lock to get mixed with the BDB environment,
  nor do we want it wiped out with it as the ts lock protects things
  *around* the environment. Unlike the environment, any fcntl locks on
  the file get released when process dies, so if there is a lock,
  there's a process alive holding it and you'd better not remove it.
- Use the same lock path in macro configuration and built-in fallback
- Make it a hidden file to avoid people confusing lock file existence
  with it actually being locked
2009-09-16 15:47:11 +03:00
Panu Matilainen 8b9d373025 There's a function to test string equivalence... 2009-09-16 15:47:11 +03:00
Panu Matilainen 6b11f58c76 Throw out useless db statistics structs
- besides being completely unused, these structs are defined by BDB
  public headers, no need to mirror them in rpm
2009-09-16 15:47:10 +03:00
Panu Matilainen ed8a4e20e5 Throw out pile of unused "stuff" from 2002 2009-09-16 15:47:10 +03:00
Panu Matilainen 4cfcdd661d Minor cleanup to newRpmdb()
- no need to free what hasn't been allocated yet
2009-09-16 15:47:10 +03:00
Panu Matilainen 90a0f75280 One complicated way to write xstrdup() .. pff
- sqlite backend uses dbi subfile for table name, leave it alone although
  it is the same as the file name...
- allocate + free both file and table name separately
2009-09-16 15:47:10 +03:00
Panu Matilainen 961ced7a61 Eliminate long since unused db subfile from bdb code 2009-09-16 15:47:10 +03:00
Panu Matilainen 2bfa9ca147 Remove unnecessary arguments to db init and fini
- bdb environments are per db_home, not per file so dbfile etc dont make
  sense here
2009-09-16 15:47:10 +03:00
Florian Festi cc1a7acef9 Also skip to be erased files in "netsharedpath"
fixes rhbz#494640
2009-09-16 13:51:56 +02:00
Panu Matilainen 63d37be6b4 Initialize rpm earlier in rpm2cpio (RhBug:523260)
- url retrieval requires macros to be loaded
2009-09-15 12:57:51 +03:00
Panu Matilainen eeceb42895 Take non-gi errors into account too (SuseBug:527191)
- patch from OpenSUSE / Michael Schroeder
2009-09-15 11:05:27 +03:00
Panu Matilainen 4018bbd08e Allow absolute paths in file lists again (SuseBug:535594, RhBug:521760)
- patch from OpenSUSE / Michael Schroeder
- build-time generated file lists should be placed in the build directory,
  but at least one valid use case for this is things like %files -f %{SOURCE10}
2009-09-15 10:56:58 +03:00
Roland McGrath b69c5cf90d find-debuginfo.sh: use permissions 444 for all .debug files
Signed-off-by: Roland McGrath <roland@redhat.com>
2009-09-15 10:39:11 +03:00
Panu Matilainen d846e6b0f8 Don't add dependency type into file requires and provides (RhBug:523282)
- unintended change in commit 3d8656f040
2009-09-15 08:45:14 +03:00
Panu Matilainen 7cd005ce7f Clean up rpmalAllFileSatisfiesDepend() a bit
- avoid multiple strrchr() calls
- avoid _constfree(), the string size is known from strrchr() so we dont
  need to allocate on heap at all
2009-09-14 13:23:34 +03:00
Panu Matilainen cb2bd766de Single point of exit for doSetupMacro() to clean up freeing allocations 2009-09-14 09:48:49 +03:00
Panu Matilainen 154462928e Oops, accessing the wrong header in processBinaryFiles()
- dumb mistakes from commit 4177fdffd6
2009-09-10 17:16:12 +03:00
Panu Matilainen cdb2cd545b Rip the broken asynchronous psm machinery
- it was only "used" for the ldconfig optimization and actually been
  completely broken since the ordering rewrite
2009-09-10 15:03:13 +03:00
Panu Matilainen 0b2858d13e Rip the broken ldconfig optimization hack (RhBug:513224)
- it doesn't optimize much and what's worse, it sometimes optimizes out
  calls that would've been necessary
2009-09-10 15:02:36 +03:00
Panu Matilainen 5327ac46e5 Rip unnecessary headerDump() and the last ancient artifacts using it
- xml format dump gives an output that can actually be further processed
2009-09-10 14:14:49 +03:00
Panu Matilainen ec8f057f64 Rip unused and useless headerGetLangs()
- nothing in the world uses it and the info is available through
  regular headerGet() anyway
2009-09-10 14:05:08 +03:00
Panu Matilainen c1fb691ef7 Rip unused and useless headerUsageCount() 2009-09-10 14:04:18 +03:00
Panu Matilainen 451bbb43a8 Eliminate unused goo from findEntry() 2009-09-09 14:19:20 +03:00
Panu Matilainen fc976d13b8 Handle NULL header in doHeaderUnload()
- avoids having to separately check elsewhere and avoids segfaulting
  on headerUnload() and headerReload() on NULL headers
2009-09-09 12:17:10 +03:00
Panu Matilainen cec0014138 Eliminate pointless increment 2009-09-09 11:52:47 +03:00
Panu Matilainen 1bc60ab06e Eliminate yet more unused calculations from header code... 2009-09-09 11:47:59 +03:00
Panu Matilainen 43dfc9e8d0 Eliminate unused pad calculations from header code 2009-09-09 11:42:18 +03:00
Panu Matilainen 8dd2babb56 Eliminate yet another unused variable in header code 2009-09-09 11:38:28 +03:00
Panu Matilainen 37f739c251 Eliminate last remaining leftovers from "8/98 bug" workaround
- the ieprev calculations aren't used for anything, should've been in
  commit 4d0d54492c really
2009-09-09 11:10:41 +03:00
Panu Matilainen 7e7c235b34 Eliminate unnecessary variable & related goo from regionSwab() 2009-09-09 11:06:45 +03:00
Panu Matilainen a2ba2b6ce0 Initialize diff on declaration where it fits comfortably on one line 2009-09-09 10:57:42 +03:00
Panu Matilainen 5a13d2ed21 Move variable to block local scope, not needed elsewhere 2009-09-09 10:57:30 +03:00
Panu Matilainen f3389c8794 Remove unnecessary assignment, diff is block local scope here 2009-09-09 10:56:17 +03:00
Panu Matilainen 1b617fd68b Reduce the number of exit points in parseFormat() to error and ok cases
- avoid a dozen redundant freeFormat() calls and dont bother NULLing
  local variable at the end
2009-09-09 10:56:06 +03:00
Panu Matilainen 9f9ab48f71 Add -Wempty-body to default options if gcc supports it
- ...to help protect against screwups like
  2ee45ef12a
2009-09-07 18:41:32 +03:00
Panu Matilainen f634253b32 Eliminate unused variable 2009-09-07 17:50:43 +03:00
Panu Matilainen c50851aa99 Eliminate unused variable 2009-09-07 17:39:39 +03:00
Panu Matilainen 0232226ab1 Minor rpmfcGenerateDependsHelper() cleanups
- initialize at declaration time, remove unnecessary variables etc
2009-09-07 17:10:12 +03:00
Panu Matilainen ec65f5e5f0 Move rl to the scope where its needed, dont bother assigning NULL 2009-09-07 17:00:49 +03:00
Panu Matilainen caa6dc91ac Single point of exit for doPatch() to clean up freeing 2009-09-07 16:59:01 +03:00
Panu Matilainen 23307f3823 Eliminate bogus variable initialization
- i isn't used outside the loop at the end, move it there...
2009-09-07 16:39:40 +03:00
Panu Matilainen ef0adf1da1 Add noreturn annotations to javadeps 2009-09-07 16:34:20 +03:00
Panu Matilainen 6fb96f3847 Help compilers/analyzers a bit with luaL_error()
- luaL_error() never returns but as other tools dont know this it
  raises false alarms
2009-09-07 16:23:32 +03:00
Panu Matilainen 475ba2111f Add noreturn annotations to argerror() helper functions 2009-09-07 15:52:36 +03:00