Change rpmfi replaced size functions to take index
- Further preliminaries to handle file conflicts within a package. - These are internal-only interfaces so we can just change without bothering with compat wrappers.
This commit is contained in:
parent
3f996a588a
commit
87e7e88f90
12
lib/rpmfi.c
12
lib/rpmfi.c
|
@ -1239,23 +1239,23 @@ errxit:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void rpmfiSetFReplacedSize(rpmfi fi, rpm_loff_t newsize)
|
||||
void rpmfiSetFReplacedSizeIndex(rpmfi fi, int ix, rpm_loff_t newsize)
|
||||
{
|
||||
if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) {
|
||||
if (fi != NULL && ix >= 0 && ix < fi->fc) {
|
||||
if (fi->replacedSizes == NULL) {
|
||||
fi->replacedSizes = xcalloc(fi->fc, sizeof(*fi->replacedSizes));
|
||||
}
|
||||
/* XXX watch out, replacedSizes is not rpm_loff_t (yet) */
|
||||
fi->replacedSizes[fi->i] = (rpm_off_t) newsize;
|
||||
fi->replacedSizes[ix] = (rpm_off_t) newsize;
|
||||
}
|
||||
}
|
||||
|
||||
rpm_loff_t rpmfiFReplacedSize(rpmfi fi)
|
||||
rpm_loff_t rpmfiFReplacedSizeIndex(rpmfi fi, int ix)
|
||||
{
|
||||
rpm_loff_t rsize = 0;
|
||||
if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) {
|
||||
if (fi != NULL && ix >= 0 && ix < fi->fc) {
|
||||
if (fi->replacedSizes) {
|
||||
rsize = fi->replacedSizes[fi->i];
|
||||
rsize = fi->replacedSizes[ix];
|
||||
}
|
||||
}
|
||||
return rsize;
|
||||
|
|
|
@ -159,10 +159,10 @@ RPM_GNUC_INTERNAL
|
|||
int rpmfiConfigConflictIndex(rpmfi fi, int ix);
|
||||
|
||||
RPM_GNUC_INTERNAL
|
||||
void rpmfiSetFReplacedSize(rpmfi fi, rpm_loff_t newsize);
|
||||
void rpmfiSetFReplacedSizeIndex(rpmfi fi, int ix, rpm_loff_t newsize);
|
||||
|
||||
RPM_GNUC_INTERNAL
|
||||
rpm_loff_t rpmfiFReplacedSize(rpmfi fi);
|
||||
rpm_loff_t rpmfiFReplacedSizeIndex(rpmfi fi, int ix);
|
||||
|
||||
RPM_GNUC_INTERNAL
|
||||
void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc);
|
||||
|
|
|
@ -345,7 +345,7 @@ static void handleInstInstalledFile(const rpmts ts, rpmte p, rpmfi fi,
|
|||
rpmFileAction action = rpmfiDecideFate(otherFi, fi, skipMissing);
|
||||
rpmfsSetAction(fs, fx, action);
|
||||
}
|
||||
rpmfiSetFReplacedSize(fi, rpmfiFSize(otherFi));
|
||||
rpmfiSetFReplacedSizeIndex(fi, fx, rpmfiFSize(otherFi));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -552,7 +552,7 @@ assert(otherFi != NULL);
|
|||
|
||||
/* Update disk space info for a file. */
|
||||
rpmtsUpdateDSI(ts, fiFps->entry->dev, fiFps->entry->dirName,
|
||||
rpmfiFSize(fi), rpmfiFReplacedSize(fi),
|
||||
rpmfiFSize(fi), rpmfiFReplacedSizeIndex(fi, i),
|
||||
fixupSize, rpmfsGetAction(fs, i));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue