Environment variables used by wpkg
The wpkg tool, as well as the libdebpackages library make use of different environment variables. These are defined below:
Variable | Get From | Operating System | Comments |
---|---|---|---|
COMSPEC | Library and wpkg | Windows | The COMSPEC variable is used under MS-Windows when a batch script needs to be run. The variable must be set to a valid value or the execution of any external batch script will fail. |
HOME | Library | All |
The HOME variable is used to replace the ~ character in a path. Note that the library has no concept of users so the Unix ~<username>/... syntax is not currently supported. |
PROCESSOR_ARCHITECTURE | Library | Windows |
The library checks this variable under MS-Windows in an attempt to determine the processor in use. The value may easily be tainted. IMPORTANT NOTE
|
PROCESSOR_ARCHITEW6432 | Library | Windows |
The library checks this variable under MS-Windows in an attempt to determine the processor in use. The value may easily be tainted. IMPORTANT NOTE
|
PROCESSOR_IDENTIFIER | Library | Windows |
The library checks this variable under MS-Windows in an attempt to determine the processor in use. The value may easily be tainted. IMPORTANT NOTE
|
WPKG_OPTIONS | wpkg | All |
This WPKG_OPTIONS variable is used to hold command line options so one does not have to always specify those options on the command line. For example, the --root option could be defined that way to avoid having to redifine it each time you use wpkg. The syntax is the same as on the command. For example:
WPKG_OPTIONS="--root /tmp/dist" See also the wpkg configuration file. |
WPKG_SUBST | Library | All |
The library offers a way to substitute a directory path by a drive letter, just like you do with the subst command line option at a DOS prompt. The variable can include as many definition as you need. The syntax is as follow:
<drive letter>=<path to root>[|<current directory>]:... The drive letter followed by an equal (=) and the path to the root directory of that drive. Optionally, add a current directory after a pipe (|) character. Separate multiple definitions by the colon (:) character. Obviously the path filenames cannot include illegal characters. There is an example of drive C: and D: definitions: export subst="C=/home/wpkg/c_drive|development;D=/mnt/windows-box|dev/mingw"Note that these definitions work under MS-Windows as well. You want to be very careful to not redefine an existing drive (although everything works either way, it may create some unexpected side effects.) |
In most environment the set command used by itself will show you the current value of all the environment variables:
set
To set a variable, use the set or setenv command if necessary. You may also have to export the value. Under Linux you write:
export WPKG_OPTIONS=--verbose
The export command forces the variable to be visible in all the commands and scripts started after that point.
To print out the value of a variable, use the dollar ($) [Unix shells] or the percent (%) [MS-Windows DOS] characters:
echo $HOME eccho %COMSPEC%
Notice that the % surrounds the variable name.