From Fedora Project Wiki

Revision as of 09:36, 7 July 2011 by Jskladan (talk | contribs) (Created page with "= Depcheck process = == What do we want from depcheck? == # Subsets of packages, which can be installed. # Sets of 'uninstallable' packages, ideally with logs ;-) # Ideally, we...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Depcheck process

What do we want from depcheck?

  1. Subsets of packages, which can be installed.
  2. Sets of 'uninstallable' packages, ideally with logs ;-)
  3. Ideally, we want to be able to do all the checks 'virtually' just using pkgdb & yum api (i.e. without performing an actual package installation)

Simple process

Data

  1. All_packages = dictionary of all packages in pending. Contains information about 'installability' (i.e. whether the package is at least in one installable subset)
  2. Runs = List of all packages 'installable' in that run

Data structures than can be imagined like this:

  • All_packages = {package_name: {OK: None, was_first = False}, ...}
    Where OK is boolean indicating, whether the package
    • None - package was not yet a part of any run
    • True - was installed in some installable subset
    • False - package had problems with installation
    Also for the OK, the update-path is None -> False -> True (i.e. None can change to both True or False, False can change to True, True can not be changed)
    was_first is a helper, to track whether the package was ever "at the start" of the installable subset creation. This is important for deciding when to end the depcheck process.
  • Runs = [[package_name, ...], ...]
    Stores the installable subset of the respective run

Algorithm

  1. Filter packages from all_packages (let's call the output from this filter undecided)
    • Take packages which have OK set to None or False
    • Remove packages which have the was_first mutex set to True
  2. If undecided is empty:
    • End Depcheck
  3. Pick random package from undecided
  4. Set the was_first mutex to True
  5. For each package in undecided (starting with the randomly selected package):
    • Try to install the package
    • If installation passed:
      update the all_packages[package]['OK'] to True
    • If installation failed:
      update the all_packages[package]['OK'] to False (if previous state was True, than it is not updated)

Example

Let's have 'pending' packages A..F with these dependencies:

  • A requires B
  • A requires C
  • A conflicts with D
  • D requires C
  • E has no dependencies at all
  • F requires XYZ which is not present in any repo