[haiku-commits] Re: r40301 - in haiku/trunk: headers/os/package headers/private headers/private/package headers/private/package/hpkg src/add-ons/kernel/file_systems/packagefs ...

  • From: Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 28 Jan 2011 09:42:43 +0100

On 2011-01-28 at 09:18:32 [+0100], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
wrote:
> zooey@xxxxxxxxxxxxxxx wrote:
> > * implemented parser (mostly) for reading a BPackageInfo from a config
> >   file (.PackageInfo) in order to pass them on to the PackageWriter
> >   when creating a package
> 
> I haven't looked at the code, but using flattened BMessages is always an 
> option

Yeah, I'm using those all over the place in the package kit, but can't 
really, in this case: .PackageInfo is where the person building a package 
has to provide all the info required by the 'package' tool (and later by the 
package management). So, a text file seems best.

 - if you prefer clear text, the driver_settings come to mind; they 
> don't have a really nice C++ API (ie. C only), but are used throughout the 
> system for various things already (for example, the network configuration, 
> see src/server/net/Settings.cpp). Just as a hint to safe some work.

That is currently being used for the repository config files, as those are 
easy enough to be parsed as driver_settings. 
However, .PackageInfo requires multiline strings, too ('description'), so 
driver_settings wasn't quite fitting. Additionally, I wanted the parser to 
be as user-friendly as possible (with precise error messages, giving line 
and column numbers). In the end, writing that parser myself was the only 
option, maybe that will find it's way to the support kit at a later stage.

cheers,
        Oliver

Other related posts: