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>
(cherry picked from commit
bb335292d30893eb88bdf47f166e254fa7abe37e)
int rc = 0;
int ix = -1;
int j;
+ hardLink_t *tailp;
/* Find hard link set. */
- for (fsm->li = fsm->links; fsm->li; fsm->li = fsm->li->next) {
+ for (tailp = &fsm->links; (fsm->li = *tailp) != NULL; tailp = &fsm->li->next) {
if (fsm->li->sb.st_ino == st->st_ino && fsm->li->sb.st_dev == st->st_dev)
break;
}
if (fsm->goal == FSM_PKGINSTALL)
fsm->li->linksLeft = 0;
- fsm->li->next = fsm->links;
- fsm->links = fsm->li;
+ *tailp = fsm->li; /* append to tail of linked list */
}
if (fsm->goal == FSM_PKGBUILD) --fsm->li->linksLeft;