pmcf 4.23.2 → 4.24.1

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/README.md CHANGED
@@ -73,11 +73,11 @@ generates config packages for:
73
73
  * [Parameters](#parameters-12)
74
74
  * [port](#port-1)
75
75
  * [id](#id)
76
- * [InitializationContext](#initializationcontext)
77
- * [Parameters](#parameters-13)
78
76
  * [SkeletonNetworkInterface](#skeletonnetworkinterface)
79
77
  * [networkAddresses](#networkaddresses)
80
- * [Parameters](#parameters-14)
78
+ * [Parameters](#parameters-13)
79
+ * [InitializationContext](#initializationcontext)
80
+ * [Parameters](#parameters-14)
81
81
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
82
82
  * [Properties](#properties)
83
83
  * [systemdConfigs](#systemdconfigs)
@@ -263,14 +263,6 @@ Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
263
263
 
264
264
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
265
265
 
266
- ## InitializationContext
267
-
268
- Keeps track of all in flight object creations and loose ends during config initialization.
269
-
270
- ### Parameters
271
-
272
- * `directory` (optional, default `"/"`)
273
-
274
266
  ## SkeletonNetworkInterface
275
267
 
276
268
  **Extends ServiceOwner**
@@ -283,6 +275,14 @@ Keeps track of all in flight object creations and loose ends during config initi
283
275
 
284
276
  Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
285
277
 
278
+ ## InitializationContext
279
+
280
+ Keeps track of all in flight object creations and loose ends during config initialization.
281
+
282
+ ### Parameters
283
+
284
+ * `directory` (optional, default `"/"`)
285
+
286
286
  ## SystemdJournalRemoteService
287
287
 
288
288
  **Extends Service**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.23.2",
3
+ "version": "4.24.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -100,6 +100,7 @@ export class Host extends ServiceOwner {
100
100
  _provides = new Set();
101
101
  _replaces = new Set();
102
102
  _depends = new Set();
103
+ _optional = new Set();
103
104
  _os;
104
105
  _distribution;
105
106
  _deployment;
@@ -116,7 +117,7 @@ export class Host extends ServiceOwner {
116
117
  for (const [name, service] of host.services) {
117
118
  const present = this._services.get(name);
118
119
  if (present) {
119
- /* console.log(
120
+ /* console.log(
120
121
  "LINK",
121
122
  present.fullName,
122
123
  service.fullName,
@@ -268,6 +269,16 @@ export class Host extends ServiceOwner {
268
269
  );
269
270
  }
270
271
 
272
+ set optional(value) {
273
+ this._optional = union(value, this._optional);
274
+ }
275
+
276
+ get optional() {
277
+ return this.expand(
278
+ this.unionFromDirections(["this", "extends"], "_optional")
279
+ );
280
+ }
281
+
271
282
  set os(value) {
272
283
  this._os = value;
273
284
  }
@@ -461,6 +472,7 @@ export class Host extends ServiceOwner {
461
472
  provides: [...this.provides],
462
473
  replaces: [...this.replaces],
463
474
  depends: [...this.depends],
475
+ optional: [...this.optional],
464
476
  backup: "root/.ssh/known_hosts"
465
477
  });
466
478
 
@@ -477,13 +489,13 @@ export class Host extends ServiceOwner {
477
489
 
478
490
  //console.log([...this.walkDirections(["extends"])].map(e => e.fullName));
479
491
 
480
- for (const service of this.services) {
481
- //console.log("SERVICE",service.name);
482
-
492
+ for (const [name, service] of this.services) {
483
493
  if (service.systemdConfigs) {
484
494
  for (const { serviceName, configFileName, content } of asArray(
485
495
  service.expand(service.systemdConfigs(this.name))
486
496
  )) {
497
+ console.log("SERVICE", service.fullName, configFileName);
498
+
487
499
  await writeLines(dir, configFileName, content);
488
500
 
489
501
  addHook(
@@ -94,6 +94,6 @@ export class WLANNetworkInterface extends EthernetNetworkInterface {
94
94
  ]
95
95
  );
96
96
 
97
- packageData.properties.depends.push("iwd", "impala");
97
+ packageData.properties.optional.push("iwd", "impala");
98
98
  }
99
99
  }