# diff returns: # 0 if files don't differ # 1 if they differ # 2 if something went wrong if e.returncode == 2: raise e eoutput.ebegin("Running cvs add %s" % new_ebuild) subprocess.check_call('cvs add %s' % new_ebuild, shell=True, stderr=subprocess.PIPE) eoutput.eend(0) subprocess.check_call('ebuild %s manifest' % new_ebuild, shell=True) if REMOVE_OBSOLETE: from obsolete_ebuilds import get_obsolete print ">>> Removing obsolete ebuilds" obsolete_ebuilds = map(get_ebuild, get_obsolete(cp)) for ebuild in obsolete_ebuilds: eoutput.ebegin("Running cvs rm -f %s" % ebuild) subprocess.check_call('cvs rm -f %s' % ebuild, shell=True, stderr=subprocess.PIPE) eoutput.eend(0) if os.path.isdir('files'): print portage.output.red( ">>> Package has a files/ directory, please double-check obsolete files" ) subprocess.check_call('ebuild %s manifest' % new_ebuild, shell=True) print ">>> All done with %s!" % cp gst_cpv_all.append(new_cpv) print "" print "Here's a list for emerge :-)"
return revdeps ################### ### Actual Work ### ################### slot_rdeps = {} revdeps = [] if PORTAGE_ONLY: revdeps = get_revdeps_portage(KEY) else: revdeps = get_revdeps_rindex(KEY) for rdep in revdeps: if IGNORE_OBSOLETE: from obsolete_ebuilds import get_obsolete if rdep in get_obsolete(portage.pkgsplit(rdep)[0]): continue (cps, deps) = get_deps_both(rdep) if KEY not in cps: continue for dep in deps: if dep.find(KEY) == -1: continue slot = get_dep_slot(dep) if not slot_rdeps.has_key(slot): slot_rdeps[slot] = [] slot_rdeps[slot].append(rdep) rdeps_with_slot(slot_rdeps)
################### ### Actual Work ### ################### slot_rdeps = {} revdeps = [] if PORTAGE_ONLY: revdeps = get_revdeps_portage(KEY) else: revdeps = get_revdeps_rindex(KEY) for rdep in revdeps: if IGNORE_OBSOLETE: from obsolete_ebuilds import get_obsolete if rdep in get_obsolete(portage.pkgsplit(rdep)[0]): continue (cps, deps) = get_deps_both(rdep) if KEY not in cps: continue for dep in deps: if dep.find(KEY) == -1: continue slot = get_dep_slot(dep) if not slot_rdeps.has_key(slot): slot_rdeps[slot] = [] slot_rdeps[slot].append(rdep) rdeps_with_slot(slot_rdeps)
try: subprocess.check_call('diff -u %s %s' % (old_ebuild, new_ebuild), shell=True) except subprocess.CalledProcessError as e: # diff returns: # 0 if files don't differ # 1 if they differ # 2 if something went wrong if e.returncode == 2: raise e eoutput.ebegin("Running cvs add %s" % new_ebuild) subprocess.check_call('cvs add %s' % new_ebuild, shell=True, stderr=subprocess.PIPE) eoutput.eend(0) subprocess.check_call('ebuild %s manifest' % new_ebuild, shell=True) if REMOVE_OBSOLETE: from obsolete_ebuilds import get_obsolete print ">>> Removing obsolete ebuilds" obsolete_ebuilds = map(get_ebuild, get_obsolete(cp)) for ebuild in obsolete_ebuilds: eoutput.ebegin("Running cvs rm -f %s" % ebuild) subprocess.check_call('cvs rm -f %s' % ebuild, shell=True, stderr=subprocess.PIPE) eoutput.eend(0) if os.path.isdir('files'): print portage.output.red(">>> Package has a files/ directory, please double-check obsolete files") subprocess.check_call('ebuild %s manifest' % new_ebuild, shell=True) print ">>> All done with %s!" % cp gst_cpv_all.append(new_cpv) print "" print "Here's a list for emerge :-)" for cpv in gst_cpv_all: print '=%s' % cpv,