From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SSG3z-0003ii-N4 for garchives@archives.gentoo.org; Wed, 09 May 2012 23:12:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7288AE0605; Wed, 9 May 2012 23:12:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2BFE8E0605 for ; Wed, 9 May 2012 23:12:47 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6409D1B4018 for ; Wed, 9 May 2012 23:12:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 25A9CE542D for ; Wed, 9 May 2012 23:12:45 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1336605132.af97e220cade1aea00741eea082e5274abf61bb5.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/bin/, gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/bin/gobs_guest_jobs gobs/pym/build_queru.py X-VCS-Directories: gobs/bin/ gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: af97e220cade1aea00741eea082e5274abf61bb5 X-VCS-Branch: master Date: Wed, 9 May 2012 23:12:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 10531c9a-e6ce-4beb-a13d-bc1b61b9c061 X-Archives-Hash: c86317cea5a195305b34dbe4c5e44811 commit: af97e220cade1aea00741eea082e5274abf61bb5 Author: Magnus Granberg gentoo org> AuthorDate: Wed May 9 23:12:12 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Wed May 9 23:12:12 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/zorry.git;a=3D= commit;h=3Daf97e220 testing use flags autounmask --- gobs/bin/gobs_guest_jobs | 1 + gobs/pym/build_queru.py | 350 +---------------------------------------= ------ 2 files changed, 3 insertions(+), 348 deletions(-) diff --git a/gobs/bin/gobs_guest_jobs b/gobs/bin/gobs_guest_jobs index 59c9da8..c490366 100755 --- a/gobs/bin/gobs_guest_jobs +++ b/gobs/bin/gobs_guest_jobs @@ -36,6 +36,7 @@ def main_loop(config_profile): p =3D Process(target=3Dinit_queru.procces_qureru) p.start() p.join() + CM.closeAllConnections() continue =09 repeat =3D False time.sleep(60) diff --git a/gobs/pym/build_queru.py b/gobs/pym/build_queru.py index bdaa064..004afbb 100644 --- a/gobs/pym/build_queru.py +++ b/gobs/pym/build_queru.py @@ -21,7 +21,6 @@ from gobs.manifest import gobs_manifest from gobs.depclean import main_depclean from gobs.flags import gobs_use_flags from _emerge.depgraph import depgraph, backtrack_depgraph - from portage import _encodings from portage import _unicode_decode from portage.versions import cpv_getkey @@ -113,352 +112,6 @@ class queruaction(object): move_queru_buildlog(conn, build_dict['queue_id'], build_error, summa= ry_error, build_log_dict) CM.putConnection(conn) =20 - # copy of ../pym/_emerge/depgraph.py from portage - def _show_unsatisfied_dep(self, mydepgraph, root, atom, myparent=3DNone= , arg=3DNone, - check_backtrack=3DFalse, check_autounmask_breakage=3DFalse): - """ - When check_backtrack=3DTrue, no output is produced and - the method either returns or raises _backtrack_mask if - a matching package has been masked by backtracking. - """ - backtrack_mask =3D False - autounmask_broke_use_dep =3D False - atom_set =3D InternalPackageSet(initial_atoms=3D(atom.without_use,), - allow_repo=3DTrue) - atom_set_with_use =3D InternalPackageSet(initial_atoms=3D(atom,), - allow_repo=3DTrue) - xinfo =3D '"%s"' % atom.unevaluated_atom - if arg: - xinfo=3D'"%s"' % arg - if isinstance(myparent, AtomArg): - xinfo =3D _unicode_decode('"%s"') % (myparent,) - # Discard null/ from failed cpv_expand category expansion. - xinfo =3D xinfo.replace("null/", "") - if root !=3D mydepgraph._frozen_config._running_root.root: - xinfo =3D "%s for %s" % (xinfo, root) - masked_packages =3D [] - missing_use =3D [] - missing_use_adjustable =3D set() - required_use_unsatisfied =3D [] - masked_pkg_instances =3D set() - have_eapi_mask =3D False - pkgsettings =3D mydepgraph._frozen_config.pkgsettings[root] - root_config =3D mydepgraph._frozen_config.roots[root] - portdb =3D mydepgraph._frozen_config.roots[root].trees["porttree"].dba= pi - vardb =3D mydepgraph._frozen_config.roots[root].trees["vartree"].dbapi - bindb =3D mydepgraph._frozen_config.roots[root].trees["bintree"].dbapi - dbs =3D mydepgraph._dynamic_config._filtered_trees[root]["dbs"] - for db, pkg_type, built, installed, db_keys in dbs: - if installed: - continue - if hasattr(db, "xmatch"): - cpv_list =3D db.xmatch("match-all-cpv-only", atom.without_use) - else: - cpv_list =3D db.match(atom.without_use) - if atom.repo is None and hasattr(db, "getRepositories"): - repo_list =3D db.getRepositories() - else: - repo_list =3D [atom.repo] - # descending order - cpv_list.reverse() - for cpv in cpv_list: - for repo in repo_list: - if not db.cpv_exists(cpv, myrepo=3Drepo): - continue - =09 - metadata, mreasons =3D get_mask_info(root_config, cpv, pkgsettings= , db, pkg_type, \ - built, installed, db_keys, myrepo=3Drepo, _pkg_use_enabled=3Dmydepg= raph._pkg_use_enabled) - if metadata is not None and \ - portage.eapi_is_supported(metadata["EAPI"]): - if not repo: - repo =3D metadata.get('repository') - pkg =3D mydepgraph._pkg(cpv, pkg_type, root_config, - installed=3Dinstalled, myrepo=3Drepo) - # pkg.metadata contains calculated USE for ebuilds, - # required later for getMissingLicenses. - metadata =3D pkg.metadata - if pkg.invalid: - # Avoid doing any operations with packages that - # have invalid metadata. It would be unsafe at - # least because it could trigger unhandled - # exceptions in places like check_required_use(). - masked_packages.append( - (root_config, pkgsettings, cpv, repo, metadata, mreasons)) - continue - if not atom_set.findAtomForPackage(pkg, - modified_use=3Dmydepgraph._pkg_use_enabled(pkg)): - continue - if pkg in mydepgraph._dynamic_config._runtime_pkg_mask: - backtrack_reasons =3D \ - mydepgraph._dynamic_config._runtime_pkg_mask[pkg] - mreasons.append('backtracking: %s' % \ - ', '.join(sorted(backtrack_reasons))) - backtrack_mask =3D True - if not mreasons and mydepgraph._frozen_config.excluded_pkgs.findA= tomForPackage(pkg, \ - modified_use=3Dmydepgraph._pkg_use_enabled(pkg)): - mreasons =3D ["exclude option"] - if mreasons: - masked_pkg_instances.add(pkg) - if atom.unevaluated_atom.use: - try: - if not pkg.iuse.is_valid_flag(atom.unevaluated_atom.use.required= ) \ - or atom.violated_conditionals(mydepgraph._pkg_use_enabled(pkg), = pkg.iuse.is_valid_flag).use: - missing_use.append(pkg) - if atom_set_with_use.findAtomForPackage(pkg): - autounmask_broke_use_dep =3D True - if not mreasons: - continue - except InvalidAtom: - writemsg("violated_conditionals raised " + \ - "InvalidAtom: '%s' parent: %s" % \ - (atom, myparent), noiselevel=3D-1) - raise - if not mreasons and \ - not pkg.built and \ - pkg.metadata.get("REQUIRED_USE") and \ - eapi_has_required_use(pkg.metadata["EAPI"]): - if not check_required_use( - pkg.metadata["REQUIRED_USE"], - mydepgraph._pkg_use_enabled(pkg), - pkg.iuse.is_valid_flag): - required_use_unsatisfied.append(pkg) - continue - root_slot =3D (pkg.root, pkg.slot_atom) - if pkg.built and root_slot in mydepgraph._rebuild.rebuild_list: - mreasons =3D ["need to rebuild from source"] - elif pkg.installed and root_slot in mydepgraph._rebuild.reinstall= _list: - mreasons =3D ["need to rebuild from source"] - elif pkg.built and not mreasons: - mreasons =3D ["use flag configuration mismatch"] - masked_packages.append( - (root_config, pkgsettings, cpv, repo, metadata, mreasons)) - =09 - if check_backtrack: - if backtrack_mask: - raise mydepgraph._backtrack_mask() - else: - return - - if check_autounmask_breakage: - if autounmask_broke_use_dep: - raise mydepgraph._autounmask_breakage() - else: - return - - missing_use_reasons =3D [] - missing_iuse_reasons =3D [] - for pkg in missing_use: - use =3D mydepgraph._pkg_use_enabled(pkg) - missing_iuse =3D [] - #Use the unevaluated atom here, because some flags might have gone - #lost during evaluation. - required_flags =3D atom.unevaluated_atom.use.required - missing_iuse =3D pkg.iuse.get_missing_iuse(required_flags) - - mreasons =3D [] - if missing_iuse: - mreasons.append("Missing IUSE: %s" % " ".join(missing_iuse)) - missing_iuse_reasons.append((pkg, mreasons)) - else: - need_enable =3D sorted(atom.use.enabled.difference(use).intersectio= n(pkg.iuse.all)) - need_disable =3D sorted(atom.use.disabled.intersection(use).interse= ction(pkg.iuse.all)) - - untouchable_flags =3D \ - frozenset(chain(pkg.use.mask, pkg.use.force)) - if untouchable_flags.intersection( - chain(need_enable, need_disable)): - continue - - missing_use_adjustable.add(pkg) - required_use =3D pkg.metadata.get("REQUIRED_USE") - required_use_warning =3D "" - if required_use: - old_use =3D mydepgraph._pkg_use_enabled(pkg) - new_use =3D set(mydepgraph._pkg_use_enabled(pkg)) - for flag in need_enable: - new_use.add(flag) - for flag in need_disable: - new_use.discard(flag) - if check_required_use(required_use, old_use, pkg.iuse.is_valid_fla= g) and \ - not check_required_use(required_use, new_use, pkg.iuse.is_valid_f= lag): - required_use_warning =3D ", this change violates use flag constr= aints " + \ - "defined by %s: '%s'" % (pkg.cpv, human_readable_required_use(r= equired_use)) - - if need_enable or need_disable: - changes =3D [] - changes.extend(colorize("red", "+" + x) \ - for x in need_enable) - changes.extend(colorize("blue", "-" + x) \ - for x in need_disable) - mreasons.append("Change USE: %s" % " ".join(changes) + required_us= e_warning) - missing_use_reasons.append((pkg, mreasons)) - =09 - if not missing_iuse and myparent and atom.unevaluated_atom.use.condi= tional: - # Lets see if the violated use deps are conditional. - # If so, suggest to change them on the parent. - # If the child package is masked then a change to - # parent USE is not a valid solution (a normal mask - # message should be displayed instead). - if pkg in masked_pkg_instances: - continue - mreasons =3D [] - violated_atom =3D atom.unevaluated_atom.violated_conditionals(mydep= graph._pkg_use_enabled(pkg), \ - pkg.iuse.is_valid_flag, mydepgraph._pkg_use_enabled(myparent)) - if not (violated_atom.use.enabled or violated_atom.use.disabled): - #all violated use deps are conditional - changes =3D [] - conditional =3D violated_atom.use.conditional - involved_flags =3D set(chain(conditional.equal, conditional.not_eq= ual, \ - conditional.enabled, conditional.disabled)) - untouchable_flags =3D \ - frozenset(chain(myparent.use.mask, myparent.use.force)) - if untouchable_flags.intersection(involved_flags): - continue - required_use =3D myparent.metadata.get("REQUIRED_USE") - required_use_warning =3D "" - if required_use: - old_use =3D mydepgraph._pkg_use_enabled(myparent) - new_use =3D set(mydepgraph._pkg_use_enabled(myparent)) - for flag in involved_flags: - if flag in old_use: - new_use.discard(flag) - else: - new_use.add(flag) - if check_required_use(required_use, old_use, myparent.iuse.is_val= id_flag) and \ - not check_required_use(required_use, new_use, myparent.iuse.is_v= alid_flag): - required_use_warning =3D ", this change violates use flag const= raints " + \ - "defined by %s: '%s'" % (myparent.cpv, \ - human_readable_required_use(required_use)) - for flag in involved_flags: - if flag in mydepgraph._pkg_use_enabled(myparent): - changes.append(colorize("blue", "-" + flag)) - else: - changes.append(colorize("red", "+" + flag)) - mreasons.append("Change USE: %s" % " ".join(changes) + required_us= e_warning) - if (myparent, mreasons) not in missing_use_reasons: - missing_use_reasons.append((myparent, mreasons)) - - unmasked_use_reasons =3D [(pkg, mreasons) for (pkg, mreasons) \ - in missing_use_reasons if pkg not in masked_pkg_instances] - unmasked_iuse_reasons =3D [(pkg, mreasons) for (pkg, mreasons) \ - in missing_iuse_reasons if pkg not in masked_pkg_instances] - show_missing_use =3D False - if unmasked_use_reasons: - # Only show the latest version. - show_missing_use =3D [] - pkg_reason =3D None - parent_reason =3D None - for pkg, mreasons in unmasked_use_reasons: - if pkg is myparent: - if parent_reason is None: - #This happens if a use change on the parent - #leads to a satisfied conditional use dep. - parent_reason =3D (pkg, mreasons) - elif pkg_reason is None: - #Don't rely on the first pkg in unmasked_use_reasons, - #being the highest version of the dependency. - pkg_reason =3D (pkg, mreasons) - if pkg_reason: - show_missing_use.append(pkg_reason) - if parent_reason: - show_missing_use.append(parent_reason) - elif unmasked_iuse_reasons: - masked_with_iuse =3D False - for pkg in masked_pkg_instances: - #Use atom.unevaluated here, because some flags might have gone - #lost during evaluation. - if not pkg.iuse.get_missing_iuse(atom.unevaluated_atom.use.required= ): - # Package(s) with required IUSE are masked, - # so display a normal masking message. - masked_with_iuse =3D True - break - if not masked_with_iuse: - show_missing_use =3D unmasked_iuse_reasons - if required_use_unsatisfied: - # If there's a higher unmasked version in missing_use_adjustable - # then we want to show that instead. - for pkg in missing_use_adjustable: - if pkg not in masked_pkg_instances and \ - pkg > required_use_unsatisfied[0]: - required_use_unsatisfied =3D False - break - mask_docs =3D False - - if required_use_unsatisfied: - # We have an unmasked package that only requires USE adjustment - # in order to satisfy REQUIRED_USE, and nothing more. We assume - # that the user wants the latest version, so only the first - # instance is displayed. - pkg =3D required_use_unsatisfied[0] - output_cpv =3D pkg.cpv + _repo_separator + pkg.repo - writemsg_stdout("\n!!! " + \ - colorize("BAD", "The ebuild selected to satisfy ") + \ - colorize("INFORM", xinfo) + \ - colorize("BAD", " has unmet requirements.") + "\n", - noiselevel=3D-1) - use_display =3D pkg_use_display(pkg, mydepgraph._frozen_config.myopt= s) - writemsg_stdout("- %s %s\n" % (output_cpv, use_display), - noiselevel=3D-1) - writemsg_stdout("\n The following REQUIRED_USE flag constraints " += \ - "are unsatisfied:\n", noiselevel=3D-1) - reduced_noise =3D check_required_use( - pkg.metadata["REQUIRED_USE"], - mydepgraph._pkg_use_enabled(pkg), - pkg.iuse.is_valid_flag).tounicode() - writemsg_stdout(" %s\n" % \ - human_readable_required_use(reduced_noise), - noiselevel=3D-1) - normalized_required_use =3D \ - " ".join(pkg.metadata["REQUIRED_USE"].split()) - if reduced_noise !=3D normalized_required_use: - writemsg_stdout("\n The above constraints " + \ - "are a subset of the following complete expression:\n", - noiselevel=3D-1) - writemsg_stdout(" %s\n" % \ - human_readable_required_use(normalized_required_use), - noiselevel=3D-1) - writemsg_stdout("\n", noiselevel=3D-1) - - elif show_missing_use: - writemsg_stdout("\nemerge: there are no ebuilds built with USE flags= to satisfy "+green(xinfo)+".\n", noiselevel=3D-1) - writemsg_stdout("!!! One of the following packages is required to co= mplete your request:\n", noiselevel=3D-1) - for pkg, mreasons in show_missing_use: - writemsg_stdout("- "+pkg.cpv+_repo_separator+pkg.repo+" ("+", ".joi= n(mreasons)+")\n", noiselevel=3D-1) - - elif masked_packages: - writemsg_stdout("\n!!! " + \ - colorize("BAD", "All ebuilds that could satisfy ") + \ - colorize("INFORM", xinfo) + \ - colorize("BAD", " have been masked.") + "\n", noiselevel=3D-1) - writemsg_stdout("!!! One of the following masked packages is require= d to complete your request:\n", noiselevel=3D-1) - have_eapi_mask =3D show_masked_packages(masked_packages) - if have_eapi_mask: - writemsg_stdout("\n", noiselevel=3D-1) - msg =3D ("The current version of portage supports " + \ - "EAPI '%s'. You must upgrade to a newer version" + \ - " of portage before EAPI masked packages can" + \ - " be installed.") % portage.const.EAPI - writemsg_stdout("\n".join(textwrap.wrap(msg, 75)), noiselevel=3D-1) - writemsg_stdout("\n", noiselevel=3D-1) - mask_docs =3D True - else: - cp_exists =3D False - msg =3D [] - if not isinstance(myparent, AtomArg): - # It's redundant to show parent for AtomArg since - # it's the same as 'xinfo' displayed above. - dep_chain =3D self._get_dep_chain(myparent, atom) - for node, node_type in dep_chain: - msg.append('(dependency required by "%s" [%s])' % \ - (colorize('INFORM', _unicode_decode("%s") % \ - (node)), node_type)) - if msg: - writemsg_stdout("\n".join(msg), noiselevel=3D-1) - writemsg_stdout("\n", noiselevel=3D-1) - if mask_docs: - show_mask_docs() - writemsg_stdout("\n", noiselevel=3D-1) - def action_build(self, settings, trees, mtimedb, myopts, myaction, myfi= les, spinner, build_dict): =20 if '--usepkgonly' not in myopts: @@ -502,6 +155,7 @@ class queruaction(object): if not success: for pargs, kwargs in mydepgraph._dynamic_config._unsatisfied_deps_for= _display: mydepgraph._show_unsatisfied_dep(mydepgraph, *pargs, **kwargs) + mydepgraph.display_problems() settings, trees, mtimedb =3D load_emerge_config() myparams =3D create_depgraph_params(myopts, myaction) try: @@ -1068,7 +722,7 @@ class queruaction(object): CM.putConnection(conn) return if not build_dict['post_message'] is [] and build_dict['ebuild_id'] is= None: - CM.putConnection(conn) + CM.closeAllConnections() return if not build_dict['ebuild_id'] is None and build_dict['checksum'] is N= one: del_old_queue(conn, build_dict['queue_id'])