Shells


shell (command), shellDialogue (command)
shell and shellDialogue let you execute standard shell commands as part of a Pacman installation. In general, you should use Pacman syntax instead of shell commands whenever possible for several reasons: Several command line switches in -v help and -ask help relate to shell commands. An installer can, for instance, use -ask shell and Pacman will stop and ask permission before executing any of these shell commands. From the Pacman perspective, if a shell command returns no exit code, it is considered to have successfully executed. The shell atom sends sysout to a log file, so if you are executing a script that interacts with the installer, you should use shellDialogue.

shellOutputContains (command,text)
shellOutputContains executes the shell command command and requires that the output contains text.

shellOutputEQ (command,text), shellOutputLE (command,text), shellOutputLT (command,text), shellOutputGE (command,text), shellOutputG (command,text)
shellOutputEQ,LE,LT,GE,GT let's you compare the output of a shell command to a provided string. This is convenient for requiring versions of natively installed software. For example, if you want to require GNU Wget at least version 1.9, you can do
shellOutputGE('wget -v','GNU Wget 1.9')
this requires both that wget is available and that the start of the resulting output matches or exceeds the provided string.

uninstallShell (command)
uninstallShell let's you specify shell commands which are only executed when a package is uninstalled. This is typically useful for cleaning up the result of other shell commands.

setup (command)
setup let's you add commands directly to the setup.csh(sh) files generated by Pacman. Typically this is used when packages have scripts that need to be executed at user setup time. For example, if your package has two scripts mySetup.csh and mySetup.sh which should be sourced at setup time, you would do something like this
setup('cd $MYPACKAGE/util; source mySetup.SHELL')
where Pacman replaces the string "SHELL" by "sh" and "csh" in the setup.csh(sh) scripts.

Pacman Headquarters