From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from astoria.ccjclearline.com (astoria.ccjclearline.com [64.235.106.9]) by mail.openembedded.org (Postfix) with ESMTP id D241460424 for ; Wed, 9 Jul 2014 12:04:05 +0000 (UTC) Received: from [69.196.158.250] (port=44733 helo=crashcourse.ca) by astoria.ccjclearline.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80) (envelope-from ) id 1X4qbW-0004PL-89 for bitbake-devel@lists.openembedded.org; Wed, 09 Jul 2014 08:04:06 -0400 Date: Wed, 9 Jul 2014 08:03:58 -0400 (EDT) From: "Robert P. J. Day" X-X-Sender: rpjday@localhost To: BitBake developer list Message-ID: User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - astoria.ccjclearline.com X-AntiAbuse: Original Domain - lists.openembedded.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - crashcourse.ca X-Source: X-Source-Args: X-Source-Dir: Subject: [PATCH] Documentation: Add examples to User Manual, Metadata chapter X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jul 2014 12:04:12 -0000 Content-Type: TEXT/PLAIN; charset=US-ASCII Signed-off-by: Robert P. J. Day --- as long as i've understood everything correctly, this is just throwing in some physical examples of a couple concepts. diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml index a9f5072..423d9a4 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml @@ -285,6 +285,16 @@ The flags are immediately set to "abc" and "123", respectively. The a flag becomes "abc456". + + + Note that there is no need to pre-define variable flags; you + can simply start using them. One extremely common application + is to attach some brief documentation to a BitBake variable as + follows: + + CACHE[doc] = "The directory holding the cache of the metadata." + +
@@ -298,7 +308,19 @@ DATE = "${@time.strftime('%Y%m%d',time.gmtime())}" This example results in the DATE - variable becoming the current date. + variable being set to the current date. + + + + Probably the most common use of this feature is to extract + the value of variables from BitBake's internal data dictionary, + d. The following lines + select the values of, respectively, a package name and its + version number: + + PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[0] or 'defaultpkgname'}" + PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1] or '1.0'}" +
-- ======================================================================== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ========================================================================