platform/upstream/rpm.git
15 years agoSimplify rpmInstallLoadMacros()
Panu Matilainen [Mon, 17 Nov 2008 14:12:04 +0000 (16:12 +0200)]
Simplify rpmInstallLoadMacros()
- fi argument unused, remove
- no relevant return value, make it void
- handle any proper data type for per-header macros

15 years agoAvoid reconstructing half of rpmfi manually in rpmInstallSourcePackage()
Panu Matilainen [Mon, 17 Nov 2008 14:04:48 +0000 (16:04 +0200)]
Avoid reconstructing half of rpmfi manually in rpmInstallSourcePackage()
- similarly to commit 53ee682a491ceee4392815075cabbe58d0cc0c22, arrange
  the header to contain necessary paths before calling rpmfiNew()
- avoid unnecessary accesses to rpmfi internals otherwise too

15 years agoUnnecessary local variable, result only needed once
Panu Matilainen [Mon, 17 Nov 2008 12:21:38 +0000 (14:21 +0200)]
Unnecessary local variable, result only needed once

15 years agoAssume failure in rpmInstallSourcePackage()
Panu Matilainen [Sat, 15 Nov 2008 16:44:00 +0000 (18:44 +0200)]
Assume failure in rpmInstallSourcePackage()
- avoids bunch of redundant assignments

