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

Class ExcludeDirectories

source code

  action.Action --+            
                  |            
action.RecipeAction --+        
                      |        
      policy.BasePolicy --+    
                          |    
              policy.Policy --+
                              |
                             ExcludeDirectories
Known Subclasses:
infopolicy.ExcludeDirectories

NAME

r.ExcludeDirectories() - Exclude directories from package

SYNOPSIS

r.ExcludeDirectories([filterexp] | [exceptions=filterexp])

DESCRIPTION

The r.ExcludeDirectories policy causes directories to be excluded from the package by default. Use r.ExcludeDirectories(exceptions=filterexp) to set exceptions to this policy, which will cause directories matching the regular expression filterexp to be included in the package. Remember that Conary packages cannot share files, including directories, so only one package installed on a system at any one time can own the same directory.

There are only three reasons to explicitly package a directory: the directory needs permissions other than 0755, it needs non-root owner or group, or it must exist even if it is empty.

Therefore, it should generally not be necessary to invoke this policy directly. If your directory requires permissions other than 0755, simply use r.SetMode to specify the permissions, and the directory will be automatically included. Similarly, if you wish to include an empty directory with owner or group information, call r.Ownership on that empty directory,

Because r.Ownership can reasonably be called on an entire subdirectory tree and indiscriminately applied to files and directories alike, non-empty directories with owner or group set will be excluded from packaging unless an exception is explicitly provided.

If you call r.Ownership with a filter that applies to an empty directory, but you do not want to package that directory, you will have to remove the directory with r.Remove.

Packages do not need to explicitly include directories to ensure existence of a target to place a file in. Conary will appropriately create the directory, and delete it later if the directory becomes empty.

EXAMPLES

r.ExcludeDirectories(exceptions='/tftpboot')

Sets the directory /tftboot as an exception to the r.ExcludeDirectories policy, so that the /tftpboot directory will be included in the package.

Instance Methods [hide private]
 
doFile(self, path) 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, updateArgs, 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]
  bucket = 8
  processUnmodified = True
allows special handling for derived packages in order to make only appropriate changes in the derived package.
  requires = (('PackageSpec', 7), ('Ownership', 7), ('MakeDevice...
  invariantinclusions = [('.*', 16384)]
if invariantinclusions is not empty, then only files matching a filter in it are considered to be passed to to the doFile method.

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

Inherited from policy.BasePolicy: allowUnusedFilters

Class Variable Details [hide private]

requires

Value:
(('PackageSpec', 7), ('Ownership', 7), ('MakeDevices', 6))