tools/librpm-tizen.git
13 years agoAdd a db cursor abstraction and interfaces for using it
Panu Matilainen [Wed, 20 Apr 2011 10:52:41 +0000 (13:52 +0300)]
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.

13 years agoRename _dbConfig and _dbiIndex structs to common foo_s style
Panu Matilainen [Wed, 20 Apr 2011 10:23:57 +0000 (13:23 +0300)]
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)

13 years agoRemove non-cursor support from dbiDel(), dbiPut() and dbiGet()
Panu Matilainen [Wed, 20 Apr 2011 10:18:54 +0000 (13:18 +0300)]
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.

13 years agoReturn explicit NULL's from db iterator free functions for clarity
Panu Matilainen [Tue, 19 Apr 2011 10:46:41 +0000 (13:46 +0300)]
Return explicit NULL's from db iterator free functions for clarity

13 years agoIgnore error codes in rpmdbIndexIteratorFree()
Panu Matilainen [Tue, 19 Apr 2011 10:42:46 +0000 (13:42 +0300)]
Ignore error codes in rpmdbIndexIteratorFree()
- Similarly to commit b35081600135b4a3d54fa7e832125a89d3bdee48,
  we can't do anything about dbiCclose() failure here, just ignore.

13 years agoIgnore error codes in rpmdbFreeIterator()
Panu Matilainen [Tue, 19 Apr 2011 10:34:02 +0000 (13:34 +0300)]
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.

13 years agoAttempt to fetch sources/patches when they are missing from %_sourcedir
Jindrich Novy [Tue, 19 Apr 2011 11:24:34 +0000 (13:24 +0200)]
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

13 years agoGive at least some indication of error from fchdir() failures
Panu Matilainen [Tue, 19 Apr 2011 10:21:36 +0000 (13:21 +0300)]
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.

13 years agoUse rpmsqFork() return code instead of semi-private struct member for pid
Panu Matilainen [Tue, 19 Apr 2011 10:08:28 +0000 (13:08 +0300)]
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.

13 years agoFclose() and unlink() errors aren't fatal here, just ignore
Panu Matilainen [Tue, 19 Apr 2011 10:04:28 +0000 (13:04 +0300)]
Fclose() and unlink() errors aren't fatal here, just ignore

13 years agoCatch write errors when generating scriptlet temporary files
Panu Matilainen [Tue, 19 Apr 2011 09:59:07 +0000 (12:59 +0300)]
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.

13 years agoImprove fsm error code handling in psm
Panu Matilainen [Tue, 19 Apr 2011 08:37:11 +0000 (11:37 +0300)]
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.

13 years agoActually handle headerGet() / pgpPrtPkts() failure on signature verify
Panu Matilainen [Tue, 19 Apr 2011 07:32:31 +0000 (10:32 +0300)]
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...

13 years agoEliminate unused variable in rpmpluginsAdd()
Panu Matilainen [Tue, 19 Apr 2011 07:21:26 +0000 (10:21 +0300)]
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.

13 years agoRestore previous vsflags on return from rpmInstall() and rpmErase()
Panu Matilainen [Tue, 19 Apr 2011 07:09:22 +0000 (10:09 +0300)]
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)

13 years agoEliminate another set-but-unused xx warning
Panu Matilainen [Tue, 19 Apr 2011 07:02:23 +0000 (10:02 +0300)]
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.

13 years agoReflect file classifier errors in rpmdeps exit code
Panu Matilainen [Mon, 18 Apr 2011 09:25:43 +0000 (12:25 +0300)]
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

13 years agoRemove yet another pointless tmp variable
Panu Matilainen [Mon, 18 Apr 2011 09:08:24 +0000 (12:08 +0300)]
Remove yet another pointless tmp variable
- Since we're not really interested in rpmdbClose() or
  rpmdbRemoveDatabase() error codes when rebuilding, just ignore
  their returns