15 years agoCalculate total file size correctly in build (mdvbz#45820, rhbz#247374)
Panu Matilainen [Mon, 17 Nov 2008 11:39:22 +0000 (13:39 +0200)]
Calculate total file size correctly in build (mdvbz#45820, rhbz#247374)
- delay total size calculation until the real file list is known, ie
  in genCpioListAndHeaders() where duplicates and excludes have been
  weeded out

15 years agoMake depflagsFormat() accept any numeric type
Panu Matilainen [Mon, 17 Nov 2008 10:44:57 +0000 (12:44 +0200)]
Make depflagsFormat() accept any numeric type

15 years agoSimplify xmlFormat() by taking advantage of rpmtdClass()
Panu Matilainen [Mon, 17 Nov 2008 10:42:53 +0000 (12:42 +0200)]
Simplify xmlFormat() by taking advantage of rpmtdClass()

15 years agoMake fflagsFormat() accept any numeric type
Panu Matilainen [Mon, 17 Nov 2008 10:41:24 +0000 (12:41 +0200)]
Make fflagsFormat() accept any numeric type

15 years agoMake permsFormat() work with any numeric type
Panu Matilainen [Mon, 17 Nov 2008 10:39:13 +0000 (12:39 +0200)]
Make permsFormat() work with any numeric type

15 years agoMake triggertypeFormat() work for any numeric type
Panu Matilainen [Mon, 17 Nov 2008 10:37:42 +0000 (12:37 +0200)]
Make triggertypeFormat() work for any numeric type

15 years agoMake shescapeFormat() to accept any numeric type
Panu Matilainen [Mon, 17 Nov 2008 10:34:22 +0000 (12:34 +0200)]
Make shescapeFormat() to accept any numeric type

15 years agoTake advantage of rpmtdGetNumber() for date format specifiers
Panu Matilainen [Mon, 17 Nov 2008 10:29:01 +0000 (12:29 +0200)]
Take advantage of rpmtdGetNumber() for date format specifiers
- dateFormat() and dayFormat() now work for any numeric type

15 years agoTake advantage of rpmtdGetNumber() for numeric format specifiers
Panu Matilainen [Mon, 17 Nov 2008 10:23:19 +0000 (12:23 +0200)]
Take advantage of rpmtdGetNumber() for numeric format specifiers
- octalFormat() and hexFormat() now work for any number, not just int32,
  fixing rhbz#471820
- use a common helper-function for both formats, they only differ by o/x

15 years agoSimplify stringFormat() by using rpmtdGetNumber()
Panu Matilainen [Mon, 17 Nov 2008 10:16:51 +0000 (12:16 +0200)]
Simplify stringFormat() by using rpmtdGetNumber()

15 years agoAdd rpmtdGetNumber() for getting numeric values from tag container
Panu Matilainen [Mon, 17 Nov 2008 10:04:08 +0000 (12:04 +0200)]
Add rpmtdGetNumber() for getting numeric values from tag container
- returns the value (as opposed to pointer to, like the rpmtdGetUint32()
  and the like do) of any numeric type as uint64_t (largest supported
  integer type so everything can be converted to it)
- handy when you don't really care what the internal presentation is
- there's no rpmtdGetNextNumber() as there's no meaningful way to return
  end-of-iteration here

15 years agoIntroduce rpm tag "classes"
Panu Matilainen [Mon, 17 Nov 2008 09:31:00 +0000 (11:31 +0200)]
Introduce rpm tag "classes"
- rpm tag data can be either numeric, strings or binary data, each with
  their own "subclasses" (different sized integers etc), add new
  enumeration for these
- add rpmTagGetClass(), rpmtdClass() public functions for retrieving the
  base class of tag and container
- useful for getting a basic idea how to handle tag/container data

15 years agoUse rpmpsmNew() + rpmpsmFree() instead of manually doing the same
Panu Matilainen [Sat, 15 Nov 2008 15:55:47 +0000 (17:55 +0200)]
Use rpmpsmNew() + rpmpsmFree() instead of manually doing the same

15 years agoEliminate bogus const from fi->apath
Panu Matilainen [Sat, 15 Nov 2008 15:20:13 +0000 (17:20 +0200)]
Eliminate bogus const from fi->apath

15 years agoEliminate match iterator from psm struct
Panu Matilainen [Sat, 15 Nov 2008 14:00:36 +0000 (16:00 +0200)]
Eliminate match iterator from psm struct
- it's only needed in local scope anywhere, no point having it psm global

15 years agoAvoid having to reconstruct half of rpmfi manually in genCpioListAndHeader()
Panu Matilainen [Sat, 15 Nov 2008 12:22:47 +0000 (14:22 +0200)]
Avoid having to reconstruct half of rpmfi manually in genCpioListAndHeader()
- We need the on-disk paths for the cpio list in here, so instead of
  creating an rpmfi with wrong paths (for build purposes) and then
  painfully reconstructing half the fileinfo structures by hand, pass
  the on-disk path into rpmfiNew() to begin with and then switch the
  intended cpio path back into header.
- Duplicates and excludes are already filtered out from the header filelist
  so walk that instead of spec filelist to avoid having to filter out
  duplicates and excludes, again.

15 years agoLose useless fsm/rpmfi astriplen field
Panu Matilainen [Sat, 15 Nov 2008 11:22:19 +0000 (13:22 +0200)]
Lose useless fsm/rpmfi astriplen field
- only "used" for debugging output, duh...

15 years agoDon't bother creating a dummy transaction element for rpmfi in build
Panu Matilainen [Sat, 15 Nov 2008 10:07:44 +0000 (12:07 +0200)]
Don't bother creating a dummy transaction element for rpmfi in build
- nothing in the build path requires fi->te to be present, so don't
  muck with rpmte internals needlessly

15 years agoMinor genCpioListAndHeader() cleanups
Panu Matilainen [Sat, 15 Nov 2008 09:50:09 +0000 (11:50 +0200)]
Minor genCpioListAndHeader() cleanups
- rpmfiNew() only cares about ts for install-time relocations, nothing
  to "fix" wrt that
- we know fip is never NULL (this is a static function with whopping two
  callers), don't try to cover up for potential programmer errors

15 years agoDon't have to free what's not allocated to begin with...
Panu Matilainen [Fri, 14 Nov 2008 20:45:42 +0000 (22:45 +0200)]
Don't have to free what's not allocated to begin with...

15 years agoAdd more flags to control rpmfi creation
Panu Matilainen [Fri, 14 Nov 2008 20:44:07 +0000 (22:44 +0200)]
Add more flags to control rpmfi creation
- RPMFI_NOFILELANGS to avoid loading lang data (only useful on install)
- RPMFI_NOFILEOWNER to avoid loading of user+group data

15 years agoYank rpmfi state update out of rpmtsRun()
Panu Matilainen [Fri, 14 Nov 2008 15:16:42 +0000 (17:16 +0200)]
Yank rpmfi state update out of rpmtsRun()
- stuff it into internal rpmfiUpdateState() function to get it out of
  sight for now, the mechanism needs some...

15 years agoMove open + close of files during install to separate functions
Panu Matilainen [Fri, 14 Nov 2008 11:05:41 +0000 (13:05 +0200)]
Move open + close of files during install to separate functions
- internal rpmteOpen() and rpmteClose() functions replacing copy-paste
  slop between rpmtsRun() and runTransScripts()
- eliminates bunch of rpmte privacy violations
- rpmtsRun() doesn't need the file descriptor for anything, might as well
  keep it hidden

15 years agoAllow setting custom parameters to patch (rhbz#471006)
Jindrich Novy [Fri, 14 Nov 2008 14:16:08 +0000 (15:16 +0100)]
Allow setting custom parameters to patch (rhbz#471006)
- added new _default_patch_flags macro with the rpm default
  "-s" parameter

15 years agoFix capability verification
Panu Matilainen [Fri, 14 Nov 2008 07:47:43 +0000 (09:47 +0200)]
Fix capability verification
- the previous implementation was pretty busted up, cap_size() is the
  size of external representation, not sizeof(*cap_t) as pointed out by
  Andrew Morgan
- check for cap_compare() in configure and use it if available (it's
  a Linux-specific extension to the posix draft and only very recent
  libcap has it)
- if cap_compare() isn't available, use internal variant that does it
  the hard way by converting the capabilities to external presentation
  and comparing those

15 years agoFilter out mtime difference of shared files on verify (rhbz#426672, #444661)
Panu Matilainen [Thu, 13 Nov 2008 11:22:03 +0000 (13:22 +0200)]
Filter out mtime difference of shared files on verify (rhbz#426672, #444661)
- Since we permit shared files to differ by mtime on installation, it makes
  no sense to consider them as verification failure either. This has been
  especially bad on multilib where timestamp differences make verify warning
  lights look like Las Vegas at night. If file mtime on disk and header
  differs, check if it's owned by more than one package and if so, ignore
  the timestamp difference.

15 years agoMove ts and preferred color fetching out of the loop
Panu Matilainen [Thu, 13 Nov 2008 07:56:52 +0000 (09:56 +0200)]
Move ts and preferred color fetching out of the loop
- neither ts or preferred color changes per-file

15 years agoRemove unused fsm subbuf field
Panu Matilainen [Wed, 12 Nov 2008 19:58:56 +0000 (21:58 +0200)]
Remove unused fsm subbuf field

15 years agoDon't bother retrieving db offset for erase elements
Panu Matilainen [Wed, 12 Nov 2008 17:36:58 +0000 (19:36 +0200)]
Don't bother retrieving db offset for erase elements
- not needed anymore, use -1 to mean "unused" and document dboffset
  to rpmtsAddEraseElement() as unused

15 years agoTake advantage of headerGetInstance() in removePackage()
Panu Matilainen [Wed, 12 Nov 2008 17:33:12 +0000 (19:33 +0200)]
Take advantage of headerGetInstance() in removePackage()
- avoids an extra argument, making dboffset argument to
  rpmtsAddEraseElement() unused

15 years agoTake advantage of headerGetInstance() in rpmte
Panu Matilainen [Wed, 12 Nov 2008 17:24:58 +0000 (19:24 +0200)]
Take advantage of headerGetInstance() in rpmte
- rpmte db_instance and dboffset are exactly the same thing, unify
- pull rpmte->db_instance from header directly, ignore dboffset argument
  to rpmteNew() (removing the arg would just break api needlessly, otoh
  it's unlikely that anything outside rpm actually uses rpmteNew())
- eliminate the now unnecessary added/removed union from te struct
- rpmteDBOffset() is now just an alias for rpmteDBInstance(), deprecate?

15 years agoGrab rpmfi record from header on rpmfiNew()
Panu Matilainen [Wed, 12 Nov 2008 16:29:51 +0000 (18:29 +0200)]
Grab rpmfi record from header on rpmfiNew()
- avoids having to muck with it from rpmtsRun()

15 years agoAdd rpmdb record number to headers retrieved from rpmdb
Panu Matilainen [Wed, 12 Nov 2008 15:58:37 +0000 (17:58 +0200)]
Add rpmdb record number to headers retrieved from rpmdb
- set "instance" number on retrieval from rpmdb
- add public headerGetInstance() function for retrieving the value
- ported from rpm5.org, useful for number of things

15 years agoConvert obvious bits of rpmtsRun() to use rpmfiFAction()
Panu Matilainen [Tue, 11 Nov 2008 20:37:12 +0000 (22:37 +0200)]
Convert obvious bits of rpmtsRun() to use rpmfiFAction()
- remaining access to fi->actions is the nasty part of copying things
  around to transfer state

15 years agoConvert skipFiles() to rpmfi(Set)FAction()
Panu Matilainen [Tue, 11 Nov 2008 20:35:45 +0000 (22:35 +0200)]
Convert skipFiles() to rpmfi(Set)FAction()

15 years agoConvert handleOverlappedFiles() to rpmfi(Set)Faction()
Panu Matilainen [Tue, 11 Nov 2008 20:32:23 +0000 (22:32 +0200)]
Convert handleOverlappedFiles() to rpmfi(Set)Faction()

15 years agoConvert handleRmvdInstalledFiles() to rpmfiSetFAction()
Panu Matilainen [Tue, 11 Nov 2008 20:19:29 +0000 (22:19 +0200)]
Convert handleRmvdInstalledFiles() to rpmfiSetFAction()

15 years agoConvert handleInstInstalledFiles() to rpmfi(Set)Faction()
Panu Matilainen [Tue, 11 Nov 2008 20:17:10 +0000 (22:17 +0200)]
Convert handleInstInstalledFiles() to rpmfi(Set)Faction()

15 years agoAdd rpmfi get + set methods for file actions
Panu Matilainen [Tue, 11 Nov 2008 20:09:48 +0000 (22:09 +0200)]
Add rpmfi get + set methods for file actions

15 years agoRemove unnecessary initialization
Panu Matilainen [Tue, 11 Nov 2008 19:06:32 +0000 (21:06 +0200)]
Remove unnecessary initialization
- rpmfiNew() zeroes out everything, including striplen + astriplen

15 years agoMove file action calculations to rpmfiNew() where possible
Panu Matilainen [Tue, 11 Nov 2008 19:01:02 +0000 (21:01 +0200)]
Move file action calculations to rpmfiNew() where possible
- for build operations and src.rpm install this is known

15 years agoCpio flags are only relevant for fsm, get them out of rpmfi
Panu Matilainen [Tue, 11 Nov 2008 18:48:35 +0000 (20:48 +0200)]
Cpio flags are only relevant for fsm, get them out of rpmfi

15 years agoFigure out cpio mapflags in rpmfiNew()
Panu Matilainen [Tue, 11 Nov 2008 12:50:53 +0000 (14:50 +0200)]
Figure out cpio mapflags in rpmfiNew()
- all the necessary info is there, no need to litter the logic all over
  the place

15 years agoPush archivePos from rpmfi to fsm
Panu Matilainen [Tue, 11 Nov 2008 11:53:31 +0000 (13:53 +0200)]
Push archivePos from rpmfi to fsm
- archive position is only meaningful in fsm context anyway

15 years agoAdjust rpmfi directory count while messing with it in build
Panu Matilainen [Tue, 11 Nov 2008 15:35:42 +0000 (17:35 +0200)]
Adjust rpmfi directory count while messing with it in build
- otherwise we can miss some entries in rpmfiFN() max calculation and
  blow up in entertaining ways

15 years agoAdd the post-build package checker feature in rpmbuild (upstream ticket #2)
Jindrich Novy [Mon, 10 Nov 2008 14:52:29 +0000 (15:52 +0100)]
Add the post-build package checker feature in rpmbuild (upstream ticket #2)
- allow to run helper programs to check:
  - generated SRPM
  - each generated RPM after it is successfully written
  - whole successfully written binary package set
- it is possible to use it for sanity checks

15 years agoAdd macros for the post-build package checkers feature (upstream ticket #2)
Jindrich Novy [Mon, 10 Nov 2008 14:46:43 +0000 (15:46 +0100)]
Add macros for the post-build package checkers feature (upstream ticket #2)
- _build_pkgcheck: helper that is ran for every binary RPM successfully
  written
- _build_pkgcheck_set: helper ran for the whole binary package set
- _build_pkgcheck_srpm: helper ran for SRPM
- _nonzero_exit_pkgcheck_terminate_build: indicates whether the build
  should fail if helper returns non-zero exit status

15 years agoReset return values to zero + NULL's on not found in hash GetEntry()
Panu Matilainen [Fri, 7 Nov 2008 10:03:54 +0000 (12:03 +0200)]
Reset return values to zero + NULL's on not found in hash GetEntry()
- avoids having to separately check for return value in some cases and
  accidents from not resetting the values in caller
- in line with headerGet() behavior

15 years agoRename doLookup to fpLookup to get rid of one function just calling the other
Florian Festi [Wed, 5 Nov 2008 14:23:19 +0000 (15:23 +0100)]
Rename doLookup to fpLookup to get rid of one function just calling the other

15 years agocleanup fpLookupSubdir
Florian Festi [Fri, 7 Nov 2008 09:53:55 +0000 (10:53 +0100)]
cleanup fpLookupSubdir
 * rename end -> endsubdir
 * fix assignment mess
 * fix memory leak (no longer free current_fp.subDir which may be NULL)
 * set endsubdir to NULL while not valid

15 years agoReverse hash GetEntry() return code vs found/not found
Panu Matilainen [Fri, 7 Nov 2008 09:52:24 +0000 (11:52 +0200)]
Reverse hash GetEntry() return code vs found/not found
- be in line with hash HasEntry() and other similar functions
- internal-only function with just one place actually checking the return

15 years agorpmsqAction() proto needs SA_SIGINFO conditionals too (ticket #4)
Panu Matilainen [Thu, 6 Nov 2008 08:03:10 +0000 (10:03 +0200)]
rpmsqAction() proto needs SA_SIGINFO conditionals too (ticket #4)

15 years agoNuke the ugly hardwired "known arch" list from label parsing
Panu Matilainen [Wed, 5 Nov 2008 18:37:48 +0000 (20:37 +0200)]
Nuke the ugly hardwired "known arch" list from label parsing
- we have list of known archs in rpmrc, might as well use it
- avoids having to patch & recompile rpm just to have rpmtsInitIterator()
  recognize new archs when it's runtime configurable otherwise
- checking against compatible arch would be saner except then people could
  get into even more trouble using --ignorearch...

15 years agoCalculate filename buffer len lazily in rpmfiFN() as needed
Panu Matilainen [Wed, 5 Nov 2008 13:44:35 +0000 (15:44 +0200)]
Calculate filename buffer len lazily in rpmfiFN() as needed
- avoids having to separately calculate in genCpioListAndHeader()
- avoids unnecessary fnlen field in rpmfi struct
- avoids having to calculate it at all if rpmfiFN() is never called

15 years agoRemove yet more unused fields from rpmfi struct
Panu Matilainen [Wed, 5 Nov 2008 13:24:08 +0000 (15:24 +0200)]
Remove yet more unused fields from rpmfi struct

15 years agoRemove fperms and dperms from rpmfi struct
Panu Matilainen [Wed, 5 Nov 2008 13:18:43 +0000 (15:18 +0200)]
Remove fperms and dperms from rpmfi struct
- only fsm internals need and just use straightforward defaults, move
  the defaults there...

15 years agoUse cpioMapFlags type consistently for map flags
Panu Matilainen [Wed, 5 Nov 2008 12:30:01 +0000 (14:30 +0200)]
Use cpioMapFlags type consistently for map flags

15 years agoStop messing with fi->fstates allocations in psm
Panu Matilainen [Wed, 5 Nov 2008 12:10:16 +0000 (14:10 +0200)]
Stop messing with fi->fstates allocations in psm
- it's alloced and freed by rpmfiNew()/Free() always anyway

15 years agoKill off per-file cpio map flags
Panu Matilainen [Wed, 5 Nov 2008 11:17:50 +0000 (13:17 +0200)]
Kill off per-file cpio map flags
- nothing uses/needs them, one less murky fi->foo allocation less
- apparently a leftover from initial multilib attempts long long ago

15 years agoRemove unused variable
Panu Matilainen [Wed, 5 Nov 2008 10:45:03 +0000 (12:45 +0200)]
Remove unused variable

15 years agoRemove useless rpmfi->gid and uid "defaults"
Panu Matilainen [Wed, 5 Nov 2008 10:38:16 +0000 (12:38 +0200)]
Remove useless rpmfi->gid and uid "defaults"
- they were only ever set on src.rpm installation yet overridden by
  package contents unless src.rpm didn't contain RPMTAG_FILEUSERNAME
  (and GROUP). Which would mean rpm 1.0 packages or thereabouts, or a
  malformed package. In that case we just fall back to root uid,
  it hardly matters

15 years agofi->actions is already initialized earlier in rpmfiNew()
Panu Matilainen [Wed, 5 Nov 2008 09:49:33 +0000 (11:49 +0200)]
fi->actions is already initialized earlier in rpmfiNew()

15 years agofi->actions cannot be non-NULL in rpmfiNew()
Panu Matilainen [Wed, 5 Nov 2008 09:47:29 +0000 (11:47 +0200)]
fi->actions cannot be non-NULL in rpmfiNew()

15 years agoDead code removal
Panu Matilainen [Wed, 5 Nov 2008 07:36:20 +0000 (09:36 +0200)]
Dead code removal

15 years agoStop messing around with rpmfi user+group names from psm
Panu Matilainen [Tue, 4 Nov 2008 12:53:11 +0000 (14:53 +0200)]
Stop messing around with rpmfi user+group names from psm
- these are loaded and freed by rpmfiNew/Free() as necessary

15 years agoFix segfault on relocation (rhbz#468319)
Panu Matilainen [Tue, 4 Nov 2008 11:33:27 +0000 (13:33 +0200)]
Fix segfault on relocation (rhbz#468319)
- a bogus free() / thinko

15 years agoAvoid leaking C99 options into stock %{__cc} macro
Panu Matilainen [Tue, 4 Nov 2008 09:36:01 +0000 (11:36 +0200)]
Avoid leaking C99 options into stock %{__cc} macro

15 years agoReturn proper exit code when exec*() functions fail
Jindrich Novy [Tue, 4 Nov 2008 09:09:31 +0000 (10:09 +0100)]
Return proper exit code when exec*() functions fail
- the correct exit code should be 127 accoring to bash(1),
  we want to keep the same exit code behaviour as bash for rpm

15 years agoFix building on systems where SA_SIGINFO isn't available (ticket #4)
Panu Matilainen [Tue, 4 Nov 2008 08:28:20 +0000 (10:28 +0200)]
Fix building on systems where SA_SIGINFO isn't available (ticket #4)
- patch from Adam Tkac

15 years agoUse more portable file access mode tests (ticket #5)
Panu Matilainen [Tue, 4 Nov 2008 07:52:19 +0000 (09:52 +0200)]
Use more portable file access mode tests (ticket #5)
- don't make assumptions about how O_RDWR and friends are defined, use the
  portable way of masking flags with O_ACCMODE and explicit comparison
  against the mode we're interested in

15 years agoEnsure PATH_MAX is defined (ticket #3) Adam Tkac
Panu Matilainen [Mon, 3 Nov 2008 12:13:45 +0000 (14:13 +0200)]
Ensure PATH_MAX is defined (ticket #3) Adam Tkac
- POSIX doesn't require PATH_MAX to be defined as constant, and Hurd
  doesn't define it...
- deal with it just once in system.h for now, the proper fix is to get
  rid of needing it at all (ie add a mallocing realpath() clone to librpmio)
- patch from Adam Tkac

15 years agoDrop unnecessary trailing slash in pkgconfig includedir
Panu Matilainen [Fri, 31 Oct 2008 15:45:43 +0000 (17:45 +0200)]
Drop unnecessary trailing slash in pkgconfig includedir

15 years agoAdjust for file output change (rhbz#468129)
Panu Matilainen [Fri, 31 Oct 2008 08:17:07 +0000 (10:17 +0200)]
Adjust for file output change (rhbz#468129)
- file util used reported file details along with mime type, newer ones don't

15 years agoKill of scareMem / keep header flag from rpmds
Panu Matilainen [Thu, 30 Oct 2008 12:12:18 +0000 (14:12 +0200)]
Kill of scareMem / keep header flag from rpmds
- unnecessary complication which doesn't benefit anything (anymore)

15 years agoChange all in-tree rpmdsNew() uses to non-scaremem
Panu Matilainen [Thu, 30 Oct 2008 12:07:29 +0000 (14:07 +0200)]
Change all in-tree rpmdsNew() uses to non-scaremem
- shouldn't affect anything at all

15 years agoRemove unnecessary scaremem flags, hardwired to no scaremem anyway
Panu Matilainen [Thu, 30 Oct 2008 12:03:34 +0000 (14:03 +0200)]
Remove unnecessary scaremem flags, hardwired to no scaremem anyway
- no functional changes

15 years agoSave bunch of memory by not loading file classes in ts elements
Panu Matilainen [Thu, 30 Oct 2008 11:46:26 +0000 (13:46 +0200)]
Save bunch of memory by not loading file classes in ts elements
- install/remove doesn't need or use file class information at all,
  don't bother loading it, saves a few megs of memory on large transactions

15 years agoAdd couple of new rpmfi flags for file classes and file depends
Panu Matilainen [Thu, 30 Oct 2008 11:43:44 +0000 (13:43 +0200)]
Add couple of new rpmfi flags for file classes and file depends

15 years agoMove rpmfi color union calculation out of rpmfiNew()
Panu Matilainen [Wed, 29 Oct 2008 13:23:49 +0000 (15:23 +0200)]
Move rpmfi color union calculation out of rpmfiNew()
- nothing at all uses the calculated value or rpmfiColor() call, take
  the unnecessary calculation out of common path into rpmfiColor()

15 years agoRemove unused package color calculations from 2003
Panu Matilainen [Wed, 29 Oct 2008 13:06:37 +0000 (15:06 +0200)]
Remove unused package color calculations from 2003

15 years agoDon't bother fetching and storing pre- and posttrans scripts in rpmfi
Panu Matilainen [Wed, 29 Oct 2008 12:34:36 +0000 (14:34 +0200)]
Don't bother fetching and storing pre- and posttrans scripts in rpmfi
- the psm script machinery requires the full header to do anything at
  all, so the script + scriptprog were only used to check if the package
  *has* such scripts, a single integer will do just fine there thank you

15 years agoConvert in-tree users of rpmfiNew() to use flag names
Panu Matilainen [Wed, 29 Oct 2008 12:09:27 +0000 (14:09 +0200)]
Convert in-tree users of rpmfiNew() to use flag names
- easier to grep for than scareMem, preparing for further flags

15 years agoTurn rpmfiNew() scareMem argument into bitfield of flags
Panu Matilainen [Wed, 29 Oct 2008 12:08:12 +0000 (14:08 +0200)]
Turn rpmfiNew() scareMem argument into bitfield of flags
- preserve behavior with 0/1
- more room for controlling what gets loaded into file info set, not
  everything is needed at all times

15 years agoSet timezone to UTC every time to avoid local timezone confusion
Jindrich Novy [Wed, 29 Oct 2008 12:38:16 +0000 (13:38 +0100)]
Set timezone to UTC every time to avoid local timezone confusion

15 years agoAdd --filecaps popt alias for looking at file capabilities
Panu Matilainen [Wed, 29 Oct 2008 10:09:27 +0000 (12:09 +0200)]
Add --filecaps popt alias for looking at file capabilities
- doesn't need much as the capabilities are stored in human readable format

15 years agoAdd proper file capability verification support
Panu Matilainen [Wed, 29 Oct 2008 09:53:31 +0000 (11:53 +0200)]
Add proper file capability verification support
- at least for now, no capabilities is treated like empty capability set
  which are not exactly the same thing but probably sufficient for our
  purposes

15 years agoAdd fsm and rpmfi machinery for file capabilities
Panu Matilainen [Wed, 29 Oct 2008 09:49:38 +0000 (11:49 +0200)]
Add fsm and rpmfi machinery for file capabilities
- new rpmfiFCaps() API to retrieve the info from rpmfi set
- fsm internals quite similar to selinux handling
- plenty of #ifdef's, another possibility would be adding cap_foo dummies to
  system.h like for selinux

15 years agoStart adding POSIX 1.e draft file capability support for real
Panu Matilainen [Wed, 29 Oct 2008 08:49:25 +0000 (10:49 +0200)]
Start adding POSIX 1.e draft file capability support for real
- Parse %caps() from spec filelists, making best-guess verification of
  capability string sanity by passing to cap_from_text()
- The posix draft specifies capability export presentation through
  cap_copy_ext() which would be fine, except that we don't have support for
  arrays of binary data. So we simply store the textual representation
  of the capabilities in a string array which we do have.
- Only add capability tag on packages which actually have capabilities to
  avoid unnecessary header bloat.
- Add a new rpmlib() dependency for file capabilities, packages relying
  on file capabilities wont work correctly unless the capabilities are set.
  To be fully correct, support for on-filesystem file capabilities should
  be checked at runtime, as this depends on kernel versions and such...

15 years agoDon't try to verify capabilities of directories and non-regular files
Panu Matilainen [Wed, 29 Oct 2008 08:39:00 +0000 (10:39 +0200)]
Don't try to verify capabilities of directories and non-regular files

15 years agofix compiler warning
Florian Festi [Mon, 27 Oct 2008 12:08:39 +0000 (13:08 +0100)]
fix compiler warning
by removing unnesseccary return address for the hash key

15 years agoBeginnings of acl (POSIX.1e draft 17) verification support
Panu Matilainen [Sun, 26 Oct 2008 12:18:17 +0000 (14:18 +0200)]
Beginnings of acl (POSIX.1e draft 17) verification support
- if built with --with-acl, check that files and directories don't have
  any extra acl's set
- for now, any acl beyond the regular unix permission set is reported as
  file mode difference as the acl's cannot have been set by rpm itself
- patch from Andreas Gruenbacher, modified to use libacl instead of raw
  xattrs for portability, BUT atm this uses non-portable acl_equiv_mode()
  Linux libacl extension, the posix draft doesn't seem to have much in
  the way of comparing entries :-/

15 years agoBeginnings of file capability (POSIX.1e draft 15) verification support
Panu Matilainen [Sun, 26 Oct 2008 12:17:16 +0000 (14:17 +0200)]
Beginnings of file capability (POSIX.1e draft 15) verification support
- add minimal bits and pieces to check for capabilities in files on verify
- for now, any capability set is a verification failure as the capability
  cannot have been set by rpm itself
- patch from Andreas Gruenbacher, modified to use libcap instead of raw
  xattrs for portability

15 years agoRemove timezone autoconf checks and system.h reference
Jindrich Novy [Fri, 24 Oct 2008 10:32:31 +0000 (12:32 +0200)]
Remove timezone autoconf checks and system.h reference
- timezone is no more used so it's no more needed

15 years agoFix "timewarp" bug while listing changelog via "rpm -q --changelog"
Jindrich Novy [Fri, 24 Oct 2008 10:31:02 +0000 (12:31 +0200)]
Fix "timewarp" bug while listing changelog via "rpm -q --changelog"
- date is no more one day in advance than written in changelog

15 years agoUse better cache sizes
Florian Festi [Thu, 16 Oct 2008 10:13:13 +0000 (12:13 +0200)]
Use better cache sizes

15 years agoImprove finger print hash function to avoid degeneration of hash tables
Florian Festi [Thu, 16 Oct 2008 10:07:44 +0000 (12:07 +0200)]
Improve finger print hash function to avoid degeneration of hash tables