diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-03-06 00:38:34 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-03-06 00:38:34 +0000 |
commit | baaedc7906ce2ab15fbf69900b45b46590b40346 (patch) | |
tree | 5f819ea381b5739e7af40979e858bf10f26f07ed /bin/emaint | |
parent | 5e2a21a7ee17f96501c46eff41b5b9ed09a55a12 (diff) | |
download | portage-baaedc7906ce2ab15fbf69900b45b46590b40346.tar.gz portage-baaedc7906ce2ab15fbf69900b45b46590b40346.tar.bz2 portage-baaedc7906ce2ab15fbf69900b45b46590b40346.zip |
Remove the leading / from WORLD_FILE for better cooperation with os.path.join (see bug #124471).
svn path=/main/trunk/; revision=2818
Diffstat (limited to 'bin/emaint')
-rwxr-xr-x | bin/emaint | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/emaint b/bin/emaint index e6d11fc15..472656bc7 100755 --- a/bin/emaint +++ b/bin/emaint @@ -18,9 +18,10 @@ class WorldHandler(object): self.invalid = [] self.not_installed = [] self.okay = [] - self.found = os.access(portage_const.WORLD_FILE, os.R_OK) + self.world_file = os.path.join("/", portage_const.WORLD_FILE) + self.found = os.access(self.world_file, os.R_OK) - for atom in open(portage_const.WORLD_FILE).read().split(): + for atom in open(self.world_file).read().split(): if not portage.isvalidatom(atom): self.invalid.append(atom) elif not portage.db["/"]["vartree"].dbapi.match(atom): @@ -34,15 +35,15 @@ class WorldHandler(object): errors += map(lambda x: "'%s' is not a valid atom" % x, self.invalid) errors += map(lambda x: "'%s' is not installed" % x, self.not_installed) else: - errors.append(portage_const.WORLD_FILE + " could not be opened for reading") + errors.append(self.world_file + " could not be opened for reading") return errors def fix(self): errors = [] try: - portage.write_atomic(portage_const.WORLD_FILE,"\n".join(self.okay)) + portage.write_atomic(self.world_file, "\n".join(self.okay)) except OSError: - errors.append(portage_const.WORLD_FILE + " could not be opened for writing") + errors.append(self.world_file + " could not be opened for writing") return errors class VdbKeyHandler(object): |