Make sure that cloned FEATURES are correctly preserved by getting them directly from...
authorZac Medico <zmedico@gentoo.org>
Thu, 4 May 2006 10:15:55 +0000 (10:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 May 2006 10:15:55 +0000 (10:15 -0000)
svn path=/main/trunk/; revision=3318

pym/portage.py

index 8b46a35d776e9323e7683e3ca8ea3af11bdad7d6..d9a0ea982fe30a0b246750846371dcfdc4396388 100644 (file)
@@ -1292,13 +1292,15 @@ class config:
                        self.features = portage_util.unique_array(self["FEATURES"].split())
                else:
                        # XXX
-                       # The below self.regenerate() causes previous changes to FEATURES (and 
-                       # other incrementals) to be reverted.  If this instance is a clone, we
-                       # need to skip regenerate() so that the copied values are preserved.
-                       self.features = portage_util.unique_array(self["FEATURES"].split())
+                       # The below self.regenerate() causes previous changes to FEATURES
+                       # (and other incrementals) to be reverted.  If this instance is a
+                       # clone, we need to take the cloned FEATURES from backupenv and
+                       # save them where the regenerate() call will not destroy them.
+                       # Later, we use backup_changes() to restore the cloned FEATURES
+                       # into the backupenv once again.
+                       self.features = portage_util.unique_array(
+                               self.backupenv["FEATURES"].split())
                        self.regenerate()
-                       self["FEATURES"] = " ".join(self.features)
-                       self.backup_changes("FEATURES")
 
                #XXX: Should this be temporary? Is it possible at all to have a default?
                if "gpg" in self.features: