Commit Graph

8704 Commits

Author SHA1 Message Date
Jindrich Novy 73c17671de Add AC_CONFIG_MACRO_DIR for the new libtool 2008-11-18 11:23:26 +01:00
Panu Matilainen dbad382930 Don't bother loading FILELANGS for installed packages
- only useful for anything when installing packages
2008-11-18 11:30:43 +02:00
Panu Matilainen 03d0f43f0b Lazy allocation of FSM for file info sets
- new more or less internal rpmfiFSM() to create FSM on demand, move
  mapflags calculation there
2008-11-18 11:27:47 +02:00
Panu Matilainen 61794cf2c0 Remove now unnecessary fi->keep_header 2008-11-18 11:27:04 +02:00
Panu Matilainen 341aaa6515 Remember rpmfi creation flags 2008-11-18 11:26:56 +02:00
Panu Matilainen ff9733b6fd Generate and insert SOURCERPM tag earlier
- needed to make checking for source/binary package in rpmfiNew() reliable
  at build time
2008-11-18 11:22:26 +02:00
Panu Matilainen 8d6c4b8c95 Add + use internal helper function for setting rpmfi file states
- instead of directly accessing the array from fsm, use a helper function
  which lazily allocates the state array as needed and sets state
- also fixes the silly case of non-installed packages showing their files
  as "normal", ie installed (now it shows "no state" as it's not relevant)
2008-11-17 17:29:31 +02:00
Panu Matilainen 4927190cf1 Simplify rpmInstallLoadMacros()
- fi argument unused, remove
- no relevant return value, make it void
- handle any proper data type for per-header macros
2008-11-17 16:12:04 +02:00
Panu Matilainen 936fc19176 Avoid reconstructing half of rpmfi manually in rpmInstallSourcePackage()
- similarly to commit 53ee682a49, arrange
  the header to contain necessary paths before calling rpmfiNew()
- avoid unnecessary accesses to rpmfi internals otherwise too
2008-11-17 16:04:48 +02:00
Panu Matilainen a919e1d631 Unnecessary local variable, result only needed once 2008-11-17 14:21:38 +02:00
Panu Matilainen 4181d7adad Assume failure in rpmInstallSourcePackage()
- avoids bunch of redundant assignments
2008-11-17 14:20:21 +02:00
Panu Matilainen 899dfb5892 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
2008-11-17 13:39:22 +02:00
Panu Matilainen 74ed5372f6 Make depflagsFormat() accept any numeric type 2008-11-17 12:44:57 +02:00
Panu Matilainen 05a3d00162 Simplify xmlFormat() by taking advantage of rpmtdClass() 2008-11-17 12:42:53 +02:00
Panu Matilainen 8ef09ba46c Make fflagsFormat() accept any numeric type 2008-11-17 12:41:24 +02:00
Panu Matilainen 53dcad2f9d Make permsFormat() work with any numeric type 2008-11-17 12:39:13 +02:00
Panu Matilainen 5580fe23d5 Make triggertypeFormat() work for any numeric type 2008-11-17 12:37:42 +02:00
Panu Matilainen f31b790c31 Make shescapeFormat() to accept any numeric type 2008-11-17 12:34:22 +02:00
Panu Matilainen 2b3380aa34 Take advantage of rpmtdGetNumber() for date format specifiers
- dateFormat() and dayFormat() now work for any numeric type
2008-11-17 12:29:01 +02:00
Panu Matilainen ee6c147a23 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
2008-11-17 12:23:19 +02:00
Panu Matilainen d97e357560 Simplify stringFormat() by using rpmtdGetNumber() 2008-11-17 12:16:51 +02:00
Panu Matilainen 2db2c376b3 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
2008-11-17 12:04:08 +02:00
Panu Matilainen ed5306b0be 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
2008-11-17 11:31:00 +02:00
Panu Matilainen 4fa662abd1 Use rpmpsmNew() + rpmpsmFree() instead of manually doing the same 2008-11-15 17:55:47 +02:00
Panu Matilainen 170f5bf7d6 Eliminate bogus const from fi->apath 2008-11-15 17:20:13 +02:00
Panu Matilainen 32b347aa1f Eliminate match iterator from psm struct
- it's only needed in local scope anywhere, no point having it psm global
2008-11-15 16:00:36 +02:00
Panu Matilainen 53ee682a49 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.
2008-11-15 14:22:47 +02:00
Panu Matilainen 2d5b4e3bac Lose useless fsm/rpmfi astriplen field
- only "used" for debugging output, duh...
2008-11-15 13:22:19 +02:00
Panu Matilainen 21c34a30eb 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
2008-11-15 12:07:44 +02:00
Panu Matilainen 3632ad454b 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
2008-11-15 11:50:09 +02:00
Panu Matilainen 2eb2569d46 Don't have to free what's not allocated to begin with... 2008-11-14 22:45:42 +02:00
Panu Matilainen 79225b7487 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
2008-11-14 22:44:07 +02:00
Panu Matilainen 2835e091ae 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...
2008-11-14 17:16:42 +02:00
Panu Matilainen ee59836299 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
2008-11-14 16:22:51 +02:00
Jindrich Novy 0b0fe33d3c Allow setting custom parameters to patch (rhbz#471006)
- added new _default_patch_flags macro with the rpm default
  "-s" parameter
2008-11-14 15:16:08 +01:00
Panu Matilainen e0e0a5e035 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
2008-11-14 09:47:43 +02:00
Panu Matilainen 9646a117c9 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.
2008-11-13 13:22:03 +02:00
Panu Matilainen ed8b3fb2c5 Move ts and preferred color fetching out of the loop
- neither ts or preferred color changes per-file
2008-11-13 09:56:52 +02:00
Panu Matilainen ed9836dfba Remove unused fsm subbuf field 2008-11-12 21:58:56 +02:00
Panu Matilainen 526c052dd2 Don't bother retrieving db offset for erase elements
- not needed anymore, use -1 to mean "unused" and document dboffset
  to rpmtsAddEraseElement() as unused
2008-11-12 19:36:58 +02:00
Panu Matilainen c11c97b67c Take advantage of headerGetInstance() in removePackage()
- avoids an extra argument, making dboffset argument to
  rpmtsAddEraseElement() unused
2008-11-12 19:33:12 +02:00
Panu Matilainen 3cfac308be 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?
2008-11-12 19:24:58 +02:00
Panu Matilainen 0c707fe370 Grab rpmfi record from header on rpmfiNew()
- avoids having to muck with it from rpmtsRun()
2008-11-12 18:29:51 +02:00
Panu Matilainen b9010a3510 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
2008-11-12 17:58:37 +02:00
Panu Matilainen 90cb50ff7a Convert obvious bits of rpmtsRun() to use rpmfiFAction()
- remaining access to fi->actions is the nasty part of copying things
  around to transfer state
2008-11-11 22:37:12 +02:00
Panu Matilainen 2f6e1bbb80 Convert skipFiles() to rpmfi(Set)FAction() 2008-11-11 22:35:45 +02:00
Panu Matilainen 2ee45ef12a Convert handleOverlappedFiles() to rpmfi(Set)Faction() 2008-11-11 22:32:23 +02:00
Panu Matilainen 715917ba37 Convert handleRmvdInstalledFiles() to rpmfiSetFAction() 2008-11-11 22:19:29 +02:00
Panu Matilainen ac2eb4f66d Convert handleInstInstalledFiles() to rpmfi(Set)Faction() 2008-11-11 22:17:10 +02:00
Panu Matilainen 78df129248 Add rpmfi get + set methods for file actions 2008-11-11 22:09:48 +02:00