pmcf 4.17.2 → 4.17.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.17.2",
3
+ "version": "4.17.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -142,11 +142,19 @@ export class Base {
142
142
  }
143
143
  } else {
144
144
  if (current instanceof Set) {
145
- // TODO
146
- this[name] = value;
145
+ if (value instanceof Set) {
146
+ this[name] = current.union(value);
147
+ } else {
148
+ this[name].add(value);
149
+ }
147
150
  } else if (current instanceof Map) {
148
- // TODO
149
- this[name] = value;
151
+ const keyName = attribute.type.key;
152
+ if (keyName) {
153
+ current.set(value[keyName], value);
154
+ } else {
155
+ // TODO
156
+ this[name] = value;
157
+ }
150
158
  } else {
151
159
  this.error("Unknown collection type", name, current);
152
160
  }
@@ -563,6 +571,7 @@ export class Base {
563
571
  sources: [],
564
572
  outputs: this.outputs,
565
573
  properties: {
574
+ name: `${this.typeName}-${this.owner.name}-${this.name}`,
566
575
  access: "private",
567
576
  dependencies: this.depends,
568
577
  groups: [this.type]
package/src/host.mjs CHANGED
@@ -409,34 +409,30 @@ export class Host extends ServiceOwner {
409
409
  }
410
410
 
411
411
  async *preparePackages(dir) {
412
- const pkgName = `${this.typeName}-${this.owner.name}-${this.name}`;
413
- let packageData = {
414
- sources: [
415
- await Array.fromAsync(this.templateContent()),
416
- new FileContentProvider(
417
- { dir: this.directory, pattern: "*.pub" },
418
- { destination: "/etc/ssh/", mode: 0o644 }
419
- ),
420
- new FileContentProvider(
421
- { dir: this.directory, pattern: "*_key" },
422
- { destination: "/etc/ssh/", mode: 0o600 }
423
- ),
424
- new FileContentProvider({ dir, pattern: ["**/*", "**/.ssh/*"] })
412
+ const packageData = this.packageData;
413
+ packageData.sources.push(
414
+ await Array.fromAsync(this.templateContent()),
415
+ new FileContentProvider(
416
+ { dir: this.directory, pattern: "*.pub" },
417
+ { destination: "/etc/ssh/", mode: 0o644 }
418
+ ),
419
+ new FileContentProvider(
420
+ { dir: this.directory, pattern: "*_key" },
421
+ { destination: "/etc/ssh/", mode: 0o600 }
422
+ ),
423
+ new FileContentProvider({ dir, pattern: ["**/*", "**/.ssh/*"] })
424
+ );
425
+
426
+ Object.assign(packageData.properties, {
427
+ description: `${this.typeName} definitions for ${this.fullName}`,
428
+ dependencies: [
429
+ `${this.location.typeName}-${this.location.name}`,
430
+ ...this.depends
425
431
  ],
426
- outputs: this.outputs,
427
- properties: {
428
- name: pkgName,
429
- description: `${this.typeName} definitions for ${this.fullName}`,
430
- access: "private",
431
- dependencies: [
432
- `${this.location.typeName}-${this.location.name}`,
433
- ...this.depends
434
- ],
435
- provides: [...this.provides],
436
- replaces: [...this.replaces],
437
- backup: "root/.ssh/known_hosts"
438
- }
439
- };
432
+ provides: [...this.provides],
433
+ replaces: [...this.replaces],
434
+ backup: "root/.ssh/known_hosts"
435
+ });
440
436
 
441
437
  await loadHooks(
442
438
  packageData,
@@ -484,7 +480,7 @@ export class Host extends ServiceOwner {
484
480
  name: `${this.typeName}-extra-${this.owner.name}-${this.name}`,
485
481
  description: `additional files for ${this.fullName}`,
486
482
  access: "private",
487
- dependencies: [pkgName]
483
+ dependencies: [packageData.properties.name]
488
484
  }
489
485
  };
490
486
  }
@@ -11,6 +11,7 @@ import { ServiceTypeDefinition, Service } from "../service.mjs";
11
11
  const ALPMRepositoryTypeDefinition = {
12
12
  name: "alpm_repository",
13
13
  extends: Base.typeDefinition,
14
+ key: "name",
14
15
  attributes: {
15
16
  name: name_attribute_writable,
16
17
  base: string_attribute_writable,
@@ -26,6 +27,9 @@ class ALPMRepository extends Base {
26
27
  static get typeDefinition() {
27
28
  return ALPMRepositoryTypeDefinition;
28
29
  }
30
+
31
+ architectures = new Set();
32
+
29
33
  }
30
34
 
31
35
  const ALPMServiceTypeDefinition = {
@@ -56,9 +60,5 @@ export class ALPMService extends Service {
56
60
  return ALPMServiceTypeDefinition;
57
61
  }
58
62
 
59
- _repositories = new Map();
60
-
61
- set repositories(repository) {
62
- this._repositories.set(repository.name, repository);
63
- }
63
+ repositories = new Map();
64
64
  }
@@ -6,10 +6,11 @@ import {
6
6
  addType,
7
7
  default_attribute_writable,
8
8
  string_attribute_writable,
9
+ string_collection_attribute_writable,
10
+ string_set_attribute_writable,
9
11
  boolean_attribute_writable_true,
10
12
  boolean_attribute_writable_false,
11
13
  number_attribute_writable,
12
- string_collection_attribute_writable,
13
14
  name_attribute_writable
14
15
  } from "pacc";
15
16
  import {
@@ -79,7 +80,7 @@ const BindServiceTypeDefinition = {
79
80
  hasCatalog: boolean_attribute_writable_true,
80
81
  hasLinkLocalAdresses: boolean_attribute_writable_false,
81
82
  hasLocationRecord: boolean_attribute_writable_true,
82
- excludeInterfaceKinds: string_collection_attribute_writable,
83
+ excludeInterfaceKinds: string_set_attribute_writable,
83
84
  exclude: {
84
85
  ...default_attribute_writable,
85
86
  type: networkAddressType,
@@ -160,7 +161,8 @@ export class BindService extends ExtraSourceService {
160
161
  _zones = [];
161
162
  _trusted = [];
162
163
  _exclude = new Set([]);
163
- _excludeInterfaceKinds = new Set();
164
+
165
+ excludeInterfaceKinds = new Set();
164
166
 
165
167
  serial = Math.ceil(Date.now() / 1000);
166
168
  refresh = 36000;
@@ -245,14 +247,6 @@ export class BindService extends ExtraSourceService {
245
247
  return this._exclude;
246
248
  }
247
249
 
248
- set excludeInterfaceKinds(value) {
249
- this._excludeInterfaceKinds.add(value);
250
- }
251
-
252
- get excludeInterfaceKinds() {
253
- return this._excludeInterfaceKinds;
254
- }
255
-
256
250
  async *preparePackages(dir) {
257
251
  const sources = this.zones.length ? this.zones : [this.owner];
258
252
  const names = sources.map(a => a.fullName).join(" ");
package/types/base.d.mts CHANGED
@@ -135,6 +135,7 @@ export class Base {
135
135
  sources: any[];
136
136
  outputs: Set<typeof import("npm-pkgbuild").DEBIAN | typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
137
137
  properties: {
138
+ name: string;
138
139
  access: string;
139
140
  dependencies: any;
140
141
  groups: any[];
package/types/host.d.mts CHANGED
@@ -261,16 +261,13 @@ export class Host extends ServiceOwner {
261
261
  get subnets(): Set<any>;
262
262
  publicKey(type?: string): Promise<string>;
263
263
  preparePackages(dir: any): AsyncGenerator<{
264
- sources: (FileContentProvider | ContentProvider[])[];
264
+ sources: any[];
265
265
  outputs: Set<typeof import("npm-pkgbuild").DEBIAN | typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
266
266
  properties: {
267
267
  name: string;
268
- description: string;
269
268
  access: string;
270
- dependencies: any[];
271
- provides: any[];
272
- replaces: any[];
273
- backup: string;
269
+ dependencies: any;
270
+ groups: any[];
274
271
  };
275
272
  } | {
276
273
  sources: FileContentProvider[];
@@ -662,6 +662,7 @@ export class Service extends Base {
662
662
  sources: any[];
663
663
  outputs: Set<typeof import("npm-pkgbuild").DEBIAN | typeof import("npm-pkgbuild").ARCH | typeof import("npm-pkgbuild").OCI | typeof import("npm-pkgbuild").DOCKER>;
664
664
  properties: {
665
+ name: string;
665
666
  access: string;
666
667
  dependencies: any;
667
668
  groups: any[];
@@ -799,8 +799,7 @@ export class ALPMService extends Service {
799
799
  extends: string[];
800
800
  };
801
801
  };
802
- _repositories: Map<any, any>;
803
- set repositories(repository: any);
802
+ repositories: Map<any, any>;
804
803
  }
805
804
  import { Service } from "../service.mjs";
806
805
  import { Base } from "pmcf";
@@ -1539,7 +1539,7 @@ export class BindService extends ExtraSourceService {
1539
1539
  _zones: any[];
1540
1540
  _trusted: any[];
1541
1541
  _exclude: Set<any>;
1542
- _excludeInterfaceKinds: Set<any>;
1542
+ excludeInterfaceKinds: Set<any>;
1543
1543
  serial: number;
1544
1544
  refresh: number;
1545
1545
  retry: number;
@@ -1558,8 +1558,6 @@ export class BindService extends ExtraSourceService {
1558
1558
  get trusted(): any[];
1559
1559
  set exclude(value: Set<any>);
1560
1560
  get exclude(): Set<any>;
1561
- set excludeInterfaceKinds(value: Set<any>);
1562
- get excludeInterfaceKinds(): Set<any>;
1563
1561
  preparePackages(dir: any): AsyncGenerator<any, void, unknown>;
1564
1562
  generateOutfacingDefs(outputControl: any, sources: any): AsyncGenerator<any, void, unknown>;
1565
1563
  generateZoneDefs(outputControl: any, sources: any): Promise<any>;