/[gentoo]/xml/htdocs/proj/en/glep/glep-0047.txt
Gentoo

Diff of /xml/htdocs/proj/en/glep/glep-0047.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.4
1GLEP: 47 1GLEP: 47
2Title: Creating 'safe' environment variables 2Title: Creating 'safe' environment variables
3Version: $Revision: 1.2 $ 3Version: $Revision: 1.4 $
4Last-Modified: $Date: 2006/02/11 21:43:14 $ 4Last-Modified: $Date: 2006/02/13 21:00:50 $
5Author: Diego Pettenò, Fabian Groffen 5Author: Diego Pettenò, Fabian Groffen
6Status: Draft 6Status: Draft
7Type: Standards Track 7Type: Standards Track
8Content-Type: text/x-rst 8Content-Type: text/x-rst
9Created: 14-Oct-2005 9Created: 14-Oct-2005
91the current situation in the tree, it is considered to be a big 91the current situation in the tree, it is considered to be a big
92advantage over the 4-tuple keyword from GLEP 22. This GLEP is an 92advantage over the 4-tuple keyword from GLEP 22. This GLEP is an
93official specification of the syntax of the keyword. 93official specification of the syntax of the keyword.
94 94
95Keywords will consist out of two parts separated by a hyphen ('-'). The 95Keywords will consist out of two parts separated by a hyphen ('-'). The
96left hand part of the keyword 2-tuple is the architecture, such as 96part up to the first hyphen from the left of the keyword 2-tuple is the
97ppc64, sparc and x86. The right hand part indicates the operating 97architecture, such as ppc64, sparc and x86. Allowed characters for the
98architecture name are in ``a-z0-9``. The remaining part on the right of
99the first hyphen from the left indicates the operating system or
98system or distribution, such as linux, macos, darwin, obsd, etc. If the 100distribution, such as linux, macos, darwin, obsd, et-cetera. If the
99right hand part is omitted, it implies the operating system/distribution 101right hand part is omitted, it implies the operating system/distribution
100type is Gentoo GNU/Linux. In such case the hyphen is also omitted. 102type is Gentoo GNU/Linux. In such case the hyphen is also omitted, and
101Examples of such keywords are ppc-darwin and x86. This is fully 103the keyword consists of solely the architecture. The operating system
102compatible with the current use of keywords in the tree. 104or distribution name can consist out of characters in ``a-zA-Z0-9_+:-``.
105Please note that the hyphen is an allowed character, and therefore the
106separation of the two fields in the keyword is only determinable by
107scanning for the first hyphen character from the start of the keyword
108string. Examples of keywords following this specification are
109ppc-darwin and x86. This is fully compatible with the current use of
110keywords in the tree.
103 111
104The variables ``ELIBC``, ``KERNEL`` and ``ARCH`` are currently set in 112The variables ``ELIBC``, ``KERNEL`` and ``ARCH`` are currently set in
105the profiles when other than their defaults for a GNU/Linux system. 113the profiles when other than their defaults for a GNU/Linux system.
106They can as such easily be overridden and defined by the user. To 114They can as such easily be overridden and defined by the user. To
107prevent this from happening, the variables should be auto filled by 115prevent this from happening, the variables should be auto filled by
162 *-*-darwin* -> KERNEL="Darwin" ELIBC="Darwin" 170 *-*-darwin* -> KERNEL="Darwin" ELIBC="Darwin"
163 *-*-netbsd* -> KERNEL="NetBSD" ELIBC="NetBSD" 171 *-*-netbsd* -> KERNEL="NetBSD" ELIBC="NetBSD"
164 *-*-solaris* -> KERNEL="Solaris" ELIBC="Solaris" 172 *-*-solaris* -> KERNEL="Solaris" ELIBC="Solaris"
165 173
166A way to achieve this is proposed by Mike Frysinger, which 174A way to achieve this is proposed by Mike Frysinger, which
167suggests to have a env-map file, for instance filled with:: 175suggests to have an env-map file, for instance filled with::
168 176
169 % cat env-map 177 % cat env-map
170 *-linux-* KERNEL=linux 178 *-linux-* KERNEL=linux
171 *-gnu ELIBC=glibc 179 *-gnu ELIBC=glibc
172 x86_64-* ARCH=amd64 180 x86_64-* ARCH=amd64

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20