Package conary :: Package deps :: Module deps
[hide private]
[frames] | no frames]

Module deps

source code

Classes [hide private]
  BaseDependency
  Dependency
  DependencyClass
  AbiDependency
  InstructionSetDependency
  TargetInstructionSetDependency
  OldSonameDependencies
  SonameDependencies
  UserInfoDependencies
  GroupInfoDependencies
  CILDependencies
  JavaDependencies
  PythonDependencies
  PerlDependencies
  RubyDependencies
  PhpDependencies
  FileDependencies
  TroveDependencies
  UseDependency
  DependencySet
  Flavor
Functions [hide private]
 
_registerDepClass(classObj) source code
 
UnknownDependencyFactory(intTag) source code
 
_Thaw(depSet, frz) source code
 
ThawDependencySet(frz) source code
deps.deps.Flavor
ThawFlavor(frz)
PUBLIC API
source code
 
overrideFlavor(oldFlavor, newFlavor, mergeType=2)
Performs overrides of flavors as expected when the new flavor is specified by a user -- the user's flavor overrides use flags, and if the user specifies any instruction sets, only those instruction sets will be in the final flavor.
source code
 
_mergeDeps(depList, mergeType)
Returns a new Dependency which merges the flags from the two existing dependencies.
source code
 
mergeFlavorList(flavors, mergeType=1) source code
 
mergeFlavor(flavor, mergeBase)
Merges the given flavor with the mergeBase - if flavor doesn't contain use flags, then include the mergeBase's use flags.
source code
 
filterFlavor(depSet, filters) source code
 
_filterDeps(depClass, dep, filterDeps) source code
 
getInstructionSetFlavor(flavor) source code
 
formatFlavor(flavor)
Formats a flavor and returns a string which parseFlavor can handle.
source code
 
parseFlavor(s, mergeBase=None, raiseError=False) source code
 
parseDep(s)
Parses dependency strings (not flavors) of the format (<depClass>: dep[(flags)])* and returns a dependency set containing those dependencies.
source code
 
flavorDifferences(flavors, strict=True)
Takes a set of flavors, returns a dict of flavors such that the value of a flavor's dict entry is a flavor that includes only the information that differentiates that flavor from others in the set
source code
 
compatibleFlavors(flavor1, flavor2)
Return True if flavor1 does not have any flavor that switches polarity from ~foo to ~!foo, or foo to !foo, and flavor1 does not have any architectures not in flavor2 and vice versa.
source code
 
getMinimalFlagChanges(dep, depToMatch) source code
 
getMinimalCompatibleChanges(flavor, flavorToMatch, keepArch=False) source code
 
getUseFlags(flavor) source code
 
getMajorArch(flavor) source code
 
