parse_db.pm, in extended mode parse(): add ALIAS to record data. create_record(): print also alias data.
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/lib/perl/parse_db.pm new-bii_scripts/lib/perl/parse_db.pm
--- old-bii_scripts/lib/perl/parse_db.pm 2022-09-28 11:46:55.539783566 +0200
+++ new-bii_scripts/lib/perl/parse_db.pm 2022-09-28 11:46:55.539783566 +0200
@@ -211,7 +211,8 @@
my $r_this_record;
my $r_this_record_fields;
my $r_this_record_info;
-
+ my $r_this_record_alias;
+
my $_treat_double_records= $treat_double_records;
$_mode= $_modes{$mode};
@@ -264,12 +265,14 @@
$r_this_record_fields= {};
$r_this_record_info= {};
+ $r_this_record_alias= [];
$r_this_record= { TYPE => $type,
FIELDS => $r_this_record_fields
};
if ($_mode eq 'extended')
{
$r_this_record->{INFO}= $r_this_record_info;
+ $r_this_record->{ALIAS}= $r_this_record_alias;
};
if (exists $records{$this_record_name})
{ if ($_treat_double_records==0)
@@ -321,6 +324,7 @@
{
my $alias_name= (_empty($2)) ? $1 : $2;
$record_alias_hash{$alias_name}= $this_record_name;
+ push @{$r_this_record->{'ALIAS'}}, $alias_name if ($_mode eq 'extended');
next;
};
@@ -450,12 +454,17 @@
{ my($recname, $r_hash)= @_;
my $r_fields= $r_hash->{FIELDS};
my $r_infos= $r_hash->{INFO};
+ my $r_alias= $r_hash->{ALIAS};
print "record(",$r_hash->{TYPE},",\"$recname\") {\n";
foreach my $f (sort keys %$r_infos)
{
print "\tinfo(",$f,",\"",$r_infos->{$f},"\")\n";
};
+ foreach my $f (sort @$r_alias)
+ {
+ print "\talias(\"",$f,"\")\n";
+ };
foreach my $f (sort keys %$r_fields)
{
print "\tfield(",$f,",\"",$r_fields->{$f},"\")\n";
patch 1c0fca271bb2060a4792a89a20b60da662cdec36
Author: Bernhard.Kuner@bessy.de
Date: Fri Oct 29 12:31:07 CEST 2021
* parse_db.pm, in extended mode parse(): add ALIAS to record data. create_record(): print also alias data