pmcf 6.32.1 → 6.32.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/base.mjs +16 -2
- package/src/initialization-context.mjs +12 -0
- package/src/services/bind.mjs +31 -15
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -122,11 +122,23 @@ export class Base {
|
|
|
122
122
|
attribute.name
|
|
123
123
|
)) {
|
|
124
124
|
const present = collection.get(extending.name);
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
if (present) {
|
|
127
|
+
/*if (attribute.name === "services") {
|
|
128
|
+
console.log(
|
|
129
|
+
this.fullName,
|
|
130
|
+
present.fullName,
|
|
131
|
+
"<-",
|
|
132
|
+
extending.fullName
|
|
133
|
+
);
|
|
134
|
+
}*/
|
|
135
|
+
|
|
127
136
|
present.extends.add(extending);
|
|
128
137
|
present.materializeExtends();
|
|
129
138
|
} else {
|
|
139
|
+
/*if (attribute.name === "services") {
|
|
140
|
+
console.log(this.fullName, extending.fullName);
|
|
141
|
+
}*/
|
|
130
142
|
collection.set(extending.name, extending.forOwner(this));
|
|
131
143
|
}
|
|
132
144
|
}
|
|
@@ -180,7 +192,9 @@ export class Base {
|
|
|
180
192
|
*/
|
|
181
193
|
mapFromDirections(directions, property) {
|
|
182
194
|
return new AggregatedMap(
|
|
183
|
-
[...this.walkDirections(directions)]
|
|
195
|
+
[...this.walkDirections(directions)]
|
|
196
|
+
.map(node => node[property])
|
|
197
|
+
.filter(node => node !== undefined)
|
|
184
198
|
);
|
|
185
199
|
}
|
|
186
200
|
|
|
@@ -29,6 +29,12 @@ export class InitializationContext {
|
|
|
29
29
|
const resolved = this.named(value, node);
|
|
30
30
|
if (resolved) {
|
|
31
31
|
assign(attribute, object, resolved);
|
|
32
|
+
|
|
33
|
+
if (attribute.name === "extends") {
|
|
34
|
+
// TODO attribute action ?
|
|
35
|
+
object.materializeExtends();
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
continue nextOutstanding;
|
|
33
39
|
}
|
|
34
40
|
}
|
|
@@ -36,6 +42,12 @@ export class InitializationContext {
|
|
|
36
42
|
const resolved = object.expression(value);
|
|
37
43
|
if (resolved) {
|
|
38
44
|
assign(attribute, object, resolved);
|
|
45
|
+
|
|
46
|
+
if (attribute.name === "extends") {
|
|
47
|
+
// TODO attribute action ?
|
|
48
|
+
object.materializeExtends();
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
continue nextOutstanding;
|
|
40
52
|
}
|
|
41
53
|
|
package/src/services/bind.mjs
CHANGED
|
@@ -191,16 +191,7 @@ class bind_zone_config extends Base {
|
|
|
191
191
|
);
|
|
192
192
|
break;
|
|
193
193
|
case "secondary":
|
|
194
|
-
const primaries =
|
|
195
|
-
.map(e => e.endpoints())
|
|
196
|
-
.flat()
|
|
197
|
-
.filter(
|
|
198
|
-
e =>
|
|
199
|
-
e.networkAddress &&
|
|
200
|
-
addressType(e.networkAddress.address) !==
|
|
201
|
-
ADDRESS_TYPE_LOOPBACK
|
|
202
|
-
)
|
|
203
|
-
.map(e => e.networkAddress.address);
|
|
194
|
+
const primaries = endpointAddresses(this.service.primaries);
|
|
204
195
|
|
|
205
196
|
content.push(
|
|
206
197
|
...addressesStatement(" primaries", primaries, false, " ")
|
|
@@ -649,6 +640,29 @@ class bind_group extends bind_object {
|
|
|
649
640
|
}
|
|
650
641
|
}
|
|
651
642
|
|
|
643
|
+
function endpointAddresses(entries) {
|
|
644
|
+
if (entries === undefined) {
|
|
645
|
+
return [];
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/*
|
|
649
|
+
[...this.forwarders]
|
|
650
|
+
.map(e => e.endpoints())
|
|
651
|
+
.flat()
|
|
652
|
+
.filter(e => e.networkAddress)
|
|
653
|
+
.map(e => e.networkAddress?.address);
|
|
654
|
+
*/
|
|
655
|
+
return [...entries]
|
|
656
|
+
.map(e => e.endpoints())
|
|
657
|
+
.flat()
|
|
658
|
+
.filter(
|
|
659
|
+
e =>
|
|
660
|
+
e.networkAddress &&
|
|
661
|
+
addressType(e.networkAddress.address) !== ADDRESS_TYPE_LOOPBACK
|
|
662
|
+
)
|
|
663
|
+
.map(e => e.networkAddress.address);
|
|
664
|
+
}
|
|
665
|
+
|
|
652
666
|
/**
|
|
653
667
|
*
|
|
654
668
|
* @param {string} prefix
|
|
@@ -783,12 +797,14 @@ export class bind extends CoreService {
|
|
|
783
797
|
|
|
784
798
|
async writeForwarders(outputControl) {
|
|
785
799
|
// TODO formulate everything as pacc expression
|
|
786
|
-
const forwarders = [...this.forwarders]
|
|
787
|
-
.map(e => e.endpoints())
|
|
788
|
-
.flat()
|
|
789
|
-
.filter(e => e.networkAddress)
|
|
790
|
-
.map(e => e.networkAddress?.address);
|
|
791
800
|
|
|
801
|
+
/*
|
|
802
|
+
console.log("F",this.extends);
|
|
803
|
+
console.log("F0",this.fullName);
|
|
804
|
+
console.log("F1",this.forwarders);
|
|
805
|
+
*/
|
|
806
|
+
const forwarders = endpointAddresses(this.forwarders);
|
|
807
|
+
|
|
792
808
|
if (forwarders.length) {
|
|
793
809
|
await writeLines(
|
|
794
810
|
join(outputControl.dir, "etc/named/options"),
|