Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: Brian Dolbec <dolsen@g.o>, gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [Patch] Repoman rewrite stage2 modularization conversion complete
Date: Tue, 15 Mar 2016 21:03:59
Message-Id: 56E878AD.8020209@gentoo.org
1 On 03/15/2016 01:57 PM, Brian Dolbec wrote:
2 > On Tue, 15 Mar 2016 13:31:24 -0700
3 > Zac Medico <zmedico@g.o> wrote:
4 >
5 >>>
6 >>> Also, now that we are using Fuse, can't we stop returning things
7 >>> from these functions entirely, so that dynamic_data is only updated
8 >>> by side-effects?
9 >>>
10 >>
11 >> I think 'continue' is the only one left. We could just return a single
12 >> boolean, or use an exception to do what 'continue' does.
13 >
14 > NOPE :( not without a lot more work...
15 >
16 > arches.py: return {'continue': False, 'arches': arches}
17 > depend.py: return {'continue': False, 'unknown_pkgs': unknown_pkgs,
18 > 'type_list': type_list, 'badlicsyntax': badlicsyntax, 'baddepsyntax':
19 > baddepsyntax}
20 > ebuild.py: return {'continue': False, 'ebuild': self}
21 > return {'continue': False, 'pkg': self.pkg}
22 > isebuild.py: return {'continue': self.continue_, 'pkgs': pkgs,
23 > 'can_force': not self.continue_}
24 > live.py: return {'continue': False,
25 > 'live_ebuild': LIVE_ECLASSES.intersection(
26 > kwargs.get('ebuild').inherited)}
27 > fetches.py: return {'continue': False, 'src_uri_error':
28 > self._src_uri_error}
29 > pkgmetadata.py: return {'continue': False, 'muselist':
30 > frozenset(self.musedict)}
31 > return {'continue': False, 'muselist':
32 > frozenset(self.musedict)}
33 > scan.py: return {'continue': False, 'eadded':
34 > self.vcs_settings.status.eadded}
35 > use_flags.py: return {'continue': False, 'ebuild_UsedUseFlags':
36 > self.usedUseFlags, 'used_useflags':
37 > used_useflags}
38 >
39 >
40 > But we can define a generic dynamic_data class that holds the
41 > data that can be modified in a similar way to the Fuse class. That way
42 > we don't have to update it like we do a dictionary.
43 >
44
45 Can't we add all these things to the dynamic_data dict that's
46 initialized in Scanner.scan_pkgs (along with Fuse instances), and just
47 let them get passed in as arguments, so that the functions can act on
48 them without having to return them?
49 --
50 Thanks,
51 Zac

Replies