getShortFlavorDescriptors(flavors) source code
Variables [hide private]
  DEP_CLASS_ABI = 0
  DEP_CLASS_IS = 1
  DEP_CLASS_OLD_SONAME = 2
  DEP_CLASS_FILES = 3
  DEP_CLASS_TROVES = 4
  DEP_CLASS_USE = 5
  DEP_CLASS_SONAME = 6
  DEP_CLASS_USERINFO = 7
  DEP_CLASS_GROUPINFO = 8
  DEP_CLASS_CIL = 9
  DEP_CLASS_JAVA = 10
  DEP_CLASS_PYTHON = 11
  DEP_CLASS_PERL = 12
  DEP_CLASS_RUBY = 13
  DEP_CLASS_PHP = 14
  DEP_CLASS_TARGET_IS = 15
  DEP_CLASS_SENTINEL = 16
  DEP_CLASS_NO_FLAGS = 0
  DEP_CLASS_HAS_FLAGS = 1
  DEP_CLASS_OPT_FLAGS = 2
  FLAG_SENSE_UNSPECIFIED = 0
  FLAG_SENSE_REQUIRED = 1
  FLAG_SENSE_PREFERRED = 2
  FLAG_SENSE_PREFERNOT = 3
  FLAG_SENSE_DISALLOWED = 4
  DEP_MERGE_TYPE_NORMAL = 1
  DEP_MERGE_TYPE_OVERRIDE = 2
  DEP_MERGE_TYPE_PREFS = 3
  DEP_MERGE_TYPE_DROP_CONFLICTS = 4
  senseMap = {1: '', 2: '~', 3: '~!', 4: '!'}
  toStrongMap = {1: 1, 2: 1, 3: 4, 4: 4}
  toWeakMap = {1: 2, 2: 2, 3: 3, 4: 3}
  strongSenses = set([1, 4])
  senseReverseMap = {'': 1, '!': 4, '~': 2, '~!': 3}
  dependencyClasses = {0: <class 'conary.deps.deps.AbiDependency...
  dependencyClassesByName = {'CIL': <class 'conary.deps.deps.CIL...
  dependencyCache = {}
  archFlags = '\\(( *FLAG(?: *, *FLAG)*)\\)'
  archGroup = '(?:ARCHCLAUSE(?:((?: *ARCHCLAUSE)*))?)'
  flavorRegexp = re.compile(r'^(use:)? *(?:((?:!|~!)?(?:~?!?(?:[...
  archGroupRegexp = re.compile(r'(?: *(?:((?:[0-9A-Za-z_-]+))(?:...
  depRegexp = re.compile(r'((?:[0-9A-Za-z_-]+)): *((?:[^ \(]+) *...
  flavorScores = {(0, 1): None, (0, 2): -1, (0, 3): 1, (0, 4): 0...
  key = 4
  val = '!'
Function Details [hide private]

ThawFlavor(frz)

source code 
PUBLIC API
Parameters:
  • frz - the frozen representation of a flavor
Returns: deps.deps.Flavor
a thawed Flavor object
Decorators:
  • @api.publicApi
Raises:
  • TypeError - could be raised if frozen object is malformed
  • ValueError - could be raised if frozen object is malformed

overrideFlavor(oldFlavor, newFlavor, mergeType=2)

source code 
Performs overrides of flavors as expected when the new flavor is specified by a user -- the user's flavor overrides use flags, and if the user specifies any instruction sets, only those instruction sets will be in the final flavor. Flags for the specified instruction sets are merged with the old flavor.

_mergeDeps(depList, mergeType)

source code 
Returns a new Dependency which merges the flags from the two existing dependencies. We don't want to merge in place as this Dependency could be shared between many objects (via a DependencyGroup).

mergeFlavor(flavor, mergeBase)

source code 
Merges the given flavor with the mergeBase - if flavor doesn't contain use flags, then include the mergeBase's use flags. If flavor doesn't contain an instruction set, then include the mergeBase's instruction set(s)

parseDep(s)

source code 
Parses dependency strings (not flavors) of the format (<depClass>: dep[(flags)])* and returns a dependency set containing those dependencies. Raises ParseError if the parsing fails.

flavorDifferences(flavors, strict=True)

source code 
Takes a set of flavors, returns a dict of flavors such that the value of a flavor's dict entry is a flavor that includes only the information that differentiates that flavor from others in the set
Parameters:
  • strict - if False, ignore differences between flags where the difference is in strength of the flag, but not in direction, e.g. ignore ~foo vs. foo, but not ~foo vs. ~!foo.

Variables Details [hide private]

dependencyClasses

Value:
{0: <class 'conary.deps.deps.AbiDependency'>,
 1: <class 'conary.deps.deps.InstructionSetDependency'>,
 2: <class 'conary.deps.deps.OldSonameDependencies'>,
 3: <class 'conary.deps.deps.FileDependencies'>,
 4: <class 'conary.deps.deps.TroveDependencies'>,
 5: <class 'conary.deps.deps.UseDependency'>,
 6: <class 'conary.deps.deps.SonameDependencies'>,
 7: <class 'conary.deps.deps.UserInfoDependencies'>,
...

dependencyClassesByName

Value:
{'CIL': <class 'conary.deps.deps.CILDependencies'>,
 'abi': <class 'conary.deps.deps.AbiDependency'>,
 'file': <class 'conary.deps.deps.FileDependencies'>,
 'groupinfo': <class 'conary.deps.deps.GroupInfoDependencies'>,
 'is': <class 'conary.deps.deps.InstructionSetDependency'>,
 'java': <class 'conary.deps.deps.JavaDependencies'>,
 'oldsoname': <class 'conary.deps.deps.OldSonameDependencies'>,
 'perl': <class 'conary.deps.deps.PerlDependencies'>,
...

flavorRegexp

Value:
re.compile(r'^(use:)? *(?:((?:!|~!)?(?:~?!?(?:[0-9A-Za-z_-]+))(?:\.(?:\
[0-9A-Za-z_-]+))? *(?:, *(?:!|~!)?(?:~?!?(?:[0-9A-Za-z_-]+))(?:\.(?:[0\
-9A-Za-z_-]+))?)*)?)? *(?:(is:) *(?: *(?:((?:[0-9A-Za-z_-]+))(?:\(( *(\
?:~?!?(?:[0-9A-Za-z_-]+))(?: *, *(?:~?!?(?:[0-9A-Za-z_-]+)))*)\))?)?(?\
:((?:  * *(?:((?:[0-9A-Za-z_-]+))(?:\(( *(?:~?!?(?:[0-9A-Za-z_-]+))(?:\
 *, *(?:~?!?(?:[0-9A-Za-z_-]+)))*)\))?)?)*))?))? *(?:(target:) *(?: *(\
?:((?:[0-9A-Za-z_-]+))(?:\(( *(?:~?!?(?:[0-9A-Za-z_-]+))(?: *, *(?:~?!\
?(?:[0-9A-Za-z_-]+)))*)\))?)?(?:((?:  * *(?:((?:[0-9A-Za-z_-]+))(?:\((\
...

archGroupRegexp

Value:
re.compile(r'(?: *(?:((?:[0-9A-Za-z_-]+))(?:\(( *(?:~?!?(?:[0-9A-Za-z_\
-]+))(?: *, *(?:~?!?(?:[0-9A-Za-z_-]+)))*)\))?)?(?:((?:  * *(?:((?:[0-\
9A-Za-z_-]+))(?:\(( *(?:~?!?(?:[0-9A-Za-z_-]+))(?: *, *(?:~?!?(?:[0-9A\
-Za-z_-]+)))*)\))?)?)*))?)')

depRegexp

Value:
re.compile(r'((?:[0-9A-Za-z_-]+)): *((?:[^ \(]+) *(?:\([^\)]*\))? *) *\
')

flavorScores

Value:
{(0, 1): None,
 (0, 2): -1,
 (0, 3): 1,
 (0, 4): 0,
 (1, 1): 2,
 (1, 2): 1,
 (1, 3): None,
 (1, 4): None,
...