1 # ############################################################################
2 # Helper functions for building packages from the trunk or branches. To use
3 # this .bbclass simply inherit from it in your conf/local.conf.
5 # - get_branch() helps to construct the package name when fetching by
6 # extracting the directory name above the "build" directory containing the
7 # oe environment and bitbake. That directory name is usually the branch in
8 # which the package is located in the svn with one exception: "unstable"
9 # is synonymous for "trunk". In the package you can then use the ${BRANCH}
10 # variable within the svn (or cvs) url for the package.
12 # - get_tomorrow() makes sure the latest version of a package is fetched. To
13 # use it, set the SRCDATE to ${TOMORROW}.
14 # ############################################################################
18 build = re.sub(r'/sources$', '', commands.getoutput('pwd'))
19 build = re.sub(r'/tmp/work.*$', '', build)
20 build = re.sub(r'/packages\.4g.*$', '', build)
21 if re.search(r'/trunk/[^/]+/?$', build):
23 if re.search(r'/unstable$', build):
25 if re.search(r'/testing$', build):
27 return re.sub(r'^.*/([^/]+/[^/]+)/[^/]+/?$', r'\1', build)
33 return time.strftime('%Y%m%d', time.gmtime(time.time() + 3600*24))