Move hardlink saving out of fsmInit()
- Now that we have separate functions for install, erase and build, handle the hardlink saving locally where it matters.
This commit is contained in:
parent
afb91f205b
commit
aa2117b94e
11
lib/fsm.c
11
lib/fsm.c
|
@ -1324,11 +1324,6 @@ static int fsmInit(FSM_t fsm)
|
|||
if (rc) return rc;
|
||||
|
||||
fsm->postpone = XFA_SKIPPING(fsm->action);
|
||||
if (fsm->goal == FSM_PKGINSTALL || fsm->goal == FSM_PKGBUILD) {
|
||||
/* FIX: saveHardLink can modify fsm */
|
||||
if (S_ISREG(fsm->sb.st_mode) && fsm->sb.st_nlink > 1)
|
||||
fsm->postpone = saveHardLink(fsm);
|
||||
}
|
||||
|
||||
rpmlog(RPMLOG_DEBUG, "%-10s %06o%3d (%4d,%4d)%6d %s\n",
|
||||
fileActionString(fsm->action), (int)fsm->sb.st_mode,
|
||||
|
@ -1694,6 +1689,9 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfi fi, FD_t cfd,
|
|||
break;
|
||||
}
|
||||
|
||||
if (S_ISREG(fsm->sb.st_mode) && fsm->sb.st_nlink > 1)
|
||||
fsm->postpone = saveHardLink(fsm);
|
||||
|
||||
setFileState(rpmteGetFileStates(te), fsm->ix, fsm->action);
|
||||
|
||||
if (!fsm->postpone) {
|
||||
|
@ -1914,6 +1912,9 @@ int rpmPackageFilesArchive(rpmfi fi, int isSrc, FD_t cfd,
|
|||
break;
|
||||
}
|
||||
|
||||
if (S_ISREG(fsm->sb.st_mode) && fsm->sb.st_nlink > 1)
|
||||
fsm->postpone = saveHardLink(fsm);
|
||||
|
||||
if (fsm->postpone || fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */
|
||||
continue;
|
||||
/* Hardlinks are handled later */
|
||||
|
|
Loading…
Reference in New Issue