Only update the confmem file when something has changed.
authorZac Medico <zmedico@gentoo.org>
Sun, 5 Oct 2008 04:20:08 +0000 (04:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 5 Oct 2008 04:20:08 +0000 (04:20 -0000)
svn path=/main/trunk/; revision=11627

pym/portage/dbapi/vartree.py

index b66bdb1144b65d81ab9c138339697e28f0412e22..ac6e10ae31b32041dcea1a1bc98e89cdc5e3dcb2 100644 (file)
@@ -3055,6 +3055,7 @@ class dblink(object):
                #if we have a file containing previously-merged config file md5sums, grab it.
                conf_mem_file = os.path.join(destroot, CONFIG_MEMORY_FILE)
                cfgfiledict = grabdict(conf_mem_file)
+               cfgfiledict_orig = cfgfiledict.copy()
                if "NOCONFMEM" in self.settings:
                        cfgfiledict["IGNORE"]=1
                else:
@@ -3115,9 +3116,10 @@ class dblink(object):
 
                # write out our collection of md5sums
                cfgfiledict.pop("IGNORE", None)
-               ensure_dirs(os.path.dirname(conf_mem_file),
-                       gid=portage_gid, mode=02750, mask=02)
-               writedict(cfgfiledict, conf_mem_file)
+               if cfgfiledict != cfgfiledict_orig:
+                       ensure_dirs(os.path.dirname(conf_mem_file),
+                               gid=portage_gid, mode=02750, mask=02)
+                       writedict(cfgfiledict, conf_mem_file)
 
                # These caches are populated during collision-protect and the data
                # they contain is now invalid. It's very important to invalidate