Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309
Signed-off-by: wangbiao <biao716.wang@samsung.com>
|
|
- 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.
|
|
Reduce fileStage to the three "goal" stages
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
- CPIO_ALL_HARDLINKS flag and related code has been unused and dead
since rpm >= 4.6.x
|
|
- 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.
|
|
- Both digest algo and the current file digest from header are
only needed inside expandRegular(), push the stuff down there.
|
|
|
|
- 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.
|
|
|
|
- Allocate fsm->suffix directly when suffix is needed instead.
Doesn't change anything, only makes life that little bit simpler.
|
|
|
|
- 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 df9cdb1321ada8e3b120771f91a2eefab4ac2ad5, 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
|
|
- just a few places need, avoid polluting everything with it
- make fsm->fcaps void * to avoid having to deal with fcap_t not defined
|
|
- in reality the paths point to allocated memory at all times
|
|
- only the FSM cares about cpio position, move it there - there's only
ever one fd active inside FSM, no need to track it per-fd
|
|
- 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
|
|
- fsm needs the transaction element for progress notification and
element type anyway
|
|
- rpmfi is messed with (at least file actions)
- const on typedef'ed type doesn't mean a thing anyhow
|
|
|
|
- only "used" for debugging output, duh...
|
|
|
|
|
|
- archive position is only meaningful in fsm context anyway
|
|
- 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
|
|
- build code uses fsmSetup() and fsmTearDown(), those need to remain
visible for now
|
|
|
|
- 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
|
|
|
|
- no functional changes
- groundwork for supporting other than md5 checksums
|
|
- preliminaries for bumping up the max size, use rpm-specific type
as off_t size varies, header data needs fixed size
|
|
- callers need to free it so const is wrong
- cast away the hardlink-hackery in fsm instead
|
|
- allows FSM* typedefs to move to where they belong
|
|
|
|
- nothing outside fsm.c needs except for the declaration in fsm_s
|