* Set ORIGBASENAMES for source rpms
* Use ORIGBASENAMES for for finding files from the archive
* Get rid of the code setting apath for the installation use case
- Especially rpmfiOFN() and its underlying buffer is more than a bit
dubious, but can't really help it as people are going to expect
it behaving identically to rpmfiFN(). And they can't share the
same buffer as somebody is going to be tempted to do eg
if (strcmp(rpmfiFN(fi), rpmfiOFN(fi)))
/* file has been relocated */
- Based on ffesti's original work on the subject
- Relocation is relatively rare, so instead of storing the data within
rpmfiles, we allocate it separately if needed. This also allows
nicely handling the normal case where ORIG paths are the same
as actual paths, ie we simply point it to the same data (and take
care not to free twice...)
- Add a new datatype and a bit of API for path data from headers,
adjust callers within rpmfi to use it.
- The file name data is used all over the place within rpm, mostly
with ad-hoc manner and missing validations etc. While the newly
added API is rpmfi-internal for now, this should prove useful
later on for other purposes as well. For now we're only interested
in being able to handle two different sets of paths alongside
each other.
- The comparison is the same whether doing bsearch or liner lookup...
- Use accessor functions instead of direct struct accesses, primarily
to make next steps easier
- We have everything we need in rpmfi[les], eliminate the fsm
foobar out of the picture entirely. Also use a separate iterator
(instead of an external index variable) for walking the files
when looking for symlinks, now that we can.
- Issuing RPMCALLBACK_UNKNOWN callbacks doesn't seem like that bright
an idea... looks like just a typo/thinko from the changed arguments
and all. Not that it seems to make much of a difference in practise.
- Grab files and file states from the main loop and pass as arguments
to skipInstallFiles() and skipEraseFiles(), neither actually
needs the transaction element otherwise.
- Use local iterators in both skip*Files(), not that it actually
matters here other than eliminating rpmteFI() uses
- What rpmte wants is the file set, not an iterator, so that's what
we grab on rpmteNew(). However rpmteFI() is a public API whose
semantics we need to preserve for the time being so lazily
create an persistent iterator on first rpmteFI() call.
- rpmteSetFI() is now rather backwards, it should be rpmteSetFiles()
instead but fi->apath stands in the way ATM. Sigh.
- Forward (the default) and (a new) backwards iteration modes for now
- Internal iterator function just returns the next iteration index,
bounds checking and actual advancing in rpmfiNext() to avoid having
to duplicate that code in every single iterator function.
- All the called functions expect rpmfiles anyway so might as well
grab that from the start. We could probably do some of this with
iterators now but as everything here is done with the random-access
functions, switching would take quite a bit of work...
- These all operate on rpmfiles, not rpmfi, now so make the point
clearer. All internal stuff so we're free to mess around.
- No functional changes, only a straightforward perl-assisted rename...
- rpmfiNew() and rpmfiNewPool()-created rpmfi objects own the actual
data too and must not take an extra refcount on it. However standalone
iterators from rpmfilesIter() must take that reference... add a
helper function to handle the difference + comment.
- The self-iterator in rpmfi prevents all sorts of sane uses of
file set iteration. Split the actual data into a separate data
type, changing the internal random-access functions to use the
new rpmfiles datatype directly and update internal callers minimally.
This should be entirely transparent to public API consumers who still
only see the braindamaged self-iterating version.
- Internal consumers dont directly benefit (yet), this is just an
early step on the road to rpmfi sanity. Much of the API and variables
will need renaming etc but avoiding that here to keep the changes
to minimum, this is a rather huge commit as it is.
- We have the symlink target in rpmfi already, no need to re-read
it from the disk. Also all the fiddling with st_size is unnecessary
here, its done on the archive side as necessary
- rpmfiArchiveWriteHeader() handles the path now, the calculated
fsm->path is unused here. Also CPIO_MAP_ABSOLUTE and friends haven't
been used for anything since 4.4.x days...