Beispiel #1
0
def updateSomePrograms(programs):
  programsToBeUpdated = set()
  dependencyTable = registry.getDependencyTable(availablePrograms.getAvailablePrograms())
  for program in programs:
    programsToBeUpdated.add(program)
    for dependent in dependencyTable[program]["required-by"]:
      if registry.isProgramInstalled(dependent):
        programsToBeUpdated.add(dependent)
  runUpdate(list(programsToBeUpdated))
Beispiel #2
0
def updateSomePrograms(programs):
    programsToBeUpdated = set()
    dependencyTable = registry.getDependencyTable(
        availablePrograms.getAvailablePrograms())
    for program in programs:
        programsToBeUpdated.add(program)
        for dependent in dependencyTable[program]["required-by"]:
            if registry.isProgramInstalled(dependent):
                programsToBeUpdated.add(dependent)
    runUpdate(list(programsToBeUpdated))
Beispiel #3
0
def installProgramAndDependencies(programName, useCache):
  """
  Build the dependencytree and install bottom->up
  """
  if registry.isProgramInstalled(programName):
    print("<{0}> is already installed.".format(programName))
  else:
    #get dependencytree and install bottom->up
    dependencyTree = reversed(registry.getDependencyTree(programName))
    programsToBeInstalled = []
    for dependency in dependencyTree:
      if not registry.isProgramInstalled(dependency):
        programsToBeInstalled.append(dependency)

    print("The following programs will be installed.")
    for program in programsToBeInstalled:
      print(program)

    for program in programsToBeInstalled:
      installProgram(program, useCache)