'Internal routine, recursive engine for prepareInstall.
Test whether the package is installed and (if not installed
or if force==1) prepend it to the temporary todo list and
call ourselves recursively on all prerequisites.'

def _prepareInstall(self, package, force=0, recursive=1):

    if (not force):
        (status, message) = package.installed()
        if (status == 'yes'):
            return
    if ((package in self._todo) or (package in self._curtodo)):
        return
    self._curtodo.insert(0, package)
    if (not recursive):
        return
    prereqs = package.prerequisites()
    for (pkg, descr) in prereqs:
        if pkg:
            self._prepareInstall(pkg, False, recursive)
        else:
            self._curmessages.append(('Problem    with    dependency:    %s' % descr))
