Commit Graph

115 Commits

Author SHA1 Message Date
Panu Matilainen 74a4f639e2 Lose unused/useless Type and tagN fields from rpmfi struct 2009-03-27 16:12:25 +02:00
Jindrich Novy 7acdfded4a Add md5->filedigest aliases (rhbz#487597)
- add %verify(nofiledigest) as %verify(nomd5) file attribute alias
- reference digests as digests not checksums
- make old md5 related symbols obsolete and use newer reference
- update man page accordingly
2009-02-27 14:34:39 +01:00
Panu Matilainen 3d314301ca Use per-rpmfi string cache for file capability strings
- most packages wont have file capabilities attached at all, and even
  where present, the files with capabilities are likely to be few and
  far in between, avoid wasting memory
2009-02-05 22:37:27 +02:00
Panu Matilainen 897bbbd708 Add internal rpmfi apis to deal with fingerprints, use them 2008-12-19 15:04:51 +02:00
Panu Matilainen 3c22ec586f Add (internal) rpmfi accessor for dir indexes
- except for dnli->active setting in dnlInitIterator(), "give me
  directory matching this basename index" would be sufficient
2008-12-11 10:07:41 +02:00
Panu Matilainen 9c15574bae Add indexed accessors for rpmfi data, internal only for now
- fsm in particular wants random access to rpmfi data and there's little
  reason to deny it, file info data is not going to move to linked lists
  or anything like that anytime soon, permitting indexed access allows
  eliminating direct accesses to rpmfi struct
2008-12-11 08:57:16 +02:00
Florian Festi 6e7b664e81 Kill rpmfiUpdateState and free all the rpmfis as soon as file conflict check is done 2008-12-10 13:40:53 +01:00
Florian Festi 395b5cffd5 Move ->actions from rpmfi to rpmfs
and adjust all code using it
also "revert" a4e345455d
 "Move file action calculations to rpmfiNew() where possible"
2008-12-10 13:40:53 +01:00
Florian Festi 9c9410dc7a Move the run time part of fstates from rpmfi to rpmfs. Keep fstates in rpmfi as long as it is a real tag read from the rpmdb. 2008-12-10 13:40:53 +01:00
Florian Festi 8fa80b0f35 Create a new datastructure rpmfs aka File States that contains the information what to do with the files of an transaction element.
This patch moves rpmfi->replaced over to rpmfs. Move struct members to follow.
2008-12-10 13:40:53 +01:00
Panu Matilainen 8b7cb846d4 Eliminate the now unused ts element field of file info sets 2008-11-27 10:28:10 +02:00
Panu Matilainen c8d0ea1c72 Move transscripts stuff from rpmfi to rpmte
- transaction scripts have zero to do with files...
2008-11-24 16:45:22 +02:00
Florian Festi 2f58ae809f API for accessing and creating fi->replaced
- new API is not compatible with accessing fi->replaced directly!
2008-11-24 14:03:16 +01:00
Panu Matilainen 2a1e88d27e Use per-rpmfi string cache for symlink targets
- few files are actually symlinks so this is very sparse data
- per-rpmfi instead of global as link target names are not that likely
  to be shared across packages
- another few megs saved...
2008-11-20 10:26:22 +02:00
Panu Matilainen 5487213d18 Add functions to create and free string cache(s) 2008-11-20 10:15:08 +02:00
Panu Matilainen 325198377d Use global cache for file languages too
- there's only a very limited number of language names ever present,
  and most files don't have languages attached at all
- another few megs saved on memory
2008-11-20 09:53:27 +02:00
Panu Matilainen 3bdac8f451 Generalize the user+group string cache + helpers 2008-11-20 09:26:12 +02:00
Panu Matilainen f90f2f1015 Be more intelligent about storing file user and group names
- User and group names contain an enormous amount of redundancy: typically
  most files and directories are owned by root:root. Store the each unique
  name just once into global cache and store indexes to the cache into
  rpmfi user + group arrays. This saves several megabytes of memory on
  a transaction of non-trivial size...
- The cache implementation is dumb, but it's not noticeably slower than
  uncached version, copying megs of strings around is not cheap either.
  Easy enough to replace with a hash-table or such if performace becomes
  and issue...
2008-11-19 18:17:56 +02:00
Panu Matilainen 9bde09b599 Add + use internal helper function for getting+setting rpmfi replaced sizes
- lazy allocation on set, otherwise there's no replaced size - the getter
  deals with this transparently
- saves a fair bit of memory, by no means everything has replaced files...
2008-11-19 12:42:47 +02:00
Panu Matilainen d0b0883285 Eliminate unnecessary fi->record field
- transaction elements carry the db instance already and is available
  where needed
2008-11-19 11:59:53 +02:00
Panu Matilainen 9444f2d7f5 Remove useless default flags and action fields from rpmfi
- fi->actions is always allocated so fi->action is never used for anything
- fi->flags is just as unused and unnecessary
2008-11-18 17:12:55 +02:00
Panu Matilainen f41bd90c2a Nuke useless rpmfiFContext()
- it only ever returns NULLs because there are no security contexts in
  headers (and having them in headers make no sense as the context varies
  based on whatever selinux policy happens to be active on the target
  system)
2008-11-18 16:33:07 +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 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 170f5bf7d6 Eliminate bogus const from fi->apath 2008-11-15 17:20:13 +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 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 fbc06059cb Cpio flags are only relevant for fsm, get them out of rpmfi 2008-11-11 20:48:35 +02:00
Panu Matilainen 8e3b5bfc89 Push archivePos from rpmfi to fsm
- archive position is only meaningful in fsm context anyway
2008-11-11 18:16:22 +02:00
Panu Matilainen a9169c46ab 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
2008-11-05 15:44:35 +02:00
Panu Matilainen 6bd6677f86 Remove yet more unused fields from rpmfi struct 2008-11-05 15:24:08 +02:00
Panu Matilainen b43998c374 Remove fperms and dperms from rpmfi struct
- only fsm internals need and just use straightforward defaults, move
  the defaults there...
2008-11-05 15:18:43 +02:00
Panu Matilainen 52d53b8bf9 Use cpioMapFlags type consistently for map flags 2008-11-05 14:30:01 +02:00
Panu Matilainen ed412a0e2f 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
2008-11-05 13:17:50 +02:00
Panu Matilainen 455a4cd652 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
2008-11-05 12:38:16 +02:00
Panu Matilainen aabdfb8866 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()
2008-10-30 13:47:40 +02:00
Panu Matilainen cff6230a8c 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
2008-10-30 13:47:40 +02:00
Panu Matilainen 97ab15cc9e 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
2008-10-29 11:49:38 +02:00
Panu Matilainen feb0379464 Lose the remaining hae and hme vectors from rpmfi 2008-06-18 11:16:04 +03:00
Panu Matilainen 8687797c1c Replace headerRemoveEntry() with headerDel() everywhere
- this is a no-brainer s/headerRemoveEntry/headerDel/g operation as the
  interface didn't actually change at all
2008-06-17 09:07:37 +03:00
Panu Matilainen 7b8fc75dea Kill off hge() and hfd() vectors in rpmfi_s
- hfd() with FORCEFREE or STRING_ARRAY is just regular free()
- hge() no longer needed...
2008-06-13 17:00:21 +03:00
Panu Matilainen 911b3151ae Unbreak relocations broken by 621e751841
- stick scareFlags into rpmfi_s for now so they're available everywhere
- subtle games with how fi->dil is alloced on scareMem behavior, don't
  blow up and don't leak memory either
- stuff scareFlags into rpmfi struct for now
2008-06-13 17:00:21 +03:00
Panu Matilainen 161395648f Use 64bit type internally for package archive size & offset
- cpio "new" ascii format limits individual files to UINT32_MAX, no such
  limit on the entire archive though
- RPMSIGTAG_PAYLOADSIZE is 32bit type atm, assert that the archive size
  fits to UINT32_MAX despite internal presentation being larger
- FD_t limits the real archive to rpm_off_t still
2008-06-09 12:29:07 +03:00
Panu Matilainen ae5667cf06 Lose unused fdigests array from rpmfi struct
- only used in rpmfiNew() where it's converted to binary from the header
  hex presentation and free'd immediately, a local variable will do just as
  well
- some useless references in fsm and psm, kill'em too
2008-06-02 09:50:48 +03:00
Panu Matilainen 95e65d98ea More preliminaries for non-md5 file checksums
- add rpmfiDigest() method (similar to one in rpm5.org) for retrieving
  file digest, algorithm and digest size
- make rpmfiMD5() just a special case of rpmfiDigest()
2008-06-02 09:50:48 +03:00
Panu Matilainen f771b641d3 Rename rpmfi and fsm checksum md5-sum fields to refer to digest
- no functional changes
- groundwork for supporting other than md5 checksums
2008-06-02 09:50:48 +03:00
Panu Matilainen 14f39232e6 Remove bogus const from rpmfi pre- and posttrans members
- they're always duped, scaremem or not
2008-04-24 15:38:45 +03:00
Panu Matilainen d718b12f5b Mass convert (back) to rpmTag as it's usable everywhere now
- cast away a few cases where the enum usage causes ridiculous amount
  of compiler warnings from unhandled switch-cases
2008-02-05 17:42:19 +02:00
Panu Matilainen ceb96638f6 Use rpm_flag_t for header generic bitfields (file flags etc)
- additionally use rpmfileAtts / rpmVerifyFlags consistently where
  appropriate
2008-02-05 15:15:41 +02:00
Panu Matilainen 9b0967588a More rpm-headerdata types: rpm_dev_t and rpm_ino_t, use where spotted
- both hardwired to 32bit internally
2008-02-05 13:09:13 +02:00
Panu Matilainen e5116e43d7 Add rpm_rdev_t type for rdev entries
- rdev is 16bit whereas dev is 32bit, eww...
2008-02-05 12:58:05 +02:00
Panu Matilainen e7ac5fb183 Add rpm_mode_t type, use where spotted
- bring the types under some sort of control, previously mixture of
  int16_t, uint16_t and unsigned short was used..
2008-02-05 12:31:32 +02:00
Panu Matilainen 630a5a4c1a Add rpm_color_t type for rpm color bits, use where spotted 2008-02-05 12:12:31 +02:00
Panu Matilainen aca6d4a2c4 Add rpm_time_t type for time types (in headers), use where spotted
- easy to spot, easy to change...
- time_t size can vary, header data needs fixed size
2008-02-04 11:50:39 +02:00
Panu Matilainen e886043a10 Add rpm_off_t type for file size types, use where spotted
- preliminaries for bumping up the max size, use rpm-specific type
  as off_t size varies, header data needs fixed size
2008-02-04 11:27:00 +02:00
Panu Matilainen f53c323372 Make rpmtag.h standalone, include from rpmtypes.h
- permits header.h to use the tag types
- revert other includes back to header.h, more crazy #include churn...
- rpmTagTable etc in header.h for now, don't really belong there but...
2008-02-03 16:24:07 +02:00
Panu Matilainen 99faa2735b rpmlib.h mass eviction
- explicitly include what's really needed instead
- document remaining uses
2008-01-30 13:53:51 +02:00
Panu Matilainen 519eaaf236 Assorted int -> size_t corrections for string lengths 2008-01-02 13:55:16 +02:00
Panu Matilainen 898d2cc867 transaction.c doesn't need fsm.h, rpmfi_internal does 2007-12-17 13:50:11 +02:00
Panu Matilainen 7e56c6355b Use rpm_tag_t everywhere for rpm (header) tag type
- typedef'ed as int32_t for now, negative values used in some places for
  error cases
- easy to grep, easy to change...
- add RPMTAG_NOT_FOUND define, used in place of -1 "magic",
2007-12-13 19:32:37 +02:00
Panu Matilainen c8f2927227 Use rpm_count_t everywhere for header data count
- typedef'ed as uint32_t as that's the key size limit imposed by BDB,
  relevant for RPM_BIN_TYPE
- easy to change to whatever later on as it's now consistent everywhere
2007-12-13 09:25:10 +02:00
Panu Matilainen 9ce13e09ef Switch to <rpm/foo.h> style for public headers
- adjust include paths accordingly
2007-12-08 14:02:32 +02:00
Panu Matilainen 2c3ce0c8b0 Split rpmfi internals to separate header 2007-12-03 09:46:51 +02:00