13 years agoCollect proper exit status from rpmdbRemoveDatabase()
Panu Matilainen [Mon, 18 Apr 2011 09:04:34 +0000 (12:04 +0300)]
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.

13 years agoIgnore rpmdbClose() return on failed rpmdbOpen()
Panu Matilainen [Mon, 18 Apr 2011 09:00:44 +0000 (12:00 +0300)]
Ignore rpmdbClose() return on failed rpmdbOpen()
- We can't do anything about it so just ignore and remove the
  unused variable

13 years agoClean up urlGetFile() return values
Panu Matilainen [Mon, 18 Apr 2011 07:13:24 +0000 (10:13 +0300)]
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

13 years agoRemember to free db index iterators too on forced termination
Panu Matilainen [Fri, 15 Apr 2011 07:35:34 +0000 (10:35 +0300)]
Remember to free db index iterators too on forced termination

13 years agoFix dangling databases from iterators (ticket #820)
Panu Matilainen [Fri, 15 Apr 2011 07:11:41 +0000 (10:11 +0300)]
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.

13 years agoOnly muck with signals on first and last db open/close
Panu Matilainen [Fri, 15 Apr 2011 06:18:15 +0000 (09:18 +0300)]
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.

13 years agoExtract perl dependecies from "use parent qw(Foo)".
Ville Skyttä [Wed, 6 Apr 2011 17:56:31 +0000 (20:56 +0300)]
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>
13 years agoHonor $TMPDIR in various scripts.
Ville Skyttä [Tue, 1 Mar 2011 15:23:17 +0000 (17:23 +0200)]
Honor $TMPDIR in various scripts.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
13 years agoUnbreak obsoletes from commit b1a4b57315d31ba98bc0e5803db1ebc2517f6bb5
Panu Matilainen [Wed, 13 Apr 2011 07:04:28 +0000 (10:04 +0300)]
Unbreak obsoletes from commit b1a4b57315d31ba98bc0e5803db1ebc2517f6bb5
- rpmdsMatchesDep() only works with RPMDBI_PROVIDES, not RPMDBI_NAME.
  Revert that part of the change.

13 years agoDont reference transaction set from transaction elements
Panu Matilainen [Tue, 5 Apr 2011 14:33:12 +0000 (17:33 +0300)]
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 8f7c2d7063df6d1057425d014ce4168d46c5e7d9.

13 years agoDon't list packages which will not be created in spec query (RhBug:693338)
Jindrich Novy [Mon, 4 Apr 2011 14:03:11 +0000 (16:03 +0200)]
Don't list packages which will not be created in spec query (RhBug:693338)
- particularly, while doing "rpm -q --specfile <a spec file>"

13 years agoUpdate INSTALL a bit, include blurb about the test-suite + fakechroot
Panu Matilainen [Mon, 4 Apr 2011 11:39:19 +0000 (14:39 +0300)]
Update INSTALL a bit, include blurb about the test-suite + fakechroot

13 years agoOnly enable test-suite if fakechroot is available
Panu Matilainen [Mon, 4 Apr 2011 11:31:17 +0000 (14:31 +0300)]
Only enable test-suite if fakechroot is available

13 years agoExecute all non-compilation rpmbuild tests in fakechroot
Panu Matilainen [Mon, 4 Apr 2011 11:05:17 +0000 (14:05 +0300)]
Execute all non-compilation rpmbuild tests in fakechroot
- Except for four rpmbuild tests which rely on an actual compiler
  being available (faking *that* would get entertaining...), the entire
  test-suite is now executing everything in the fakechroot environment.

13 years agoAdd more stuff to test-suite root environment
Panu Matilainen [Mon, 4 Apr 2011 11:00:23 +0000 (14:00 +0300)]
Add more stuff to test-suite root environment
- Build needs a whole bunch of utilities there, including file + its
  magic database. The exact location of the magic db varies between
  systems but file -C lets us basically make a copy of the system magicdb
  into the fakechroot env and then we can override the location with MAGIC

13 years agoSwitch more test-suite builds to run under fakechroot
Panu Matilainen [Mon, 4 Apr 2011 09:13:56 +0000 (12:13 +0300)]
Switch more test-suite builds to run under fakechroot
- This leaves only the "real" builds where the packages contain files
  to be executed outside fakechroot

13 years agoRun dependency tests entirely in fakechroot
Panu Matilainen [Mon, 4 Apr 2011 09:03:38 +0000 (12:03 +0300)]
Run dependency tests entirely in fakechroot
- All the packages here have no files making them "easy" to build
  inside the chroot

13 years agoPrepare the test root entirely from Makefile, add missing bits
Panu Matilainen [Mon, 4 Apr 2011 09:01:43 +0000 (12:01 +0300)]
Prepare the test root entirely from Makefile, add missing bits
- Running builds in fakechroot needs a whole lot of things.. add symlinks
  to various system config + dev files to give some trivial packages
  a chance to build under fakechroot

13 years agoRemove redundant data copying into test-suite root
Panu Matilainen [Mon, 4 Apr 2011 08:39:25 +0000 (11:39 +0300)]
Remove redundant data copying into test-suite root

13 years agoAvoid leaking our compilation directory into test-suite
Panu Matilainen [Mon, 4 Apr 2011 08:27:03 +0000 (11:27 +0300)]
Avoid leaking our compilation directory into test-suite
- Since they're running in fakechroot there's no need to arrange
  user writable directories this way

13 years agoAdjust rpmdb path for all remaining non-fakeroot runs
Panu Matilainen [Fri, 1 Apr 2011 14:48:07 +0000 (17:48 +0300)]
Adjust rpmdb path for all remaining non-fakeroot runs
- Executing rpmbuild in the fakeroot gets fairly tricky, especially
  for the tests that actually compile things. Overriding the dbpath
  prevents it from accessing system rpmdb for keyring and build-requires.
- With this patch, the test-suite now passes the smoke-test of
  "chmod go-rx /var/lib/rpm" on system rpmdb.

13 years agoAdjust rpmdb path in python tests
Panu Matilainen [Fri, 1 Apr 2011 14:44:35 +0000 (17:44 +0300)]
Adjust rpmdb path in python tests
- We can't run python easily in the chroot so override the dbpath
  to our test area instead of potentially accessing the system db
  for keyring etc

13 years agoExplicitly initialize the test-root database always
Panu Matilainen [Fri, 1 Apr 2011 14:43:13 +0000 (17:43 +0300)]
Explicitly initialize the test-root database always
- Otherwise various places will be emitting "generating xx missing indexes"
  warnings, we dont want that noise in the test-suite results

13 years agoSwitch the two remaining rpm runs under fakechroot
Panu Matilainen [Fri, 1 Apr 2011 14:18:46 +0000 (17:18 +0300)]
Switch the two remaining rpm runs under fakechroot
- Everything in the test-suite except rpmbuild execution is now
  performed in the fakechroot environment

13 years agoRun all rpmmacro tests under fakechroot
Panu Matilainen [Fri, 1 Apr 2011 14:07:52 +0000 (17:07 +0300)]
Run all rpmmacro tests under fakechroot

13 years agoMake a bunch of tools available in the testsuite root environment
Panu Matilainen [Fri, 1 Apr 2011 14:06:42 +0000 (17:06 +0300)]
Make a bunch of tools available in the testsuite root environment
- We'll need shell and various other bits in order to do many
  things wrt specs and builds in the root...

13 years agoRun most rpmi tests under fakechroot
Panu Matilainen [Fri, 1 Apr 2011 13:20:48 +0000 (16:20 +0300)]
Run most rpmi tests under fakechroot
- one of the manifest tests is failing mysteriously in root mode though..

13 years agoRun testsuite rpmdb init helper with fakechroot
Panu Matilainen [Fri, 1 Apr 2011 13:18:26 +0000 (16:18 +0300)]
Run testsuite rpmdb init helper with fakechroot

13 years agoMake all query tests run under fakechroot
Panu Matilainen [Fri, 1 Apr 2011 12:42:47 +0000 (15:42 +0300)]
Make all query tests run under fakechroot

13 years agoMake all generic tests run under fakechroot
Panu Matilainen [Fri, 1 Apr 2011 12:42:30 +0000 (15:42 +0300)]
Make all generic tests run under fakechroot

13 years agoAvoid unnecessary use of 'id' in test-suite specs
Panu Matilainen [Fri, 1 Apr 2011 12:39:21 +0000 (15:39 +0300)]
Avoid unnecessary use of 'id' in test-suite specs
- We could just ditch the entire buildroot lines from the specs
  but leaving one case to test that we dont actually fail on specs
  that do have it.

13 years agoMake all test data available in the test-root
Panu Matilainen [Fri, 1 Apr 2011 12:29:52 +0000 (15:29 +0300)]
Make all test data available in the test-root

13 years agoTest-suite spring cleaning
Panu Matilainen [Fri, 1 Apr 2011 11:44:42 +0000 (14:44 +0300)]
Test-suite spring cleaning
- Remove duplicate --version checks (doh) and some commented out
  build tests that are unlikely to ever be implemented in reality

13 years agoAdd a more useful example to rpm2cpio manpage
Panu Matilainen [Fri, 1 Apr 2011 05:17:21 +0000 (08:17 +0300)]
Add a more useful example to rpm2cpio manpage
- Based on suggestions from Masatake Yamato and others from rpm-list

13 years agoRemove rpm v3 code
Florian Festi [Thu, 31 Mar 2011 08:54:25 +0000 (10:54 +0200)]
Remove rpm v3 code

These cases are check for in rpmdsCompare() anyway. No need to "optimize" for a long dead rpm release.

13 years agoAdd rpmdsMatchesDep() as alternative to rpmdsAnyMatchesDep() to make use of the tag...
Florian Festi [Tue, 29 Mar 2011 14:31:46 +0000 (16:31 +0200)]
Add rpmdsMatchesDep() as alternative to rpmdsAnyMatchesDep() to make use of the tag number (index) we get from the rpmdb on queries

13 years agoSimplify fsmMapFContext()
Jindrich Novy [Fri, 25 Mar 2011 09:25:25 +0000 (10:25 +0100)]
Simplify fsmMapFContext()

13 years agoRemove unused variables from db3.c
Jindrich Novy [Fri, 25 Mar 2011 09:25:03 +0000 (10:25 +0100)]
Remove unused variables from db3.c

13 years agoUse pkg-config to find Lua + determine flags (ticket #88)
Panu Matilainen [Mon, 28 Mar 2011 09:47:34 +0000 (12:47 +0300)]
Use pkg-config to find Lua + determine flags (ticket #88)
- Additionally clean up the logic a bit and dont bother building
  any lua-related bits if disabled

13 years agoDrop the unused + unmaintained javadeps helper
Panu Matilainen [Fri, 25 Mar 2011 13:20:26 +0000 (15:20 +0200)]
Drop the unused + unmaintained javadeps helper
- It contains piles of buffer overflow etc material and AFAIK this
  has been unused for its entire lifespan of > 10 years, fixing
  an unused piece of code seems like a waste of time. If somebody
  shows interest later on it can be resurrected, but in the meanwhile...

13 years agoOops, lib/misc.c is no more, remove from POTFILES.in
Panu Matilainen [Fri, 25 Mar 2011 12:56:16 +0000 (14:56 +0200)]
Oops, lib/misc.c is no more, remove from POTFILES.in

13 years agoUse canoncolor to determine lib vs lib64
Panu Matilainen [Fri, 25 Mar 2011 12:45:11 +0000 (14:45 +0200)]
Use canoncolor to determine lib vs lib64

13 years agoPush platform config out of main rpm macros file
Panu Matilainen [Fri, 25 Mar 2011 12:39:36 +0000 (14:39 +0200)]
Push platform config out of main rpm macros file
- canon arch & color stuff is now calculated per each known arch in
  installplatform, and just a single place where arch name mangling
  is done

13 years agoGenerate platform configuration for all known architectures
Panu Matilainen [Fri, 25 Mar 2011 12:03:23 +0000 (14:03 +0200)]
Generate platform configuration for all known architectures
- loop over all archs known by rpmrc but only generate the platform config
  if all necessary parameters (such as ISA information) are known, this
  gives a reasonable idea of what archs are *really* in use and supported
- at least in theory, the platform configuration could now move to
  $datadir as the contents no longer depend on which are rpm was built on
- also gets rid of the big sed-monster in install-platform

13 years agoSimplify the hysterical per-platform vendor-sed thing
Panu Matilainen [Fri, 25 Mar 2011 11:22:53 +0000 (13:22 +0200)]
Simplify the hysterical per-platform vendor-sed thing

13 years agoCreate platform specific config on all OS'es
Panu Matilainen [Fri, 25 Mar 2011 11:16:32 +0000 (13:16 +0200)]
Create platform specific config on all OS'es

13 years agoMove %_fixperms to main macro config
Panu Matilainen [Fri, 25 Mar 2011 11:08:09 +0000 (13:08 +0200)]
Move %_fixperms to main macro config
- Fixing broken permissions in sources isn't exactly platform/vendor
  specific in nature (at least Suse adds this this to their own "platform"
  separately, kinda proving the point)
- Kick out the remaining unused RH-pecific platform.in section

13 years agoYank out 2001 vintage Mandrake-specific macros
Panu Matilainen [Fri, 25 Mar 2011 10:45:36 +0000 (12:45 +0200)]
Yank out 2001 vintage Mandrake-specific macros
- Its unlikely these were ever actually used by Mandrake, but in
  any case they switched to different setup long ago, and since
  then the company + distribution has seen more than a few renames etc..

13 years agoReplace distro/vendor autodetection with a configure switch
Panu Matilainen [Fri, 25 Mar 2011 09:25:47 +0000 (11:25 +0200)]
Replace distro/vendor autodetection with a configure switch
- it's not rpm's job, not is it possible for rpm to know about
  distribution/vendor names and preferences
- use build_vendor as the canonical vendor (affecting %{_vendor} default
  and macro + rpmrc paths) unless overridden by --with-vendor=name

13 years agoMove find-provides and find-requires link to autodeps/
Florian Festi [Mon, 21 Mar 2011 13:39:10 +0000 (14:39 +0100)]
Move find-provides and find-requires link to autodeps/
Implement link reaction with less copied code

13 years agoClean up headerRead()
Jindrich Novy [Thu, 24 Mar 2011 11:48:46 +0000 (12:48 +0100)]
Clean up headerRead()

13 years agoRemove checks of unused things from configure.ac
Jindrich Novy [Wed, 23 Mar 2011 12:37:44 +0000 (13:37 +0100)]
Remove checks of unused things from configure.ac

13 years agoDon't use mtrace(3), muntrace(3) and don't check for mcheck.h
Jindrich Novy [Wed, 23 Mar 2011 11:37:25 +0000 (12:37 +0100)]
Don't use mtrace(3), muntrace(3) and don't check for mcheck.h
- valgrind is good for these things without touching the code

13 years agoAvoid timedRead() usage
Jindrich Novy [Wed, 23 Mar 2011 10:18:08 +0000 (11:18 +0100)]
Avoid timedRead() usage
- it is to be removed in the next soname bump

13 years agoRemove libio support to suppress timedRead()
Jindrich Novy [Wed, 23 Mar 2011 10:11:33 +0000 (11:11 +0100)]
Remove libio support to suppress timedRead()

13 years agoEliminate pointless isSource member from eiu struct, duh
Panu Matilainen [Wed, 23 Mar 2011 10:15:50 +0000 (12:15 +0200)]
Eliminate pointless isSource member from eiu struct, duh

13 years agoEliminate header from eiu struct, its just a local temp variable really
Panu Matilainen [Wed, 23 Mar 2011 10:15:07 +0000 (12:15 +0200)]
Eliminate header from eiu struct, its just a local temp variable really

13 years agoReduce vsflags flip-flop
Panu Matilainen [Wed, 23 Mar 2011 10:14:23 +0000 (12:14 +0200)]
Reduce vsflags flip-flop
- Transaction set vsflags gets set early in rpmInstall(), remove
  redundant set + restore on tryReadHeader()

13 years agocheckFreshenStatus() only needs a header, not the entire eiu struct
Panu Matilainen [Wed, 23 Mar 2011 10:13:25 +0000 (12:13 +0200)]
checkFreshenStatus() only needs a header, not the entire eiu struct

13 years agoFix classification of ELF binaries with sticky bit (RhBug:689182)
Panu Matilainen [Tue, 22 Mar 2011 06:36:35 +0000 (08:36 +0200)]
Fix classification of ELF binaries with sticky bit (RhBug:689182)

13 years agoFix a small memleak in rpmsign tool
Panu Matilainen [Thu, 17 Mar 2011 13:49:57 +0000 (15:49 +0200)]
Fix a small memleak in rpmsign tool

13 years agoPlug memory leaks on macro definition error cases
Panu Matilainen [Thu, 17 Mar 2011 13:35:42 +0000 (15:35 +0200)]
Plug memory leaks on macro definition error cases

13 years agoFix couple of incorrect sizeof() uses
Panu Matilainen [Thu, 17 Mar 2011 12:08:54 +0000 (14:08 +0200)]
Fix couple of incorrect sizeof() uses

13 years agoMissing va_end() call
Panu Matilainen [Thu, 17 Mar 2011 11:24:47 +0000 (13:24 +0200)]
Missing va_end() call

13 years agoAvoid freeing an unallocated variable (RhBug:688091)
Jindrich Novy [Wed, 16 Mar 2011 14:07:55 +0000 (15:07 +0100)]
Avoid freeing an unallocated variable (RhBug:688091)

13 years agoFix cpio_doio()
Jindrich Novy [Tue, 15 Mar 2011 16:58:31 +0000 (17:58 +0100)]
Fix cpio_doio()
- do not propagate incompatible error codes to cpioStrerror()
- plug possible memleak while creating transaction set
- clean up

13 years agoClean up rpmfcClassify()
Jindrich Novy [Mon, 14 Mar 2011 14:37:00 +0000 (15:37 +0100)]
Clean up rpmfcClassify()
- don't check return values of functions that cannot fail
- remove "can't happen" asserts
- fail in case of empty file classifier

13 years agoUpdate librpm doxygen module list
Panu Matilainen [Fri, 11 Mar 2011 12:24:38 +0000 (14:24 +0200)]
Update librpm doxygen module list
- rpmgi is gone, rpmprob is a "new" item

13 years agoMark htonll() as "const" function
Panu Matilainen [Thu, 10 Mar 2011 11:36:51 +0000 (13:36 +0200)]
Mark htonll() as "const" function
- htonll() is a pure "const" function as it only manipulates the
  value passed to it and only calls htonl() functions which are
  also const.
- Also fix up the function prototype formatting

13 years agoClean up rpmfcApply() and rpmfcHelper()
Jindrich Novy [Thu, 10 Mar 2011 15:45:49 +0000 (16:45 +0100)]
Clean up rpmfcApply() and rpmfcHelper()

13 years agoFix whitespace in Python doc string
Florian Festi [Mon, 7 Mar 2011 19:53:15 +0000 (20:53 +0100)]
Fix whitespace in Python doc string

13 years agoMove string hash function to librpmio and rename for namespacing
Panu Matilainen [Thu, 10 Mar 2011 07:00:07 +0000 (09:00 +0200)]
Move string hash function to librpmio and rename for namespacing
- There are places in rpmio and build that would benefit from hashing, but
  hashFunctionString() being internal to librpm has prevented that. Rename
  to rstrhash() to resemble the other foo in rpmstring.h for
  minimal namespacing as its now public function and update callers.
- Also mark the function as "pure" - it only looks at its arguments.
  This is one of the busiest functions in entire rpm so any optimization
  no matter how minor is well worth it.
- Hereby awarding hashFunctionString() with the grand prize for
  the Most Moved Around Function in rpm ;)

13 years agoFix the PyBytes vs PyString compatibility defines
Panu Matilainen [Wed, 9 Mar 2011 14:13:34 +0000 (16:13 +0200)]
Fix the PyBytes vs PyString compatibility defines
- Oops. Quite obviously nobody has even tried to build this with
  python < 2.6. Whether it'd actually work is another question...

13 years agoPython 3 fixups
Panu Matilainen [Wed, 9 Mar 2011 14:08:59 +0000 (16:08 +0200)]
Python 3 fixups
- PyString is gone, use PyBytes instead
- Add compatibility defines to paper over
  PyInt/PyLong_JustHowLongFunctionNamesYouCanComeUpWith()

13 years agoPreliminary distutils support for the python bindings
Panu Matilainen [Wed, 9 Mar 2011 13:37:07 +0000 (15:37 +0200)]
Preliminary distutils support for the python bindings
- Steps towards separating rpm-python from the main rpm tarball even
  though developed within the rpm repository.
- Having the bindings in a separate tarball makes it simpler to build
  them for different python versions, notably python 3 (RhBug:531543)

13 years agoCut the remaining ties python bindings have to main rpm sources
Panu Matilainen [Wed, 9 Mar 2011 13:31:25 +0000 (15:31 +0200)]
Cut the remaining ties python bindings have to main rpm sources
- Include what little we need from standard headers instead
  of relying on rpm source tree system.h for anything.
- Remove non-public includes from python binding include paths

13 years agoDon't bother with the callback die-die-die error translation
Panu Matilainen [Wed, 9 Mar 2011 13:28:48 +0000 (15:28 +0200)]
Don't bother with the callback die-die-die error translation

13 years agoEliminate unnecessary _free() usages in python
Panu Matilainen [Wed, 9 Mar 2011 13:26:54 +0000 (15:26 +0200)]
Eliminate unnecessary _free() usages in python

13 years agoPython bindings dont need our debug.h for anything
Panu Matilainen [Wed, 9 Mar 2011 13:06:11 +0000 (15:06 +0200)]
Python bindings dont need our debug.h for anything

13 years agoVerify some properties of replaced and wrong-colored files (RhBug:528383)
Panu Matilainen [Wed, 9 Mar 2011 08:25:29 +0000 (10:25 +0200)]
Verify some properties of replaced and wrong-colored files (RhBug:528383)
- We can't verify any properties of replaced files, but we can and
  should still see if it exists at all.
- Files skipped due to wrong color are supposed to share some of
  the attributes with the file that got actually installed, such
  as permissions and whether it exists at all. Verify what we can
  instead of silently ignoring.

13 years agoTake file state into account for file dependencies
Panu Matilainen [Wed, 9 Mar 2011 07:39:32 +0000 (09:39 +0200)]
Take file state into account for file dependencies
- Files which are not installed, have been replaced or are of wrong
  color can not actually satisfy a dependency despite what the package's
  file list says.
- This prevents breaking the system despite seemingly correct dependencies
  in some situations, such as on multilib systems where a colored
  files can appear to be shared between primary and secondary architecture
  packages, but only the file from primary arch package is physically
  present, and removing the primary arch package would remove the
  file and silently break any dependencies on such files in practise.
  Similarly replaced files become owned by the replacing package in
  practise, so the original package whose files were replaced can no
  longer satisfy dependency on those files.

13 years agoClean up rpmfcExec()
Jindrich Novy [Wed, 9 Mar 2011 07:16:46 +0000 (08:16 +0100)]
Clean up rpmfcExec()