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

Class Run

source code

  action.Action --+            
                  |            
action.RecipeAction --+        
                      |        
            BuildAction --+    
                          |    
  action.Action --+       |    
                  |       |    
action.RecipeAction --+   |    
                      |   |    
    action.ShellCommand --+    
                          |    
               BuildCommand --+
                              |
                             Run

NAME

r.Run() - Run a shell command

SYNOPSIS

r.Run(cmd, [dir,] [filewrap,] [wrapdir])

DESCRIPTION

The r.Run() class is called from within a Conary recipe to run a shell command with simple macro substitution.

KEYWORDS

The r.Run() class accepts the following keywords, with default values shown in parentheses when applicable:

dir : (None) Directory in which to run the command. Relative dirs are relative to the build directory, and absolute dirs are relative to the destination directory.

filewrap : (False) If set to True, a LD_PRELOAD wrapper will look in %(destdir)s for some common file operations. Occasionally useful to avoid the need to modify programs that need to be run after the build, and assume that they are not run until after installation.

wrapdir : (None) If set, points to a directory. Similar to filewrap, except it limits the %(destdir)s substitution to only the tree under the given directory.

package : (None) If set, must be a string that specifies the package (package='packagename'), component (package=':componentname'), or package and component (package='packagename:componentname') in which to place the files added while executing this command. Previously-specified PackageSpec or ComponentSpec lines will override the package specification, since all package and component specifications are considered in strict order as provided by the recipe.

EXAMPLES

r.Run('find %(destdir)s -name "floppyd*" -print | xargs rm')

Locate instances of the filespec floppyd* in the %(destdir)s, and remove them.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
None
do(self, macros)
Method which is used if the ShellCommand instance is invoked during build
source code

Inherited from BuildAction: doAction, initManifest, missingFiles

Inherited from action.RecipeAction: doPrep, doSuggestAutoBuildReqs, init_error

Inherited from action.Action: addArgs

Inherited from action.Action (private): _applyDefaults

Class Variables [hide private]
  keywords = {'dir': '', 'filewrap': False, 'wrapdir': None}
The keywords and default values accepted by the class
  template = '%%(envcmd)s%%(cdcmd)s%(args)s'
The string template used to build the shell command.

Inherited from BuildAction: useExplicitManifest

Instance Variables [hide private]

Inherited from action.ShellCommand: self.command

Method Details [hide private]

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

source code 
Parameters:
  • dir - Directory in which to run the command An absolute dir value will be considered relative to %(destdir)s, whereas a relative dir value will be considered relative to %(builddir)s.
  • filewrap - If set to True, a LD_PRELOAD wrapper will look in %(destdir)s for some common file operations. Occasionally useful to avoid the need to modify programs that need to be run after the build, and assume that they are not run until after installation.
  • wrapdir - If set, points to a directory. Similar to filewrap, except it limits the %(destdir)s substitution to only the tree under the given directory.
Overrides: BuildCommand.__init__

do(self, macros)

source code 
Method which is used if the ShellCommand instance is invoked during build
Returns: None
None
Overrides: BuildCommand.do
(inherited documentation)