From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0026D59CA3 for ; Tue, 15 Mar 2016 21:20:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B69D8E0875; Tue, 15 Mar 2016 21:20:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 100D9E0848 for ; Tue, 15 Mar 2016 21:20:52 +0000 (UTC) Received: from professor-x (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id A78F3340D69 for ; Tue, 15 Mar 2016 21:20:51 +0000 (UTC) Date: Tue, 15 Mar 2016 14:19:56 -0700 From: Brian Dolbec To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [Patch] Repoman rewrite stage2 modularization conversion complete Message-ID: <20160315141956.27b53de2.dolsen@gentoo.org> In-Reply-To: <56E878AD.8020209@gentoo.org> References: <20160110134008.4fce78c0.dolsen@gentoo.org> <5693CCAF.7020102@gentoo.org> <20160305133705.42b54258.dolsen@gentoo.org> <56E6F167.4050806@gentoo.org> <56E6F343.80005@gentoo.org> <20160314105256.37fb8e90.dolsen@gentoo.org> <56E754D3.5080308@gentoo.org> <20160314174710.4b6ebd1e.dolsen@gentoo.org> <56E75FB8.9060802@gentoo.org> <20160315120457.631e1dd3.dolsen@gentoo.org> <56E864B6.9060308@gentoo.org> <56E865BB.6040502@gentoo.org> <20160315131731.2edf502d.dolsen@gentoo.org> <56E86FB5.5080208@gentoo.org> <56E8711C.4070407@gentoo.org> <20160315135751.166ba608.dolsen@gentoo.org> <56E878AD.8020209@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 06cbd6f6-27c6-452c-bd98-0b4cc99b7f64 X-Archives-Hash: 0726b0e8788a9a86b7d1d7c9ca632d54 On Tue, 15 Mar 2016 14:03:41 -0700 Zac Medico wrote: > On 03/15/2016 01:57 PM, Brian Dolbec wrote: > > On Tue, 15 Mar 2016 13:31:24 -0700 > > Zac Medico wrote: > > > >>> > >>> Also, now that we are using Fuse, can't we stop returning things > >>> from these functions entirely, so that dynamic_data is only > >>> updated by side-effects? > >>> > >> > >> I think 'continue' is the only one left. We could just return a > >> single boolean, or use an exception to do what 'continue' does. > > > > NOPE :( not without a lot more work... > > > > arches.py: return {'continue': False, 'arches': arches} > > depend.py: return {'continue': False, 'unknown_pkgs': unknown_pkgs, > > 'type_list': type_list, 'badlicsyntax': badlicsyntax, > > 'baddepsyntax': baddepsyntax} > > ebuild.py: return {'continue': False, 'ebuild': self} > > return {'continue': False, 'pkg': self.pkg} > > isebuild.py: return {'continue': self.continue_, 'pkgs': pkgs, > > 'can_force': not self.continue_} > > live.py: return {'continue': False, > > 'live_ebuild': LIVE_ECLASSES.intersection( > > kwargs.get('ebuild').inherited)} > > fetches.py: return {'continue': False, 'src_uri_error': > > self._src_uri_error} > > pkgmetadata.py: return {'continue': False, 'muselist': > > frozenset(self.musedict)} > > return {'continue': False, 'muselist': > > frozenset(self.musedict)} > > scan.py: return {'continue': False, 'eadded': > > self.vcs_settings.status.eadded} > > use_flags.py: return {'continue': False, 'ebuild_UsedUseFlags': > > self.usedUseFlags, 'used_useflags': > > used_useflags} > > > > > > But we can define a generic dynamic_data class that holds the > > data that can be modified in a similar way to the Fuse class. That > > way we don't have to update it like we do a dictionary. > > > > Can't we add all these things to the dynamic_data dict that's > initialized in Scanner.scan_pkgs (along with Fuse instances), and just > let them get passed in as arguments, so that the functions can act on > them without having to return them? Yeah, /me is being a dummy. The modules are currently being passed the dict as a **kwargs. So the individual attributes are accessible directly. We could just pass it as one arg instead then the modules can just modify the dictionary directly since it is passed in by pointer. Sorry, my head is bouncing back and forth between this and other work code... But I like how we're getting the code in better shape... something I had reserved for stage3 ;) The current method is the first thing that came to me when I discovered I needed to get new data back into the dynamic_data for trailing modules in the queue. -- Brian Dolbec