#!/usr/bin/env python # # Little script which checks outaded ebuilds against another arch # # Copyright (C) 2003, Guy Martin # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA # import sys if len(sys.argv) < 2: print "Usage : " + sys.argv[0] + " your_arch " print " By default test_arch is x86" sys.exit() import portage #Freeze the portdbapi for enhanced performance: portage.portdb.freeze() my_group = sys.argv[1] if len(sys.argv) < 3: target_group = 'x86' else: target_group = sys.argv[2] total = 0 all_cp_list = portage.portdb.cp_all() print "Package Name".ljust(40) + my_group.ljust(20) + target_group.ljust(20) print "-" * 80 for cp in all_cp_list: cpv = portage.portdb.cp_list(cp) portage.groups = [my_group] my_list = portage.portdb.gvisible(cpv) my_list = portage.portdb.visible(my_list) if not len(my_list): continue my_newest = portage.best(my_list); portage.groups = [target_group] target_list = portage.portdb.gvisible(cpv) target_list = portage.portdb.visible(target_list) if not len(target_list): continue target_newest = portage.best(target_list) if not portage.best([my_newest, target_newest]) == my_newest : my_newest_list = portage.catpkgsplit(my_newest) target_newest_list = portage.catpkgsplit(target_newest) package_name = my_newest_list[0] + '/' + my_newest_list[1] my_newest_ver = my_newest_list[2] if my_newest_list[3] != "r0": my_newest_ver += '-' + my_newest_list[3] target_newest_ver = target_newest_list[2] if target_newest_list[3] != "r0": target_newest_ver += '-' + target_newest_list[3] print package_name.ljust(40) + my_newest_ver.ljust(20) + target_newest_ver.ljust(20) total = total + 1 print "-" * 80 print "A total of " + str(total) + " ebuilds seems outaded on " + my_group