Minimally fix file/directory removal
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 17 Apr 2012 07:49:26 +0000 (10:49 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 17 Apr 2012 08:04:22 +0000 (11:04 +0300)
- In their previous life these breaks applied to a switch-case but
  now they end up aborting the loop on first successful removal, causing
  everything but the first file/directory of a package to be left behind
  on erase. Fixes the previously unnoticed regression from commit
  1845c1d711b88723e596c88e8a7730a360029089.

lib/fsm.c

index 6934858..d18bff0 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1963,7 +1963,7 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfi fi,
             rpmte te = fsmGetTe(fsm);
             if (S_ISDIR(fsm->sb.st_mode)) {
                 rc = fsmRmdir(fsm->path);
-                if (!rc) break;
+                if (!rc) continue;
                 switch (rc) {
                 case CPIOERR_ENOENT: /* XXX rmdir("/") linux 2.2.x kernel hack */
                 case CPIOERR_ENOTEMPTY:
@@ -1986,7 +1986,7 @@ int rpmPackageFilesRemove(rpmts ts, rpmte te, rpmfi fi,
                 }
             } else {
                 rc = fsmUnlink(fsm->path, fsm->mapFlags);
-                if (!rc) break;
+                if (!rc) continue;
                 switch (rc) {
                 case CPIOERR_ENOENT:
                     if (fsm->fflags & RPMFILE_MISSINGOK)