public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gmail.com>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] the refactoring of emerge, continued... (was PATCH: refactor emerge spinner (#102073))
Date: Thu, 11 Aug 2005 22:19:31 -0700	[thread overview]
Message-ID: <42FC3163.2080709@gmail.com> (raw)
In-Reply-To: <200508112306.20986.jstubbs@gentoo.org>

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



  reply	other threads:[~2005-08-12  5:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11  5:08 [gentoo-portage-dev] PATCH: refactor emerge spinner (#102073) Zac Medico
2005-08-11 12:14 ` Alec Warner
2005-08-11 14:06 ` Jason Stubbs
2005-08-12  5:19   ` Zac Medico [this message]
2005-08-12 12:36     ` [gentoo-portage-dev] the refactoring of emerge, continued... (was PATCH: refactor emerge spinner (#102073)) Alec Warner
2005-08-12 20:57       ` Zac Medico
2005-08-12 21:48         ` warnera6
2005-08-12 22:10           ` Marius Mauch
2005-08-12 22:12             ` warnera6
2005-08-12 22:49           ` Zac Medico
2005-08-13  1:06             ` Jason Stubbs
2005-08-13 17:34     ` Zac Medico
2005-08-13 22:25       ` Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42FC3163.2080709@gmail.com \
    --to=zmedico@gmail.com \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox