From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1E3RqW-00074K-Vs for garchives@archives.gentoo.org; Fri, 12 Aug 2005 05:12:45 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j7C5BCN0025194; Fri, 12 Aug 2005 05:11:12 GMT Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j7C5BBSX017888 for ; Fri, 12 Aug 2005 05:11:12 GMT Received: by wproxy.gmail.com with SMTP id i23so647991wra for ; Thu, 11 Aug 2005 22:12:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Bv0LuEVxxkQj0JH7BAi5HmAEw83dibn3v9ZwEnAahYKeChpWn3qkE0rbbiBozbCynX6wZXYfg8IUwKbgKsaaLv1UD3ImwNFbA4ZMaetlxRx1bQawMdGtyOQG8Vk8lG06BIluJBGjwlZkaYTI8sXyVXnJpBbswjHQfDYZT6/4Omg= Received: by 10.54.30.40 with SMTP id d40mr1664070wrd; Thu, 11 Aug 2005 22:12:09 -0700 (PDT) Received: from ?192.168.1.104? ([24.30.171.44]) by mx.gmail.com with ESMTP id d8sm12177737wra.2005.08.11.22.12.08; Thu, 11 Aug 2005 22:12:09 -0700 (PDT) Message-ID: <42FC3163.2080709@gmail.com> Date: Thu, 11 Aug 2005 22:19:31 -0700 From: Zac Medico User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050804) X-Accept-Language: en-us, en Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] the refactoring of emerge, continued... (was PATCH: refactor emerge spinner (#102073)) References: <42FADD3A.7020103@gmail.com> <200508112306.20986.jstubbs@gentoo.org> In-Reply-To: <200508112306.20986.jstubbs@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 06142d18-8ecc-401a-892b-8d233ba3b18c X-Archives-Hash: dde384a5980c9165024c4cb846143b09 Hello All, The use of global scope code should be minimized in order to prevent confusion and thereby make code more understandable and maintainable. After some analysis of emerge's global scope code, I am confident that all of it can be refactored quite easily, with no regressions or changes in functionality (reorganization only). In order to accomplish this goal, I have categorized the global scope variables by which parts of code depend on them. The variables are listed in the following table, in the order that they occur in the source code: Variable Name Dependency ------------------------------------------------------- spinner search.execute(),depgraph.create() merged unused params unused actions local options local shortmapping local myaction global myopts global myfiles global edebug global verbosity global tmpcmdline local cmdline local CLEAN_DELAY unmerge() EMERGE_WARNING_DELAY global myparams depgraph.create(),depgraph.xcreate() add local sub local Variables within a given category can be dealt with in a similar manner. For example, variables with "local" dependency should be enclosed within a function or method along with the code that depends on them. Variables with "global" dependency can either remain as global variables or become instance variables of an object. Based on this analysis, I believe that I can quickly create an emerge refactorization patch for portage-2.1 with no regressions or changes in functionality (reorganization only). If all (or some) of the portage developers agree that it is a good idea then I would be happy to create a patch for all to scrutinize. :-) Zac -- gentoo-portage-dev@gentoo.org mailing list