#!/usr/bin/python -O # # Copyright 2005 Sven Wegener # Distributed under the terms of the GNU General Public License v2 # # $Id: checkunusedlicenses 284 2005-09-07 10:41:17Z sven $ # import portage, portage_dep, os dbapi = portage.db['/']['porttree'].dbapi validlicenses = os.listdir(portage.settings['PORTDIR'] + '/licenses') usedlicenses = [] for cp in dbapi.cp_all(): for cpv in dbapi.cp_list(cp): for license in portage.flatten(portage_dep.use_reduce(portage_dep.paren_reduce(dbapi.aux_get(cpv, ['LICENSE'])[0]), matchall = True)): if license == '||': continue if license not in usedlicenses: usedlicenses.append(license) for license in validlicenses: if license not in usedlicenses: print license