Package backend :: Package server :: Module rhnDependency
[hide private]
[frames] | no frames]

Module rhnDependency

source code

Classes [hide private]
  SolveDependenciesError
Functions [hide private]
 
__single_query_with_arch_and_id(server_id, deps, query)
Run one of the queries and return the results along with the arch.
source code
 
find_package_with_arch(server_id, deps) source code
 
solve_dependencies_with_limits(server_id, deps, version, all=0, limit_operator=None, limit=None)
This version of solve_dependencies allows the caller to get all of the packages that solve a dependency and limit the packages that are returned to those that match the criteria defined by limit_operator and limit.
source code
 
_v2packages_to_v1list(packages, deplist, all=0) source code
 
solve_dependencies_arch(server_id, deps, version)
Does the same thing as solve_dependencies, but also returns the architecture label with the package info.
source code
 
solve_dependencies(server_id, deps, version, nvre=None)
The unchanged version of solve_dependencies.
source code
 
_avoid_compat_packages(dict)
attempt to avoid giving out the compat-* packages if there are other candidates
source code
 
cmp_evr(pkg1, pkg2)
Intended to be passed to a list object's sort().
source code
 
test_evr(evr, operator, limit)
Check to see if evr is within the limit.
source code
 
check_against_operator(ret, operator) source code
Variables [hide private]
  __packages_with_arch_and_id_sql = '\nselect distinct\n p.id...
  __packages_sql = '\nselect distinct\n pn.name,\n (pe.evr...
  __packages_all_sql = '\nselect distinct\n pn.name,\n (pe...
  __provides_sql = '\nselect distinct\n pn.name,\n (pe.ev...
  __provides_all_sql = '\nselect distinct\n pn.name,\n (p...
  __files_sql = '\nselect distinct\n pn.name,\n (pe.evr).v...
  __files_all_sql = '\nselect distinct\n pn.name,\n (pe.ev...
  __package__ = 'backend.server'
Function Details [hide private]

solve_dependencies_with_limits(server_id, deps, version, all=0, limit_operator=None, limit=None)

source code 

This version of solve_dependencies allows the caller to get all of the packages that solve a dependency and limit the packages that are returned to those that match the criteria defined by limit_operator and limit. This version of the function also returns the architecture label of the package[s] that get returned.

limit_operator can be any of: '<', '<=', '==', '>=', or '>'. limit is a a string of the format [epoch:]name-version-release deps is a list of filenames that the packages that are returned must provide. version is the version of the client that is calling the function.

Indexes for the tuple entry_index = 0 preference_index = 1

Indexes for the list of package fields. name_index = 0 version_index = 1 release_index = 2 epoch_index = 3

solve_dependencies_arch(server_id, deps, version)

source code 
Does the same thing as solve_dependencies, but also returns the architecture label with the package info.
E.g.
OUT:
   Dictionary with key values being the filnames in deps and the values being a list of lists of package info.
   Example :=  {'filename1'    :   [['name', 'version', 'release', 'epoch', 'architecture'],
                                    ['name2', 'version2', 'release2', 'epoch2', 'architecture2']]}

solve_dependencies(server_id, deps, version, nvre=None)

source code 
The unchanged version of solve_dependencies.
IN:
   server_id := id info of the server
   deps := list of filenames that are needed by the caller
   version := version of the client

OUT:
   Dictionary with key values being the filnames in deps and the values being a list of lists of package info.
   Example :=  {'filename1'    :   [['name', 'version', 'release', 'epoch'],
                                    ['name2', 'version2', 'release2', 'epoch2']]}

cmp_evr(pkg1, pkg2)

source code 

Intended to be passed to a list object's sort(). In: {'epoch': 'value', 'version':'value', 'release':'value'}

test_evr(evr, operator, limit)

source code 
Check to see if evr is within the limit.
IN: evr = { 'epoch' : value, 'version':value, 'release':value }
    operator can be any of: '<', '<=', '==', '>=', '>'
    limit = { 'epoch' : value, 'version':value, 'release':value }
OUT:
   1 or 0


Variables Details [hide private]

__packages_with_arch_and_id_sql

Value:
'''
select distinct
    p.id id,
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
...

__packages_sql

Value:
'''
select distinct
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
    1 as preference
...

__packages_all_sql

Value:
'''
select distinct
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
    1 as preference
...

__provides_sql

Value:
'''
select  distinct
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
    2 as preference
...

__provides_all_sql

Value:
'''
select  distinct
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
    2 as preference
...

__files_sql

Value:
'''
select distinct
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
    3 as preference
...

__files_all_sql

Value:
'''
select distinct
    pn.name,
    (pe.evr).version as version,
    (pe.evr).release as release,
    (pe.evr).epoch as epoch,
    pa.label as arch,
    3 as preference
...