in portage.py : class config, method reset the following loop deletes a random environment variable: for x in self.backupenv.keys(): self.configdict["env"][x] = self.backupenv[x] else: del self.configdict["env"][x] the for loop terminates with x being the last key of self.backupenv.keys() since no break occured inside the loop the else clause is executed deleting the key from configdict["env"]. key orders in a dict is dependent on the hashing algorithm so the same arbitrary key is deleted each time. Reproducible: Always Steps to Reproduce: This is from a stage 1 install, just sync no bootstrap yet 1. cd /usr/lib/portage/pym 2. python 3. >>> from portage import settings >>> print len(settings.configdict["env"]) 49 >>> settings.reset() >>> print len(settings.configdict["env"]) 48 solution: replace this loop by: self.configdict["env"].update(self.backupenv) BTW, the second loop that clears configdict["pkg"] can be done by: self.configdict["pkg"].clear()
Fixed on or before 2.0.51.22-r1
Looking through the batch of bugs, I'm not sure that some of these are actually fixed in stable. Others, the requirements have possibly changed after the initial fix was committed. If you think this bug has been closed incorrectly, please reopen or ask that it be reopened.