summaryrefslogtreecommitdiff
path: root/lib/fsm.h
AgeCommit message (Collapse)AuthorFilesLines
2023-11-16Upgrade version to 4.14tizen/4.14.1.1.tizen20230628wangbiao1-7/+6
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309 Signed-off-by: wangbiao <biao716.wang@samsung.com>
2012-04-24Eliminate rpmts and rpmte kludgery from package buildingPanu Matilainen1-1/+1
- 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.
2012-03-30Move internal stuff from fsm.h to fsm.cFlorian Festi1-93/+2
Reduce fileStage to the three "goal" stages
2012-03-30Kill FSM: Remove remainsFlorian Festi1-4/+1
2012-03-30Kill FSM: Make FSM_PKGBUILD a functionFlorian Festi1-0/+3
2012-03-30Kill FSM: Make FSM_PKGERASE a functionFlorian Festi1-0/+3
2012-03-30Kill FSM: Make FSM_PKGINSTALL a functionFlorian Festi1-0/+3
2012-03-27Move fsm_s to fsm.c and remove fsmNext() from fsm.hFlorian Festi1-47/+0
2012-03-27Untangle lib/fsm.c and lib/cpio.cFlorian Festi1-11/+4
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
2012-01-17Kill off yet more repackage remnants from fsmPanu Matilainen1-1/+0
- CPIO_ALL_HARDLINKS flag and related code has been unused and dead since rpm >= 4.6.x
2012-01-17Eliminate FSM_WOPEN, FSM_WRITE and FSM_WCLOSE stagesPanu Matilainen1-5/+0
- 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.
2012-01-17Eliminate FSM_ROPEN, FSM_READ and FSM_RCLOSE stagesPanu Matilainen1-5/+0
- 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.
2012-01-17Eliminate file digest related members from fsm structPanu Matilainen1-2/+0
- Both digest algo and the current file digest from header are only needed inside expandRegular(), push the stuff down there.
2012-01-16Eliminate the now obviously unnecessary opath member from fsm structPanu Matilainen1-1/+0
2012-01-13Sanitize file capability setting in fsmPanu Matilainen1-1/+0
- 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)
2012-01-13Sanitize selinux labeling in fsmPanu Matilainen1-1/+1
- 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.
2012-01-13Eliminate unused subdir member from fsm structPanu Matilainen1-1/+0
2012-01-13Eliminate silly sufbuf from fsm structPanu Matilainen1-2/+1
- Allocate fsm->suffix directly when suffix is needed instead. Doesn't change anything, only makes life that little bit simpler.
2012-01-13Remove unused "orphan" directory creation tracking variable from fsmPanu Matilainen1-1/+0
2012-01-13Move directory tracking variables out of fsm struct to local scopePanu Matilainen1-4/+0
- 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.
2012-01-11Turn FSM into a blackbox, much like PSM isPanu Matilainen1-33/+3
- 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.
2012-01-05Clean up progress callbacks in fsm/psm machineryPanu Matilainen1-0/+2
- 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...)
2012-01-05Pass and remember the controlling psm (if any) in fsmPanu Matilainen1-0/+5
2010-12-20Rip the stillborn, broken apply/commit transaction gooPanu Matilainen1-2/+0
- 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.
2010-09-21Stop abusing enum typedefs for bitfield typesPanu Matilainen1-2/+3
- 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.
2010-05-31Eliminate unused no-op FSM_CHROOT stagePanu Matilainen1-1/+0
- 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
2010-01-05Remove libcap stuff out of system.hPanu Matilainen1-1/+1
- just a few places need, avoid polluting everything with it - make fsm->fcaps void * to avoid having to deal with fcap_t not defined
2009-12-16Remove bogus const from fsm [o]path members and use of _constfree()Panu Matilainen1-2/+2
- in reality the paths point to allocated memory at all times
2009-10-14Remove cpio stuff from FD_tPanu Matilainen1-0/+1
- 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
2009-02-27Add md5->filedigest aliases (rhbz#487597)Jindrich Novy1-2/+2
- 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
2008-11-27Pass rpmte to fsmSetup()Panu Matilainen1-0/+1
- fsm needs the transaction element for progress notification and element type anyway
2008-11-27Remove bogus consts from fsmSetup() argsPanu Matilainen1-2/+2
- rpmfi is messed with (at least file actions) - const on typedef'ed type doesn't mean a thing anyhow
2008-11-19Use matching type for fsm->digest to avoid unnecessary castPanu Matilainen1-1/+1
2008-11-15Lose useless fsm/rpmfi astriplen fieldPanu Matilainen1-1/+0
- only "used" for debugging output, duh...
2008-11-12Remove unused fsm subbuf fieldPanu Matilainen1-1/+0
2008-11-11Cpio flags are only relevant for fsm, get them out of rpmfiPanu Matilainen1-1/+2
2008-11-11Push archivePos from rpmfi to fsmPanu Matilainen1-0/+1
- archive position is only meaningful in fsm context anyway
2008-10-29Add fsm and rpmfi machinery for file capabilitiesPanu Matilainen1-0/+2
- 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-09Mark various fsm* bits internalPanu Matilainen1-0/+3
- build code uses fsmSetup() and fsmTearDown(), those need to remain visible for now
2008-07-03Plug leaks in selinux context handling in fsmPanu Matilainen1-1/+1
2008-06-09Use 64bit type internally for package archive size & offsetPanu Matilainen1-2/+2
- 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-03Unexport file state machine internalsPanu Matilainen1-48/+0
- fsmGetTs(), fsmGetFi(), fileStageString(), fileActionString(), fsmMapPath(), fsmMapAttrs() and fsmStage() aren't needed outside fsm, make 'em static to avoid leaking to symbol space
2008-06-02Lose unused fdigests array from rpmfi structPanu Matilainen1-1/+0
- 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-02Teach fsm internals to honor rpmfi digest typePanu Matilainen1-0/+1
2008-06-02Rename rpmfi and fsm checksum md5-sum fields to refer to digestPanu Matilainen1-2/+2
- no functional changes - groundwork for supporting other than md5 checksums
2008-02-04Add rpm_off_t type for file size types, use where spottedPanu Matilainen1-2/+2
- preliminaries for bumping up the max size, use rpm-specific type as off_t size varies, header data needs fixed size
2007-12-18Make fsm failedFile non-const like it really isPanu Matilainen1-3/+3
- callers need to free it so const is wrong - cast away the hardlink-hackery in fsm instead
2007-12-17Stick cpioMapFlags to fsm.h, they're only used by fsm.cPanu Matilainen1-1/+18
- allows FSM* typedefs to move to where they belong
2007-12-17Hide fsmIterator_s struct details, not needed outside fsm.cPanu Matilainen1-11/+0
2007-12-17Stuff hardLink_s inside fsm.c, add pointer typedef to fsm.hPanu Matilainen1-15/+3
- nothing outside fsm.c needs except for the declaration in fsm_s