Embedix::ECD 0.09 review

Download
by rbytes.net on

Embedix::ECD is a Perl module with Embedix Component Descriptions as objects. SYNOPSIS instantiate from a file my $ecd

License: Perl Artistic License
File size: 40K
Developer: John BEPPU
0 stars award from rbytes.net

Embedix::ECD is a Perl module with Embedix Component Descriptions as objects.

SYNOPSIS

instantiate from a file
my $ecd = Embedix::ECD->newFromFile('busybox.ecd');
my $other_ecd = Embedix::ECD->newFromFile('tinylogin.ecd');
access nodes
my $busybox = $ecd->System->Utilities->busybox;
build from scratch
my $server = Embedix::ECD::Group->new(name => 'Server');
my $www = Embedix::ECD::Group->new(name => 'WWW');
my $apache = Embedix::ECD::Component->new (
name => 'apache',
srpm => 'apache',
prompt => 'Include apache web server?',
help => 'The most popular http server on the internet',
);
$ecd->addChild($server);
$ecd->Server->addChild($www);
$ecd->Server->WWW->addChild($apache);
get/set attributes
my $srpm = $busybox->srpm();

$busybox->help('i am busybox of borg -- unix will be assimilated.');

$busybox->requires([
'libc.so.6',
'ld-linux.so.2',
'skellinux',
]);
combine Embedix::ECD objects together
$ecd->mergeWith($other_ecd);
print as text
print $ecd->toString;
print as XML
use Embedix::ECD::XMLv1 qw(xml_from_cons);

print $ecd->toXML(shiftwidth => 4, dtd => 'yes');

my $cons = Embedix::ECD->consFromFile('minicom.ecd');
print xml_from_cons($cons);

Embedix::ECD allows one to represent ECD files as a tree of perl objects. One can construct objects by parsing an ECD file, or one can build an ECD object from scratch by combining instances of Embedix::ECD and its subclasses. These objects can then be turned back into ECD files via the toString() method.

ECD stands for Embedix Component Description, and its purpose is to contain meta-data regarding packages (aka components) in the Embedix distribution. ECD files contain much of the same data a .spec file does for an RPM. A major difference however is that ECD files do not contain building instructions whereas .spec files do. Another major difference between .spec files and ECD files is the structure. ECD files are hierarchically structured whereas .spec files are comparatively flat.

The ECD format reminds me of the syntax for Apache configuration files. Items are tag-delimited (like in XML) and attributes are found between these tags. Comments are written by prefixing them with /^s*#/. Unlike apache configurations, attribute names and values are separated by an "=" sign, whereas in apache the first token is the attribute name and everything after that (sans leading whitespace) and up to the end of the line is the attribute's value. Also, unlike apache configurations, attributes may also be enclosed in tags, whereas in apache tags are used only to describe nodes.

ECD files look like pseudo-XML with shell-styled comments.

Requirements:
Perl

Embedix::ECD 0.09 search tags