Prepare for killing the fsm: Move build code from PSM_PROCESS to FSM_PKGBUILD
authorFlorian Festi <ffesti@redhat.com>
Wed, 28 Mar 2012 07:34:05 +0000 (09:34 +0200)
committerFlorian Festi <ffesti@redhat.com>
Fri, 30 Mar 2012 13:00:40 +0000 (15:00 +0200)
lib/fsm.c

index 297ac2b..1e714d4 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1851,8 +1851,14 @@ static int fsmStage(FSM_t fsm, fileStage stage)
                break;
            }
 
-           /* Copy file into archive. */
-           rc = fsmNext(fsm, FSM_PROCESS);
+           if (fsm->postpone || fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */
+               continue;
+           /* Hardlinks are handled later */
+           if (!(S_ISREG(st->st_mode) && st->st_nlink > 1)) {
+                /* Copy file into archive. */
+               rc = writeFile(fsm, 1);
+           }
+
            if (rc) {
                (void) fsmNext(fsm, FSM_UNDO);
                break;
@@ -1868,16 +1874,6 @@ static int fsmStage(FSM_t fsm, fileStage stage)
            break;
        }
 
-       if (fsm->goal == FSM_PKGBUILD) {
-           if (fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */
-               break;
-           /* Hardlinks are handled later */
-           if (!(S_ISREG(st->st_mode) && st->st_nlink > 1)) {
-               rc = writeFile(fsm, 1);
-           }
-           break;
-       }
-
        if (fsm->goal != FSM_PKGINSTALL)
            break;