#!/usr/bin/env spython import os from os.path import walk, splitext, exists, basename, dirname import sys import output from output import * import portage import string from string import strip, find, replace, split """converts $PV slots to null slots""" localtree=portage.vartree() for node in localtree.getallnodes(): for package in localtree.dep_match(node): slotpath=dirname(localtree.getebuildpath(package))+"/SLOT" if os.path.exists(slotpath): package_parts=portage.catpkgsplit(package) slotfile=open(slotpath,'r+') actualslot=slotfile.readline().strip() if actualslot==package_parts[2]: slotfile.truncate(0) print slotpath,"has been set to null" slotfile.close()