Age | Commit message (Collapse) | Author | Files | Lines |
|
This change adds a new type of the rpm plugin, called transaction plugin
and a set of initial hooks for this plugin. The hooks are:
PLUGINHOOK_TSM_PRE
Pre-transaction hook that is called before an rpm transaction begins
PLUGINHOOK_TSM_POST
Post-transaction hook that is called after an rpm transaction ends
PLUGINHOOK_PSM_PRE
Pre-transaction-element hook that is called before an rpm
transaction-element is processed
PLUGINHOOK_PSM_POST
Post-transaction-element hook that is called after an rpm
transaction-element is processed
PLUGINHOOK_SCRIPT_SETUP
Per-script hook that is called once for each rpm mainainers script
that is present in the package
Each hook is called for every plugin that have this hook registered.
The avaliable transaction plugins can be specified in macros.in via
transaction_plugins element.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
|
|
|
|
|
|
- In the package/transaction related things the strpool is more of
an internal implementation detail than an end-goal in itself, move
string pool related interfaces of rpmts, rpmfi and rpmds to
internal-only APIs for now. The kind interfaces we'll want to eventually
export a) dont exist yet and b) are likely to be something very different.
- The string pool itself remains exported however, its a handy data
structure for all sorts of things and both librpm and librpmbuild
heavily use it already.
|
|
- rpmRelocateFileList() doesn't modify anything when no relocations
are to be done, but what it does is not exactly free, unnecessarily
calling it is dumb.
|
|
|
|
|
|
- Add a pool pointer to to ts members struct and a getter function
- Grab the global pool for rpmte dependency- and file info creation,
if its NULL then the sets will use private pools of their own.
- Add the (currently) required magic voodoo rain-dance to freeze and
unfreeze the pool as necessary wrt new element additions: for
current rpmal and fingerprinting to work, the string pointers
must be immovable.
- This is infrastructure only: nothing creates the global pool yet,
so everything is still using private pools.
|
|
|
|
- As noted (but since then blissfully forgotten) in the commit message,
commit e696b409fe836bf39cbf639bac4321d658d0952d broke --badreloc
so its been broken since rpm >= 4.9.x :-/
- Transaction problem filter is only available during rpmtsRun() so
we have no clue whether bad relocations should be filtered or not
during rpmte creation. Instead of creating the problems at rpmteNew()
time, remember any bad relocations that were found and check +
create the actual problems (unless filtered) along with other
problems during rpmtsRun().
- Passing an "allow bad relocations" flag to rpmtsAddInstallElement()
would be a saner option but this is a back-portable way of handling it.
|
|
- rpmfs is such a low-level construct it doesn't need to know anything
about the upper layers. Gather the necessary bits of info in the
sole caller instead and pass only whats needed to rpmfsNew() to
enable creating a filestate item without having rpmte/header at hand,
which we'll be needing in the fsm shortly.
|
|
- rpmteClose() will wipe out the file info to free memory, we only
should care whether we failed to (re)load the file info. This
thinko in commit 06a2f1269b035a3a76464149834f2a5a8c4e89f2
broke %posttrans scriptlets (and without commit
274dbf557d1cac90f7c278f9b6d6af05997d92df, %pretrans in other
circumstances), whoopsie *blush*. Now, off to write a test-case
for our scriptlet behavior...
|
|
- Despite commit cef18c94807af0935b7796c462aab8ed39f0f376, we'd still
end up freeing the file info sets via rpmteClose() while going
through the test-transaction packages. This together with commit
06a2f1269b035a3a76464149834f2a5a8c4e89f2 caused install failures
on packages which have %pretrans scriptlets, if a test-transaction
was first performed on the same transaction set that gets used
for the "real" transaction as well. How wonderfully obscure...
|
|
- Add NULL checks and add/adjust comments where appropriate.
- The remaining callers should handle NULL fi gracefully if not
entirely correctly: rpmfiFC() returns 0 on NULL fi, so these
callers just see the erronous file info set as "no files" case.
Something to fine-tune later...
|
|
- Verify that a header at least has the very basic elements like
name, version, release, os and arch (except for gpg-pubkeys which
dont have the latter two, sigh), fail if not.
- rpmfiNew() cannot currently fail but handling this error will allow
sanity checking the file metadata which can be inconsistent even if
a header is "physically" consistent.
- We'll eventually want to have sanity checks on dependency sets too, but
unlike rpmfiNew(), rpmdsNew() currently returns NULL for non-existent
dependencies (eg most packages do not have conflicts or obsoletes) to
save memory. Either that needs to change or we'll need to check
for tag existence for the meaning of a returned NULL here.
|
|
- No functional changes, just stuffing it there along with most
other rpmte init work and remove the pointless switch-case while at it
|
|
- While most scriptlets have both an interpreter and a body, neither
is strictly required: body can be omitted in cases like special
purpose executables (eg -p /sbin/ldconfig) and for interpreter,
/bin/sh is used if missing. This has been "broken" from somewhere
around rpm 4.7.x and nobody noticed :)
|
|
- Brainfart in previous commit (71c6b06b3f240021f2ece46f9cf7aa891f716710):
%pretrans failure should only cause that package to fail, not
abort the entire transaction. Doh.
- Failures are tracked via transaction elements but pre/posttrans
were specifically filtered out. All we need is removing that filtering
and the warn-only vs error logic in psm takes care of the rest.
The transaction.c changes in previous commit were just unnecessary.
|
|
|
|
- Remove NULL-assignments of local variables at the end of scope
in the higher level package-related "objects": rpmds, rpmfi, rpmte
|
|
|
|
- Elements referencing ts prevents rpmtsFree() from freeing anything
unless the caller does rpmtsEmpty() first. Oops. Undo the braindamage
from commit 8f7c2d7063df6d1057425d014ce4168d46c5e7d9.
|
|
- We'll probably want to make some changes to the plugin type system
before considered "ready", the current plugin slots are limited
to 32 and Meego folks apparently want to use a largish number
of slots. So we might want something like separate plugin type
(collection, security... etc) and then have 32 slots per each type.
Making this private for now to avoid having to potentially break
the API shortly after introduction.
|
|
- Add support for new "OrderWithRequires: foo" spec syntax
which has "if and only if foo is present in transaction, order
the transaction as if this package required foo" semantics.
While it looks, and in some ways is, a soft dependency, this
is not the same as recommends/suggests etc: those have unknown
depsolver policy dependent semantics attached to them, whereas
ordering hints have a clear definition and is only relevant for rpm
itself, depsolvers should not even look at the data.
- This allows packages to express correct ordering for optional
functionality, such as
%post
if [ -x %{_bindir}/register-component ]; then
%{_bindir}/register-component %{name}
fi
If the package containing %{_bindir}/register-component is included
in the same transaction, it makes sense to have it installed before the
package(s) that use it. But as it is fully optional, Requires would
not be appropriate. Using OrderWithRequires allows this to be expressed
without dragging in extraneous dependencies for optional functionality.
|
|
- There used to be some other callers too but seems they've passed
away, leaving just the relocation code in rpmte.c. Which means we
can get this ugly bit out of the API.
|
|
- Except for rpmteColorDS(), these can get called with intergral
value instead of the actual enumeration
|
|
- Eliminate uses of "this" which is a reserved keyword in C++
|
|
- unreferencing should always go through fooFree() which does
the real refcounting and frees when references go out
|
|
This moves most of the plugin logic to a new rpmplugins file with a
struct and functions for managing plugins, allowing for plugins to carry
state. This also adds init and cleanup hooks for plugins to initialize
and cleanup their state, and a new 'open te' hook allowing plugins to
read and save information from transaction elements.
This also generalizes the plugin architecture a bit so it isn't so
specific to collections.
|
|
|
|
There are three times during a transaction when Collection actions can be
performed:
1) After the last time a member of a collection is either installed or removed
2) After the last time a member of a collection is installed only
3) Before the first time a member of a collection is removed only
This patch adds three lists to the rpmte structure to mark which transaction
elements fall into each of these groups, and the collections that caused that.
A new function is added to the TSM to scan through all the transaction elements
and update these lists. When a collection is added to one of these lists, it
signifies that when that transaction element is installed, the appropriate
action should be performed for that collection.
|
|
This patch adds a simple plugin system that makes simple problems easy to
solve, and difficult problems, such as SELinux, possible.
When the transaction gets to the point where a collection action should occur,
it expands a macro of the form %__collection_<collection name> to get the path
to a plugin and any additional options. The plugin is dlopen'ed, and the
appropriate function is called in the plugin, with the additional arguments
passed in.
This also adds a --nocollections option to disable performing Collection
actions.
|
|
|
|
- unused now but allows various new things and more element "independency"
- eliminate the unused dboffset argument while at it
|
|
|
|
- no point splitting this up, its just straightforward freeing of stuff
- dont bother with tonne of assigning everything to NULL, it gets
zeroed out by memset() anyway
|
|
- make a bunch of helper functions static now that they're not needed
elsewhere, rpmte is slowly becoming self-aware ;)
|
|
- this has never been used for anything at all, there are better things
to use our memory for than unused arrays
|
|
- Other than having less arguments to pass here and there, doesn't
give any immediate advantage, but with the origin of installed
dependency stored in problem sets, it'd be possible to track back
a dependency problem back to the originating header
|
|
|
|
- pkgNEVR in problems is now always the NEVR of the transaction element
triggering the problem, and altNEVR is the other affected package,
dependency string is stored in the problem string attribute
- no user visible changed, except for somebody crazy enough to try to
do something other than print the problem message strings
- we wouldn't really need to strdup() the pkgNEVR in problems now,
but leaving that alone for the moment...
|
|
- Problems associated with a transaction element are necessarily unique
to that element, so when filtered there we don't have to worry about
skipping dupes elsewhere like in merged sets. This can actually lead
to apparent duplicates in the current problem report output (eg in cases
where multiple packages provide the same dependency which would be
removed, like multilib packages), but this is only an artifact of
they way the problems are currently printed out.
- While this is still a dumb linear search, it can be several seconds
faster than the previous filtering in rpmpsPrint(), which is now
just a dumb convenience function.
|
|
- This was only a convenience function that shouldn't really have been
exported to begin with, and is not necessary at all - bury it
inside rpmte.c for now to hide lazy problem set allocation
- In the other news of the day... According to git, this happens to be
the 10000th commit to the master branch of this codebase.
Happy anniversary to rpm :P
|
|
- rpmpsAppend() and rpmProblemCreate() have no use for fn/dn either,
its just stored in one string internally
- this is kinda unnecessary API break but these aren't used outside
rpm so it doesn't make much difference
|
|
- lump fn/dn into one, in no case both are needed
- move altNEVR earlier to lump the generic attribute foo last
|
|
- this gets called on transaction element initialization anyway,
there's no reason why anybody should need to call it from outside
|
|
|
|
- the rpmio API always had this goo, should've gotten rid of it
back in commit dbdbe8010cd944f026a5a4e5d071eb31d29d81c4 but .. oh well
|
|
- 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
|