- Package install and erase ultimately need different types of file
iterators, grab and pass the actual file set handle instead of an iterator
from psm and use a local iterator in fsm. Passing the rpmfiles handle
isn't strictly needed, fsm could grab it from the element by itself...
This also eliminates the last use of rpmteFI() in librpm.
- No functional changes here, both install and erase still use
a plain old forward rpmfi iterator which is plain wrong for both
of them.
- Package building has no associated transaction or ts members,
this was all just fake-up kludgery to work around the way how
fsm used to work. None of it relevant now, kill kill kill.
Create cpio_t data type that holds the underlaying FD_t instance
Move padding and position handling and trailer generation into cpio.c
Use only one buffer in the fsm (merging the read and write buffer)
Replace the FSM_EAT, FSM_POS, FSM_PAD, FSM_DREAD, FSM_DWRITE states with cpio functions
Prepend "rpm" to the cpio function names
- These are nothing but unnecessarily specialized Fopen(), Fwrite() and
Fclose() for what is a purely local need in expandRegular(). Move
the local stuff where it belongs.
- These are nothing but unnecessarily specialized Fopen(), Fread() and
Fclose() for what is a purely local need in writeFile(). Move
the local stuff where it belongs.
- Move parsing, setting and freeing of capabilities into simple
helper function, there's no point whatsoever having the current
capability stored in fsm when it only complicates freeing and all.
WTH was I thinking when implementing this? (well, everything in
fsm was done that way so... but that's a lame excuse)
- Move all the label foobar into a simple helper function which
finds, sets and frees the context if selinux is enabled, use
for both regular operation and orphan directory labeling.
Simplifies things a good deal...
- While the selabel handle can change during a transaction, it
wont change while the fsm is running so its sufficient to grab
it on entry instead of repeatedly calling rpmtsSELabelHandle() after
figuring out where in the world our ts might be.
- These are not used or needed outside fsmMkdirs() so its just
plain dumb to have them in the big struct. No functional changes,
just taming the fsm monster a little bit.
- Similar in spirit to PSM blackbox treatment in
commit df9cdb1321, except that
technically fsm guts are still wide-open in fsm.h due to cpio
"needing" them (yuck).
- Allows getting rid of dumb a**-backwards things like rpmfiFSM()
which is just not needed, fsm is a relatively short-lived entity
inside psm and build, nobody else needs to bother with it except
for the returned results.
- Figure out the cpio map flags in fsmSetup() where it logically belongs,
we have all the necessary info available there.
- Get rid of newFSM() and freeFSM(), we can just as well place the
fsm on stack, merge the necessary cleanup bits from freeFSM()
into fsmTeardown()
- Supposedly no functional changes, knock wood.
- Move notifications from fsm to psm side for sanity and symmetry,
psm already has members to hold the callback state.
- Replace PSM_NOTIFY "state" with a helper function that both
fsm and psm itself use (except for error callbacks which are
a bit different)
- Init psm->total early, this doesn't change and can now be
used to refer to "all done" value whatever it happens to be,
instead of magic "100" values etc.
- Packages with no files are now handled through the same path
as everything else from progress reporting pov, we just skip calls
to fsm if there are no files.
- Issue stop callbacks for install as well. While INST_CLOSE_FILE
can be (and is currently) used to detect this condition, its
conceptually an entirely different thing.
- Fix erasure callback parameters, they were reversed (starting from
total and ending with 0, ehh...)
- This was beginnings of something ten years ago, and that something
was long since abandoned. These never did anything useful
that --justdb/--noscripts wouldn't do.
- Enums are fine for defining the bitfield flags, but the bitfield
itself is not an enumeration. Add a separate typedef on "rpmFlags"
type (presenting a bitfield of flags) for all of these. Compilers
hardly care, but the typedefs give a nice visual clue for
us humans using these flags far away from ho^H^H definitions.
- the fsm thingie doesn't need to deal with chroot issues: except for
build where it doesn't matter, its only called from psm where the
chroot is already taken care of
- 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
- 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
- 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
- fsmGetTs(), fsmGetFi(), fileStageString(), fileActionString(),
fsmMapPath(), fsmMapAttrs() and fsmStage() aren't needed outside fsm,
make 'em static to avoid leaking to symbol space
- 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