Code review comment for lp://qastaging/~edgar-b-dsouza/acire/snippet_dependency_res_1

Revision history for this message
Ed S (edgar-b-dsouza) wrote :

On Mon, Mar 29, 2010 at 9:25 AM, Jono Bacon <email address hidden> wrote:
> This all sounds great, Ed. What would also be great to factor into your design and code is to possibly have a depchecker.py file which deals with the general tasks of checking which modules a snippet uses and detecting the OS, and then loading a separate .py file which has a standard set of methods for dealing with the logic of searching for and installing packages. This means that we could then open it up to other distros to simply provide a .py file appropriate to them.

:-) Already working on that, Jono - I found that the built-in platform
module's linux_distribution() function returns a tuple of which the
first is the distro name; using that, I'm writing a
"distropkgutils.py" in which I'm building a class that (in __init__)
will grab selected functions (defined in the file), based on the
distro, and expose those as its methods - so depchecker.py can simply
call methods of this class for all pkg-mgt-related work (including
retrieving a list of uninstalled packages, which I've hard-coded with
aptitude search now) without having to "know" about the underlying
package mgt mechanism. I saw your point, that it's way better to do
this the portable way right now, rather than get it into trunk and
then do several revisions to make it distro-portable.
Of course, the functions for distros other than Ubuntu will be a
"not_implemented" message stub, which other contributors can flesh out
later (my Fedora 12 VM crashed yesterday :-( so I'll just focus on
Ubuntu right now).

« Back to merge proposal