Makefiles that call $(shell onlpm --find-file *) have always failed poorly
when the file cannot be found.
The onlp_find_file template can be called to both assign and check the
results. If an error occurred in getting the value then a Makefile error is raised.
Specifying useful package fields has been historically pretty lazy since most systems have been built as self-contained images without dynamic package updates.
This commit hopes to improve the situation.
The recommended package organization for ONL and for systems built with ONL as the base follow the pattern of $project/packages/base/$arch/* and $project/packages/platforms/$vendor/$arch/
The heirarchy of directories in which the packages reside also provide a natural inheritence heirarchy for debian package fields.
This property is now exploited to allow default package keys to be specified base on their location in the filesystem heirarchy as follows:
Before a PKG.yml file is evaluated its parent directory heirarchy is traversed looking for either or both of these files:
PKG_DEFAULTS.yml -- This is an onlyaml file which can specify the values of package keys.
PKG_DEFAULTS -- If this file is executable it is expected to output valid yaml containing package keys.
All of these values are then combined in reverse order to provide a default dict for the package.
Example usages:
- Fields global to all packages in the project (like Vendor, Maintainer, Version [for coherent builds], maintainer, etc) can be specified in the top-most PKG_DEFAULTS.
- Archicture can be specified in the $arch/PKG_DEFAULTS.
- Platform Vendors can specify their information at the top of their platform directory.
By specifying your own PKG_DEFAULTS you can coexist the ONL versions and your own version without ineheriting any of the defaults from ONL itself.
These are only the defaults for keys not specified in the PKG file. You can still obviously override every field in each package declaration.
The ONL package files will be updated in a separate commit to use this new hierarchical approach.
Package version numbers, copyrights, and general information fields have all