Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
- Now that the relevant places are accepting file index as argument,
we no longer need to save and restore fsm->ix in all the places
dealing with hard links.
|
|
- Normally this is just the current index, but when writing links
its something else and makes sense as an argument (so we dont
need to save and restore fsm->ix when doing something different)
|
|
- Normally this is just the current index, but when writing links
its something else and makes sense as an argument (so we dont
need to save and restore fsm->ix when doing something different)
|
|
- Normally this is just the current index, but when writing links
its something else and makes sense as an argument (so we dont
need to save and restore fsm->ix when doing something different)
|
|
- Return the hard link set from saveHardLink() when ready into a local
variable in the only place that cares: rpmPackageFilesInstall().
Another pointless and hard-to-follow fsm-global state variable
gone...
|
|
- saveHardLinks() is the only place where fsm->li value matters on
return: during installation its used for "returning" the current
link set when all the links in that set have been seen so they
are ready for creating.
|
|
- fsmMakeLinks() operates on the current link at hand, doesn't walk
the links or anything... pass the link as an argument from the sole
caller and operate on that.
|
|
- Using a "global" variable for local... more of the same:
fsmCommitLinks() gets called at the end of each round of the install
loop if there are links, it does the actual link discovery on its
own and fsm->li state will get rewritten by saveHardLink() at the
start of the next round.
|
|
- Using a "global" variable for local iteration is just... this gets
called once at the end of package build, fsm->li carries no
global state here.
|
|
- Using a "global" variable for local iteration is...
|
|
- Using a "global" variable for local iteration is just dumb...
|
|
- Now that we have separate functions for install, erase and build,
handle the hardlink saving locally where it matters.
|
|
- Having three places doing the same thing doesn't make a whole
lotta sense...
|
|
- Legitimately skipped files (links) must not cause install-errors.
This has always been broken, but the errors were completely ignored
on install prior to rpm 4.10, and now that we're only creating the
first instance of a shared file, secondary arch multilib packages
with hardlinks were causing install failures because of the "missing"
hardlinks here.
- The relevant part here is obviously the XFA_SKIPPING() test, for
which we need the file states. To keep the lines short, grab the
index to a helper variable and replace other fsm->li->filex[i] uses
with that too.
|
|
- This can happen on %ghost files, fsm->ossufix is never set for them.
Arguably this is a bug in the file disposition calculations but for now...
|
|
- When a directory is about to replace a %config needing backup,
we need to backup early as directories don't use a temporary
path, and fsmVerify() will remove the file before we get to
it in fsmCommit().
|
|
- We already have a carefully precalculated action decided for these
things, use that instead of bunch of arbitrary (except for osuffix)
conditions depending on several nasty hacks and hidden assumptions.
Doing so fixes stuff, who would've thought of that?
- Adjust test-suite expectations
|
|
|
|
- fsmVerify() never ever returns 0 for regular files because of
multiple hacks in how this all "works": on install, we skip stat()
but claim disk checked and file not existing, so fsmVerify() returns
early. Good thing it does too, as otherwise it would remove the
file we were supposed to be saving here. The actual %config backup
occurs in fsmCommit(): regular files are first installed with a
temporary suffix and at "commit" time we decide whether it needs
backing up or not (involving several other hacks...)
|
|
- After commit 1845c1d711b88723e596c88e8a7730a360029089 erasure
no longer calls fsmCommit(), missing the backup step entirely.
Simply split the backup code to a function of its own and call
as needed. The details look somewhat fishy but what in fsm doesn't...
|
|
|
|
- Commit 4cb02aa928d3e41f636d0e01356c7a3cb51018ee asked to see
what breaks when mmap() is used, now we know: large package support
broke when enabling it. Could be fixed of course by eg adding
a size cap to the fsm part as well, but just doesn't seem worth it:
I fail to measure any meaningful performance improvement from mmap
usage in either case, and added complexity for what is close to
zero benefit just doesn't make sense... and various sources in fact
note the rpm usage (read through the entire file sequentially) as one
of the cases where mmap() is NOT beneficial due to mmap() high
setup + teardown cost + page fault speed (or lack of thereof).
|
|
- This is close to what we had in the stage-machine days, just to allow
easily viewing whats going on inside the fsm (create/skip/etc)
|
|
Hi Panu et al,
Here's a small patch that changes the ordering used for putting
hardlinked files into the cpio archive back to lexicographical.
You might wonder what this is about. Well, old rpm-3 (and
also old versions of rpm-4, I think) already used lexicographical
ordering for files and hardlinks. When deltarpm was created,
it made use of this fact when "compressing" the file order
of the cpio archive into the so-called "sequence". Deltarpm
can deal with "out of order" files, but in that case it needs
to reset the compression, which leads to really long sequence
strings.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
|
|
- The only remaining use for rpmts here was grabbing NODIGESTS
from rpmtsFlags(). Pass the tiny little piece of information
as an argument for the one place needing it and rip all the
now unused related goo.
|
|
|
|
- Most of fsm doesnt need the actual transaction set for anything "real"
and dragging it around as a mere statistics collector seems
pretty dumb. If we want better statistics, we better come up with
a saner way to gather 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.
|
|
- Determine the need for reverse iteration based on fsm goal
- Everything else was just using rpmte to get to its file states,
eliminate the intermediate ping-pong by passign the file states
around directly. Makes the thing that little bit less silly.
|
|
|
|
- Ghosts are never backed up, and the whole business is irrelevant
for package building. Use fsm goal instead of rpmte mode to
determine what to do, rpmte in build code is nothing but an ugly hack.
|
|
- This whole thing probably isn't needed anymore, but for now just
lift the FA_SKIP/FA_COPYOUT setting to rpmPackageFilesArchive(),
allowing rpmfsSetAction() to become properly internal-only function.
- Trim out unnecessary now unnecessary librpm internal includes
from librpmbuild code
|
|
- The file state that gets stored in the rpmdb has nothing to do with
path and is only relevant for installs.
|
|
- The archive interface might actually want separate new + open,
but for now just flag an internal error on NULL return on archive open.
|
|
- Now that there are no more failing parts requiring return codes,
change + rename fsmSetup() into a more regular fsmNew() construct,
returning newly "instance" of fsm and similarly fsmTeardown() ->
fsmFree() to free the thing.
- There's no real need to allocate this stuff on heap, but doing
so makes life actually simpler for the three callers and makes the
whole thing more consistent with common practises in the codebase.
|
|
- Checking missing links is only relevant for install, lift the
code to separate function and call from the install-case only.
- Freeing data while checking seems like a dubious "optimization"
but to keep changes minimal, leaving that as it is now.
|
|
|
|
- The fsm shouldn't know any archive format specifics, detect the trailer
from rpmcpioHeaderRead() and signal EOF through CPIOERR_HDR_TRAILER
instead.
|
|
- When writing, archive finalization can write further data into
the payload (eg cpio trailer). We need to be able to fish the
final archive size *after* closing it, otherwise archive size
will be off by trailer size.
- Add new rpmcpioFree() function which simpy frees the archive struct,
calling rpmcpioClose() in the process if it wasn't already done.
- This also simplifies the error code gymnastics in fsm: we need to
free the resources whether error or not, which rpmcpioFree() allows
us to do. And for writers, calling rpmcpioClose() only needs to
be done if earlier parts were successfull, so we dont need to worry
about masking a former error code when calling it.
|
|
- Only install and build have an associated archive, and this can
be just as well handled as a local variable, passing down as
argument to the handful of places needing it.
- Error handling looks a bit fishy but that's not exactly new issue...
|
|
- Archive size is only relevant for build code, no need for tracking
this in the big struct. Just return the archiveSize at end of
build process.
|
|
|
|
- Both are only ever called once and are so trivial that they're
not helping anything at all
|
|
- Bah, should've been in commit 4ef540d25bab77b46cbf4467c8f6bc22cdd0e419
|
|
- The mapping index is the same for build + erase, but different
for install and so is the return code mapping. By doing this
inline where the action is we avoid having to fiddle with
mapped return codes for the exit case.
|
|
- Besides simplifying the common path everything takes, this removes
the need to map error returns back and forth when we can just
detect the end of payload directly in the loop and break out.
|
|
- No functional changes as such, but moving this out of fsmInit()
permits other goal-specific items to be moved out of fsmInit()
|
|
|
|
- There's zero need for the rest of the code to know or care about
dnl iterator, just pass the file info- and state sets to
fsmMkdirs() directly and hide the otherwise unused iterator
business there.
|