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 1SbJ7p-0004Km-UP for garchives@archives.gentoo.org; Sun, 03 Jun 2012 22:18:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4214DE094A; Sun, 3 Jun 2012 22:18:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F3216E094A for ; Sun, 3 Jun 2012 22:18:04 +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 374CB1B4027 for ; Sun, 3 Jun 2012 22:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EFE4EE5404 for ; Sun, 3 Jun 2012 22:18:02 +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: <1338761836.16e795f105f5e2e2d3b6f2ab36b85fa11ecf55af.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/pym/build_queru.py gobs/pym/depgraph.py X-VCS-Directories: gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 16e795f105f5e2e2d3b6f2ab36b85fa11ecf55af X-VCS-Branch: master Date: Sun, 3 Jun 2012 22:18:02 +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: a893f504-58f9-4ecf-9740-e59d8790e653 X-Archives-Hash: 39bb2844c2c79ccb70915ba22d4a2336 commit: 16e795f105f5e2e2d3b6f2ab36b85fa11ecf55af Author: Magnus Granberg gentoo org> AuthorDate: Sun Jun 3 22:17:16 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sun Jun 3 22:17:16 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/zorry.git;a=3D= commit;h=3D16e795f1 update dep handling --- gobs/pym/build_queru.py | 105 +++++++++++++++++++----------------------= ------ gobs/pym/depgraph.py | 49 ++++++++++++++-------- 2 files changed, 74 insertions(+), 80 deletions(-) diff --git a/gobs/pym/build_queru.py b/gobs/pym/build_queru.py index 8b33440..46d815c 100644 --- a/gobs/pym/build_queru.py +++ b/gobs/pym/build_queru.py @@ -150,68 +150,45 @@ class queruaction(object): root_config =3D trees[settings["ROOT"]]["root_config"] display_missing_pkg_set(root_config, e.value) build_dict['type_fail'] =3D "depgraph fail" - build_dict['check_fail'] =3D True - use_changes =3D None - if not success: - mydepgraph.display_problems() - settings, trees, mtimedb =3D load_emerge_config() - myparams =3D create_depgraph_params(myopts, myaction) - try: - success, mydepgraph, favorites =3D backtrack_depgraph( - settings, trees, myopts, myparams, myaction, myfiles, spinner) - except portage.exception.PackageSetNotFound as e: - root_config =3D trees[settings["ROOT"]]["root_config"] - display_missing_pkg_set(root_config, e.value) - build_dict['type_fail'] =3D "depgraph fail" - build_dict['check_fail'] =3D True - if not success: - mydepgraph.display_problems() - build_dict['type_fail'] =3D "depgraph fail" - build_dict['check_fail'] =3D True - =09 - """if mydepgraph._dynamic_config._needed_use_config_changes: - use_changes =3D {} - for pkg, needed_use_config_changes in mydepgraph._dynamic_config._nee= ded_use_config_changes.items(): - new_use, changes =3D needed_use_config_changes - use_changes[pkg.cpv] =3D changes - iteritems_packages =3D {} - for k, v in use_changes.iteritems(): - k_package =3D portage.versions.cpv_getkey(k) - iteritems_packages[ k_package ] =3D v - logging.info('iteritems_packages %s', iteritems_packages) - build_cpv_dict =3D iteritems_packages - if use_changes is not None: - for k, v in build_cpv_dict.iteritems(): - build_use_flags_list =3D [] - for x, y in v.iteritems(): - if y is True: - build_use_flags_list.append(x) - if y is False: - build_use_flags_list.append("-" + x) - logging.info("k: %s, build_use_flags_list: %s", k, build_use_flags_l= ist) - if not build_use_flags_list =3D=3D []: - build_use_flags =3D "" - for flags in build_use_flags_list: - build_use_flags =3D build_use_flags + flags + ' ' - filetext =3D k + ' ' + build_use_flags - logging.info('filetext %s', filetext) - with open("/etc/portage/package.use/gobs.use", "a") as f: - f.write(filetext) - f.write('\n') - settings, trees, mtimedb =3D load_emerge_config() - myparams =3D create_depgraph_params(myopts, myaction) - try: - success, mydepgraph, favorites =3D backtrack_depgraph( - settings, trees, myopts, myparams, myaction, myfiles, spinner) - except portage.exception.PackageSetNotFound as e: - root_config =3D trees[settings["ROOT"]]["root_config"] - display_missing_pkg_set(root_config, e.value) - build_dict['type_fail'] =3D "depgraph fail" - build_dict['check_fail'] =3D True - if not success: - mydepgraph.display_problems() - build_dict['type_fail'] =3D "depgraph fail" - build_dict['check_fail'] =3D True""" + if not success: + if mydepgraph._dynamic_config._needed_p_mask_changes: + build_dict['type_fail'] =3D "Mask packages" + build_dict['check_fail'] =3D True + mydepgraph.display_problems() + self.log_fail_queru(build_dict, settings) + return 1, settings, trees, mtimedb + if mydepgraph._dynamic_config._needed_use_config_changes: + repeat =3D True + repeat_times =3D 0 + while repeat: + mydepgraph._display_autounmask() + settings, trees, mtimedb =3D load_emerge_config() + myparams =3D create_depgraph_params(myopts, myaction) + try: + success, mydepgraph, favorites =3D backtrack_depgraph( + settings, trees, myopts, myparams, myaction, myfiles, spinner) + except portage.exception.PackageSetNotFound as e: + root_config =3D trees[settings["ROOT"]]["root_config"] + display_missing_pkg_set(root_config, e.value) + if not success and mydepgraph._dynamic_config._needed_use_config_= changes: + print("repaet_times:", repeat_times) + if repeat_times is 2: + build_dict['type_fail'] =3D "Need use change" + build_dict['check_fail'] =3D True + mydepgraph.display_problems() + repeat =3D False + repeat =3D False + else: + repeat_times =3D repeat_times + 1 + else: + repeat =3D False + + if mydepgraph._dynamic_config._unsolvable_blockers: + mydepgraph.display_problems() + build_dict['type_fail'] =3D "Blocking packages" + build_dict['check_fail'] =3D True + self.log_fail_queru(build_dict, settings) + return 1, settings, trees, mtimedb =20 if build_dict['check_fail'] is True: self.log_fail_queru(build_dict, settings) @@ -693,7 +670,9 @@ class queruaction(object): if not "noclean" in build_dict['post_message']: depclean_fail =3D main_depclean() try: - os.remove("/etc/portage/package.use/gobs.use") + os.remove("/etc/portage/package.use/99_autounmask") + with open("/etc/portage/package.use/99_autounmask", "a") as f: + f.close except: pass if build_fail is False or depclean_fail is False: diff --git a/gobs/pym/depgraph.py b/gobs/pym/depgraph.py index 0e8200c..cf5a106 100644 --- a/gobs/pym/depgraph.py +++ b/gobs/pym/depgraph.py @@ -3776,7 +3776,7 @@ class depgraph(object): self._dynamic_config._need_restart =3D True return new_use =20 - def check_required_use2(required_use, use, iuse_match): + def change_required_use(self, pkg): """ Checks if the use flags listed in 'use' satisfy all constraints specified in 'constraints'. @@ -3792,6 +3792,10 @@ class depgraph(object): @return: Indicates if REQUIRED_USE constraints are satisfied """ =20 + required_use =3D pkg.metadata["REQUIRED_USE"] + use =3Dself._pkg_use_enabled(pkg) + iuse_match =3D pkg.iuse.is_valid_flag + def is_active(token): if token.startswith("!"): flag =3D token[1:] @@ -3824,14 +3828,15 @@ class depgraph(object): mysplit =3D required_use.split() level =3D 0 stack =3D [[]] - tree =3D _RequiredUseBranch() + tree =3D portage.dep._RequiredUseBranch() node =3D tree need_bracket =3D False + target_use =3D {} =20 for token in mysplit: if token =3D=3D "(": if not need_bracket: - child =3D _RequiredUseBranch(parent=3Dnode) + child =3D portage.dep._RequiredUseBranch(parent=3Dnode) node._children.append(child) node =3D child =20 @@ -3883,7 +3888,7 @@ class depgraph(object): "node is not last child of parent") for child in node._children: node._parent._children.append(child) - if isinstance(child, _RequiredUseBranch): + if isinstance(child, portage.dep._RequiredUseBranch): child._parent =3D node._parent =20 elif not node._children: @@ -3898,7 +3903,7 @@ class depgraph(object): raise AssertionError( "node is not last child of parent") node._parent._children.append(node._children[0]) - if isinstance(node._children[0], _RequiredUseBranch): + if isinstance(node._children[0], portage.dep._RequiredUseBranch): node._children[0]._parent =3D node._parent node =3D node._children[0] if node._operator is None and \ @@ -3909,7 +3914,7 @@ class depgraph(object): "node is not last child of parent") for child in node._children: node._parent._children.append(child) - if isinstance(child, _RequiredUseBranch): + if isinstance(child, portage.dep._RequiredUseBranch): child._parent =3D node._parent =20 node =3D node._parent @@ -3922,7 +3927,7 @@ class depgraph(object): _("malformed syntax: '%s'") % required_use) need_bracket =3D True stack[level].append(token) - child =3D _RequiredUseBranch(operator=3Dtoken, parent=3Dnode) + child =3D portage.dep._RequiredUseBranch(operator=3Dtoken, parent=3D= node) node._children.append(child) node =3D child else: @@ -3934,20 +3939,30 @@ class depgraph(object): if token[-1] =3D=3D "?": need_bracket =3D True stack[level].append(token) - child =3D _RequiredUseBranch(operator=3Dtoken, parent=3Dnode) + child =3D portage.dep._RequiredUseBranch(operator=3Dtoken, parent=3D= node) node._children.append(child) node =3D child else: satisfied =3D is_active(token) + if satisfied is False: + new_changes =3D {} + new_changes[token] =3D True + if not pkg.use.mask.intersection(new_changes) or not \ + pkg.use.force.intersection(new_changes): + if token in pkg.use.enabled: + target_use[token] =3D False + elif not token in pkg.use.enabled: + target_use[token] =3D True + stack[level].append(satisfied) - node._children.append(_RequiredUseLeaf(token, satisfied)) + node._children.append(portage.dep._RequiredUseLeaf(token, satisfied= )) =20 if level !=3D 0 or need_bracket: raise InvalidDependString( _("malformed syntax: '%s'") % required_use) =20 tree._satisfied =3D False not in stack[0] - return tree + return target_use =20 def _wrapped_select_pkg_highest_available_imp(self, root, atom, onlydep= s=3DFalse, autounmask_level=3DNone): root_config =3D self._frozen_config.roots[root] @@ -4152,13 +4167,13 @@ class depgraph(object): if pkg.metadata.get("REQUIRED_USE") and eapi_has_required_use(pkg.m= etadata["EAPI"]): required_use_is_sat =3D check_required_use(pkg.metadata["REQUIRED_= USE"], self._pkg_use_enabled(pkg), pkg.iuse.is_valid_flag) - if not required_use_is_sat: - if autounmask_level and autounmask_level.allow_use_changes and no= t pkg.built: - # pers the required_use to get the needed use flags - required_use =3D foo() - else: - pass =09 - =09 + if not required_use_is_sat: + if autounmask_level and autounmask_level.allow_use_changes \ + and not pkg.built: + target_use =3D self.change_required_use(pkg) + if not target_use is None: + use =3D self._pkg_use_enabled(pkg, target_use) =09 + if atom.use: matched_pkgs_ignore_use.append(pkg) if autounmask_level and autounmask_level.allow_use_changes and not= pkg.built: