[haiku-development] Re: Q: src/data/package_infos, to use or not use '%'

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 01 Dec 2013 20:28:06 +0100

On 12/01/2013 08:00 PM, Matt Madia wrote:
It was pointed out that some package_infos use HAIKU_PACKAGING_ARCH%
and others HAIKU_PACKAGING_ARCH.

e.g.,
http://cgit.haiku-os.org/haiku/tree/src/data/package_infos/generic/haiku_loader
http://cgit.haiku-os.org/haiku/tree/src/data/package_infos/generic/webpositive

Is there any particular reason to use or not to use the % characters?

The package info files are filtered through sed to replace the "%...%" placeholders and afterwards through the C preprocessor. The latter replaces the macros HAIKU_PACKAGING_ARCH and HAIKU_SECONDARY_PACKAGING_ARCH. We originally used only the CPP, but combining a macro value (usually HAIKU_SECONDARY_PACKAGING_ARCH) with some other string is rather inconvenient, while it is simple with sed. We still use the CPP for "#ifndef HAIKU_BOOTSTRAP_BUILD ... #endif" blocks, which in turn aren't easy to handle with sed.

So, long story short, ATM both %HAIKU_PACKAGING_ARCH% and HAIKU_PACKAGING_ARCH are OK to use where not concatenated with other strings. I'd like to think we'll eventually come up with an alternative for the conditional blocks and replace/stop using CPP, which would make the "%...%" variants more future proof. But we'll go through and adjust all the package infos in that case anyway.

CU, Ingo


Other related posts: