pmcf 4.17.3 → 4.18.0
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/bin/pmcf-info +11 -19
- package/package.json +1 -1
- package/src/base.mjs +8 -2
- package/src/host.mjs +24 -28
- package/src/owner.mjs +1 -1
- package/src/services/alpm.mjs +5 -5
- package/types/base.d.mts +1 -0
- package/types/host.d.mts +3 -6
- package/types/owner.d.mts +1 -1
- package/types/service.d.mts +1 -0
- package/types/services/alpm.d.mts +1 -2
package/bin/pmcf-info
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { prepare } from "../src/cli.mjs";
|
|
3
3
|
|
|
4
|
-
const { root, args, options } = await prepare({
|
|
5
|
-
service: {
|
|
6
|
-
type: "string"
|
|
7
|
-
},
|
|
8
|
-
address: {
|
|
9
|
-
type: "boolean"
|
|
10
|
-
}
|
|
11
|
-
});
|
|
4
|
+
const { root, args, options } = await prepare({});
|
|
12
5
|
|
|
13
6
|
for (const name of args) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
console.log(object.toJSON());
|
|
7
|
+
const [path, expression] = name.split("?");
|
|
8
|
+
|
|
9
|
+
const object = await root.load(path);
|
|
10
|
+
|
|
11
|
+
let result = object.expression(expression);
|
|
12
|
+
|
|
13
|
+
if (result instanceof Iterator) {
|
|
14
|
+
result = Array.from(result);
|
|
25
15
|
}
|
|
16
|
+
|
|
17
|
+
console.log(result);
|
|
26
18
|
}
|
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -148,8 +148,13 @@ export class Base {
|
|
|
148
148
|
this[name].add(value);
|
|
149
149
|
}
|
|
150
150
|
} else if (current instanceof Map) {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
const keyName = attribute.type.key;
|
|
152
|
+
if (keyName) {
|
|
153
|
+
current.set(value[keyName], value);
|
|
154
|
+
} else {
|
|
155
|
+
// TODO
|
|
156
|
+
this[name] = value;
|
|
157
|
+
}
|
|
153
158
|
} else {
|
|
154
159
|
this.error("Unknown collection type", name, current);
|
|
155
160
|
}
|
|
@@ -566,6 +571,7 @@ export class Base {
|
|
|
566
571
|
sources: [],
|
|
567
572
|
outputs: this.outputs,
|
|
568
573
|
properties: {
|
|
574
|
+
name: `${this.typeName}-${this.owner.name}-${this.name}`,
|
|
569
575
|
access: "private",
|
|
570
576
|
dependencies: this.depends,
|
|
571
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
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
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: [
|
|
483
|
+
dependencies: [packageData.properties.name]
|
|
488
484
|
}
|
|
489
485
|
};
|
|
490
486
|
}
|
package/src/owner.mjs
CHANGED
package/src/services/alpm.mjs
CHANGED
|
@@ -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
|
-
|
|
60
|
-
|
|
61
|
-
set repositories(repository) {
|
|
62
|
-
this._repositories.set(repository.name, repository);
|
|
63
|
-
}
|
|
63
|
+
repositories = new Map();
|
|
64
64
|
}
|
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:
|
|
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
|
-
|
|
272
|
-
replaces: any[];
|
|
273
|
-
backup: string;
|
|
269
|
+
dependencies: any;
|
|
270
|
+
groups: any[];
|
|
274
271
|
};
|
|
275
272
|
} | {
|
|
276
273
|
sources: FileContentProvider[];
|
package/types/owner.d.mts
CHANGED
|
@@ -192,7 +192,7 @@ export class Owner extends Base {
|
|
|
192
192
|
addObject(object: any): void;
|
|
193
193
|
findServices(filter: any): Generator<any, void, any>;
|
|
194
194
|
locationNamed(name: any): any;
|
|
195
|
-
locations(): any;
|
|
195
|
+
get locations(): any;
|
|
196
196
|
hostNamed(name: any): any;
|
|
197
197
|
directHosts(): Set<any>;
|
|
198
198
|
hosts(): Set<any>;
|
package/types/service.d.mts
CHANGED
|
@@ -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
|
-
|
|
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";
|