summaryrefslogtreecommitdiff
path: root/lib/fsm.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-05-03 11:49:56 +0200
committerPanu Matilainen <pmatilai@redhat.com>2012-05-04 09:04:46 +0300
commitbb335292d30893eb88bdf47f166e254fa7abe37e (patch)
treed4b1ed8ea9499357842503b1f4709f0fe535e69c /lib/fsm.c
parent58c5eb28d5f267313294486c6f8a7a6c84984d86 (diff)
downloadlibrpm-tizen-bb335292d30893eb88bdf47f166e254fa7abe37e.tar.gz
librpm-tizen-bb335292d30893eb88bdf47f166e254fa7abe37e.tar.bz2
librpm-tizen-bb335292d30893eb88bdf47f166e254fa7abe37e.zip
Small patch to reverse hardlink ordering
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>
Diffstat (limited to 'lib/fsm.c')
-rw-r--r--lib/fsm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index cb099208f..ffdf3893c 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -469,9 +469,10 @@ static int saveHardLink(FSM_t fsm)
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;
}
@@ -494,8 +495,7 @@ static int saveHardLink(FSM_t fsm)
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;