Don't restore db file atime/mtime after rebuild
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 10 Nov 2010 11:44:02 +0000 (13:44 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 10 Nov 2010 11:44:02 +0000 (13:44 +0200)
- The files are regenerated from scratch, involving header record
  numbers moving around, possibly removing broken headers and all.
  Don't pretend nothing changed when some changes almost certainly,
  occurred, various API users rely on rpmdb mtime for determining
  whether the db has changed since they last accessed it.

lib/rpmdb.c

index 9c1fe0b..d04274b 100644 (file)
@@ -2833,7 +2833,7 @@ static int rpmdbMoveDatabase(const char * prefix,
            goto cont;
 
        /*
-        * Restore uid/gid/mode/mtime/security context if possible.
+        * Restore uid/gid/mode/security context if possible.
         */
        if (stat(dest, &st) < 0)
            if (stat(src, &st) < 0)
@@ -2845,11 +2845,6 @@ static int rpmdbMoveDatabase(const char * prefix,
        }
        xx = chown(dest, st.st_uid, st.st_gid);
        xx = chmod(dest, (st.st_mode & 07777));
-       {       struct utimbuf stamp;
-           stamp.actime = st.st_atime;
-           stamp.modtime = st.st_mtime;
-           xx = utime(dest, &stamp);
-       }
 
        if (selinux) {
            security_context_t scon = NULL;