#!/usr/bin/env python import sys, os def move_from_all(): import portage root = portage.settings["ROOT"] bintree = portage.db[root]["bintree"] all_directory = os.path.join(bintree.pkgdir, "All") if not os.path.exists(all_directory): return for cpv in bintree.dbapi.cpv_all(): p = bintree.getname(cpv) if os.path.samefile(os.path.dirname(p), all_directory): bintree._move_from_all(cpv) os.rmdir(all_directory) if __name__ == "__main__": move_from_all()