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

Class InitialContents

source code

  action.Action --+            
                  |            
action.RecipeAction --+        
                      |        
      policy.BasePolicy --+    
                          |    
              policy.Policy --+
                              |
                             InitialContents

NAME

r.InitialContents() - Mark only explicit inclusions as initial contents files

SYNOPSIS

InitialContents([filterexp])

DESCRIPTION

By default, r.InitialContents() does not apply to any files. It is used to specify all files that Conary needs to mark as providing only initial contents. When Conary installs or updates one of these files, it will never replace existing contents; it uses the provided contents only if the file does not yet exist at the time Conary is creating it.

A file marked as an InitialContents file cannot also be marked as a Transient file or a Config file. Conary enforces this requirement.

EXAMPLES

r.InitialContents('%(sysconfdir)s/conary/.*gpg')

The files %(sysconfdir)s/conary/.*gpg are being marked as initial contents files. Conary will use those contents when creating the files the first time, but will never overwrite existing contents in those files.

Instance Methods [hide private]
 
updateArgs(self, *args, **keywords)
The default way to update a class is to override any provided keywords.
source code
 
doFile(self, filename) source code

Inherited from policy.Policy: __init__, compileFilters, do, doProcess, 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 = (('PackageSpec', 7), ('Config', 7))
  bucket = 8
  processUnmodified = True
allows special handling for derived packages in order to make only appropriate changes in the derived package.
  keywords = {'exceptions': None, 'inclusions': [], 'subtrees': ...
  invariantexceptions = ['%(userinfodir)s/', '%(groupinfodir)s']
subclasses may set to a list of exception filters that are always applied regardless of what other exceptions may be provided by the recipe; these exceptions being applied is an invariant condition of the doFile method.

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

Inherited from policy.BasePolicy: allowUnusedFilters

Method Details [hide private]

updateArgs(self, *args, **keywords)

source code 

The default way to update a class is to override any provided keywords. Subclasses which have the ability to provide more intelligent handling can override this method. This method is invoked automatically by recipe.py when a recipe references a policy object. It acts rather like __init__ except that it can meaningfully be called more than once for an object.

Some keyword arguments (at least exceptions and subtrees) should be appended rather than replaced.
Overrides: policy.BasePolicy.updateArgs
(inherited documentation)

Class Variable Details [hide private]

keywords

Value:
{'exceptions': None, 'inclusions': [], 'subtrees': None, 'use': None}