Package conary :: Package build :: Module packagepolicy :: Class ComponentSpec
[hide private]
[frames] | no frames]

Class ComponentSpec

source code

  action.Action --+                
                  |                
action.RecipeAction --+            
                      |            
      policy.BasePolicy --+        
                          |        
              policy.Policy --+    
                              |    
                    _filterSpec --+
                                  |
                                 ComponentSpec
Known Subclasses:
derivedpolicy.ComponentSpec, infopolicy.ComponentSpec

NAME

r.ComponentSpec() - Determines which component each file is in

SYNOPSIS

r.ComponentSpec([componentname, filterexp] || [packagename:componentname, filterexp])

DESCRIPTION

The r.ComponentSpec policy includes the filter expressions that specify the default assignment of files to components. The expressions are considered in the order in which they are evaluated in the recipe, and the first match wins. After all the recipe-provided expressions are evaluated, the default expressions are evaluated. If no expression matches, then the file is assigned to the catchall component. Note that in the packagename:componentname form, the : must be literal, it cannot be part of a macro.

KEYWORDS

catchall : Specify the component name which gets all otherwise unassigned files. Default: runtime

EXAMPLES

r.ComponentSpec('manual', '%(contentdir)s/manual/')

Uses r.ComponentSpec to specify that all files below the %(contentdir)s/manual/ directory are part of the :manual component.

r.ComponentSpec('foo:bar', '%(sharedir)s/foo/')

Uses r.ComponentSpec to specify that all files below the %(sharedir)s/foo/ directory are part of the :bar component of the foo package, avoiding the need to invoke both the ComponentSpec and PackageSpec policies.

r.ComponentSpec(catchall='data')

Uses r.ComponentSpec to specify that all files not otherwise specified go into the :data component instead of the default {:runtime} component.

Instance Methods [hide private]
 
__init__(self, *args, **keywords) source code
 
updateArgs(self, *args, **keywords)
Call derived classes (ComponentSpec or PackageSpec) as:
source code
None
doProcess(self, recipe)
Invocation instance
source code
 
loadFilterDirs(self) source code
 
loadFilter(self, filterType, map, filename, fullpath) source code

Inherited from policy.Policy: compileFilters, do, filterExpArgs, filterExpression, mtimeChanged, policyException, policyInclusion, walkDir

Inherited from policy.BasePolicy: dbg, error, info, postInit, postPolicy, warn

Inherited from policy.BasePolicy (private): _addClassName, _pathAllowed

Inherited from action.RecipeAction: doAction, doPrep, doSuggestAutoBuildReqs, init_error

Inherited from action.Action: addArgs

Inherited from action.Action (private): _applyDefaults

Class Variables [hide private]
  requires = (('Config', 7), ('PackageSpec', 3))
  keywords = {'catchall': 'runtime'}

Inherited from _filterSpec: bucket, processUnmodified

Inherited from policy.Policy: filetree, invariantexceptions, invariantinclusions, invariantsubtrees, recursive, rootdir

Inherited from policy.BasePolicy: allowUnusedFilters

Method Details [hide private]

__init__(self, *args, **keywords)
(Constructor)

source code 
Parameters:
  • catchall - The component name which gets all otherwise unassigned files. Default: runtime
Overrides: _filterSpec.__init__

updateArgs(self, *args, **keywords)

source code 
Call derived classes (ComponentSpec or PackageSpec) as:
   ThisClass('<name>', 'filterexp1', 'filterexp2')
where filterexp is either a regular expression or a tuple of (regexp[, setmodes[, unsetmodes]])
Overrides: _filterSpec.updateArgs
(inherited documentation)

doProcess(self, recipe)

source code 
Invocation instance
Returns: None
None
Overrides: policy.Policy.doProcess
(inherited documentation)