Age | Commit message (Collapse) | Author | Files | Lines |
|
- Add accessor for fetching the script tag, the final piece that
psm needs (and will continue to do so) from script internals.
This allows the script type to become opaque for real.
|
|
- Bury rpmScriptNew() into being internal helper in rpmscript -
triggers and other scripts differ quite a bit in how their data
is laid out in the header, especially args need "special attention".
- Besides cleaning up things in the psm side, this technically makes
trigger scripts runnable without having a header at hand. Of course
currently trigger scripts are currently created and destroyed
on the spot from headers so this is of academic interest...
|
|
- Add a lower level script creation function to deal with the
body expansions and such, use it for triggers as well.
- This is still fairly ugly but its something that can be reasonably
backported to 4.9.x which needs this too, as currently triggers
are forgetting to set script->descr, causing "(null) failure" messages
on glibc and on others, in would just crash on trigger failure
and/or in debug verbosity level.
|
|
- On colored file conflict resolution, the non-preferred colored
file state would depend on installation order: if non-preferred
arch is installed first, and the preferred arch in another
transaction, the non-preferred color would get marked "replaced"
indicating a forced install when none was used. This fixes
the file state in such cases to "wrong color" to be consistent
of the other installation scenarios.
|
|
- If fn to rpmReadPackageFile() is NULL, use Fdescr() value to give
more meaningful errors
- Change a couple of places where we haven't got a clue of the file
name to take advantage of the above
|
|
- Makes the huge rpmpsmStage() that little bit smaller, this
special-case code does not belong inline there. Also gets rid
of couple of dead assignments and unnecessary variable.
- Don't bother unless RPMPROB_FILTER_REPLACEPKG is set, it's not
terribly expensive but its also wholly unnecessary in the normal case
- Document how the dang thing "works"
|
|
- Remove redundant checks and other fluff, including dead
NULL-assignments on free
|
|
- Remove NULL-assignments of local variables at the end of scope
from the low-level helper machinery: fsm, psm, rpmscript and rpmrc
|
|
- Move the fsm execution to separate helper function, returning
the most relevant exit code: if fsmSetup() failed then teardown
return doesn't matter, but fsmTeardown() can report errors
from missing hardlinks which we haven't checked until now.
- This also fixes enum vs int abuse on the exit code: fsm return
codes are cpio error codes whereas psm codes are simple ok/fails.
|
|
|
|
- The return codes from these iteratator functions aren't interesting
in this context, don't bother saving them either.
|
|
- PSM_NOTIFY doesn't return anything of interest, rpmdbSetIteratorRE()
doesn't return errors for RPMMIRE_STRCMP and Fclose() errors we
just can't do anything about (and we were throwing all these
away anyhow)
|
|
- We're not expecting anything in return from rpmtsNotify() in psm,
so just ignore the returns...
|
|
- 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.
|
|
|
|
- There are a few true rpmTag uses though, leaving them as they are...
|
|
|
|
|
|
|
|
|
|
- Verify scriptlet failures were only logged but didn't reflect error
codes as they were considered "warn only" along with most others
|
|
- If we aren't laying down file contexts, executing scriptlets in
contexts doesn't make much sense either as its just likely to fail.
- System-wide settings, such as is_selinux_enabled() value, are
very ambiguous when it comes to chroots, using per-transaction
controllable flags instead lets callers decide.
|
|
|
|
- psm in test-mode is a no-op anyway, so dont bother at all with it
- also removes the need to check for test mode on pre/posttrans scripts,
these are now fully covered by psm too
|
|
- pass scriptFd and selinux enabled status as arguments from psm level
- selinux status could be queried directly with is_selinux_enabled()
but that's a fairly expensive call which does all sorts of funny
things and probably doesn't work at all in the average chroot
- Lua-scripts dont currently honor scriptFd and have no use for selinux
but pass the info there too as an early step towards supporting
scriptFd with Lua
- makes rpmScriptRun() even more of an argument monster, some of this
should probably go into rpmScript struct...
|
|
- switch root if necessary on entry and exit to psm already, nothing
inside the psm needs access to outside chroot
- eliminate chroot handling from scriptlet machinery, dealing with
chroot is a job for higher levels
- Lua scriptlets can change our cwd, always ensure we return to previous
cwd after executing by saving and restoring the cwd
|
|
- removes one rpmts dependency from scriptlets
|
|
- On package reinstall (ie --replacepkgs) we only know the old header
by the instance number, and grabbing the header from the db in
psm as a special case for that is more trouble than just doing what
we always did.
- Reverts commit e16695e932e294ec600e673d38c41bde20931204 and unbreaks
the --replacepkgs test case
|
|
- all additions and removals to the rpmdb need to go through the
transaction machinery, these are very low-level functions that
API users have no business messing with
|
|
- rpmdbRemove() takes now a header as argument too - we need both
the header number and the header itself there anyway, so might as
well use the header we already have instead of flipping through backwards
hoops to get to it
|
|
- for rpmdbRemove() these have been completely unused, and for rpmdbAdd()
the higher levels have had more than one chance of verifying the
header if checking is enabled in the transaction set
|
|
|
|
- no functional changes, just shuffling declares around
|
|
- get the debug messages out of API, this is what should've been in commit
dbdbe8010cd944f026a5a4e5d071eb31d29d81c4
|
|
- get the debug messages out of API, this is what should've been in commit
dbdbe8010cd944f026a5a4e5d071eb31d29d81c4 - just wtf have I been thinking?
- also tolerate NULL passed to rpmtsLink() and rpmtsUnlink()
|
|
- The psm structures aren't stored or passed around by any users,
so there's no need for them to separately allocate and free the
struct, bury this all inside rpmpsmRun() which takes care of
initialization, actual actions and freeing.
- There's also no need for refcounting now as allocations are completely
contained within the rpmpsmRun() blackbox. Lose psm-debug foo which
was only used for refcount debugging.
- No functional changes
|
|
|
|
|
|
- Add per-scriptlet type flag tags to control special behavior.
- Add rpmlib dependency on scriptlet expansion - if a package relies
on scriptlet expansion it cannot be correctly installed with
a version of rpm that doesn't support it.
- Expansion is always an opt-in behavior, enabled with -q and/or -e argument
in spec. We can't just blindly expand even macros as there's no telling
%{} constructs might mean in whatever language is used for the script.
- Queryformat expansion requires great care with strange and ugly escapes
when writing scriptlets, but OTOH it permits access arbitrary header
data at runtime, which has previously been completely impossible.
- The handling of these expansions needs unifying for all scriptlet types,
the trigger scriptlet handling is uuugly. Macro expansion could be
transparently done from rpmScriptRun(), but because of their similar
syntax, macro expansion needs to happen before query format expansion,
and we dont have the header available in rpmScriptrun()
|
|
- lose redundant RPMRC_OK assignment + cosmetics
|
|
- we can't even read packages from that timeframe, much less relocate them
|
|
|
|
- rpmteClose() takes care of freeing the header already
|
|
|
|
- should've been in commit 6193da9cad40dbbc1d7ce974ab9df96986a52183
|
|
- Loose rpmpsmScriptStage() hack and bury the psm details inside
the psm implementation
- Map the script-only goal enums to the corresponding script tag
to avoid having to re-re-re-map stuff unnecessarily
- pretrans and posttrans should really be handled as a part of PKG_INSTALL
process, but as these stages are disconnected from the main install
part we can't remember the state in the psm - it would need to be
stashed into transaction elements in the meanwhile
|
|
- no functional changes - supposedly
- nothing outside the PSM should need to know anything about its
internals, the general goals need to be sufficient (not the case yet)
- define goals to match rpmteType so there's no need to re-re-re-map
the operations
- loose the big unused individual stage string switch
|
|
- our scriptlet thingie knows which progtag to use for a given script tag
already, no need to baby-feed the psm
|
|
- Split the low-level scriptlet machinery out of psm
- New struct to hold the necessary information about scriptlets so
we can execute them without having a header at hand.
- Trigger handling is hackish and needs more love...
|
|
- psm aint the place to fiddle with db internals anyway
|