--- emerge.orig 2003-11-03 00:25:09.000000000 +0900 +++ emerge.new 2003-11-23 02:42:53.978695912 +0900 @@ -1911,7 +1911,7 @@ myvars=['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK', 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', 'PORTDIR_OVERLAY', 'USE', 'COMPILER', 'CHOST', 'CFLAGS', 'CXXFLAGS','ACCEPT_KEYWORDS', - 'MAKEOPTS', 'AUTOCLEAN', 'SYNC', 'FEATURES'] + 'MAKEOPTS', 'AUTOCLEAN', 'SYNC', 'FEATURES', 'ACCEPT_LICENSES'] myvars.sort() for x in myvars: print x+'="'+portage.settings[x]+'"' @@ -2120,6 +2120,28 @@ if ("--usepkgonly" in myopts) and mydepgraph.missingbins: sys.stderr.write(red("The following binaries are not available for merging...\n")) + accept_licenses = string.split(portage.settings['ACCEPT_LICENSES']) + print accept_licenses + all_licenses_accepted = 1 + for pkg in mydepgraph.altlist(): + pkg_licenses = portage.portdb.aux_get(pkg[2], ["LICENSE"])[0] + for license_group in string.split(pkg_licenses,"|"): + license_accepted = 1 + for license in string.split(license_group): + try: + temp = accept_licenses.index(license) + except Exception,e: + license_accepted = 0 + if license_accepted == 1: + break + if license_accepted == 0: + print "\n!!! License(s) " + string.replace(pkg_licenses, "|", "or") + " required by " + pkg[2] + print "!!! has not been accepted. Please review and add to ACCEPT_LICENSES." + all_licenses_accepted = 0 + if all_licenses_accepted == 0: + print + sys.exit(1) + if mydepgraph.missingbins: for x in mydepgraph.missingbins: sys.stderr.write(" "+str(x)+"\n")