From 945329b6119d0327beddff81db1a0b269629e107 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 23 Aug 2012 12:00:41 +0300 Subject: [PATCH] Remove dead file-backup code - fsmVerify() never ever returns 0 for regular files because of multiple hacks in how this all "works": on install, we skip stat() but claim disk checked and file not existing, so fsmVerify() returns early. Good thing it does too, as otherwise it would remove the file we were supposed to be saving here. The actual %config backup occurs in fsmCommit(): regular files are first installed with a temporary suffix and at "commit" time we decide whether it needs backing up or not (involving several other hacks...) --- lib/fsm.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/fsm.c b/lib/fsm.c index 7a1628e..3b356f5 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -1705,24 +1705,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfi fi, FD_t cfd, if (!fsm->postpone) { if (S_ISREG(st->st_mode)) { - char * path = fsm->path; - if (fsm->osuffix) - fsm->path = fsmFsPath(fsm, 0, NULL); rc = fsmVerify(fsm); - - if (rc == 0 && fsm->osuffix) { - char * spath = fsmFsPath(fsm, 0, fsm->osuffix); - rc = fsmRename(fsm->path, spath, fsm->mapFlags); - if (!rc) - rpmlog(RPMLOG_WARNING, _("%s saved as %s\n"), - fsm->path, spath); - free(spath); - } - - if (fsm->osuffix) - free(fsm->path); - - fsm->path = path; if (!(rc == CPIOERR_ENOENT)) return rc; rc = expandRegular(fsm, psm, archive, nodigest); } else if (S_ISDIR(st->st_mode)) { -- 2.7.4