pmcf 6.4.1 → 6.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.4.1",
3
+ "version": "6.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -268,7 +268,12 @@ export class Base {
268
268
  const value = this.attribute(name);
269
269
 
270
270
  if (value !== undefined) {
271
- yield [attribute.externalName ?? name, toExternal(value, attribute), path, attribute];
271
+ yield [
272
+ attribute.externalName ?? name,
273
+ toExternal(value, attribute),
274
+ path,
275
+ attribute
276
+ ];
272
277
  }
273
278
  }
274
279
  }
@@ -414,6 +419,25 @@ export class Base {
414
419
  return new Set(allOutputs.filter(o => this.packaging.has(o.name)));
415
420
  }
416
421
 
422
+ get packageContentPermissions() {
423
+ const owner = this.constructor.name;
424
+ const group = owner;
425
+ const premissions = [
426
+ {
427
+ mode: 0o644,
428
+ owner,
429
+ group
430
+ },
431
+ {
432
+ mode: 0o755,
433
+ owner,
434
+ group
435
+ }
436
+ ];
437
+
438
+ return premissions;
439
+ }
440
+
417
441
  get packageData() {
418
442
  const nameParts = [this.typeName, this.owner?.name, this.name];
419
443
  return {
@@ -45,32 +45,27 @@ export class mosquitto extends CoreService {
45
45
  }
46
46
 
47
47
  async *preparePackages(dir) {
48
- const owner = "mosquitto";
49
- const group = "mosquitto";
50
-
48
+ console.log(
49
+ "MOSQUITTO",
50
+ [...this.walkDirections(["extends"])].map(n => this.fullName)
51
+ );
52
+ const permissions = this.packageContentPermissions;
51
53
  const packageData = this.packageData;
54
+
52
55
  packageData.sources = await Array.fromAsync(
53
- this.templateContent(
54
- {
55
- mode: 0o644,
56
- owner,
57
- group
58
- },
59
- {
60
- mode: 0o755,
61
- owner,
62
- group
63
- }
64
- )
56
+ this.templateContent(...permissions)
65
57
  );
66
58
 
67
- packageData.sources.push(new FileContentProvider(dir + "/"));
59
+ packageData.sources.push(
60
+ new FileContentProvider(dir + "/", ...permissions)
61
+ );
68
62
 
69
63
  await writeLines(
70
64
  join(dir, "etc", "mosquitto"),
71
65
  "mosquitto.conf",
72
66
  setionLinesFromAttributeIterator(
73
- this.attributeIterator(filterConfigurable), " "
67
+ this.attributeIterator(filterConfigurable),
68
+ " "
74
69
  )
75
70
  );
76
71
 
@@ -34,24 +34,11 @@ export class openldap extends CoreService {
34
34
  }
35
35
 
36
36
  async *preparePackages(dir) {
37
- const owner = "ldap";
38
- const group = "ldap";
39
-
37
+ const permissions = this.packageContentPermissions;
40
38
  const packageData = this.packageData;
41
39
 
42
40
  packageData.sources = await Array.fromAsync(
43
- this.templateContent(
44
- {
45
- mode: 0o644,
46
- owner,
47
- group
48
- },
49
- {
50
- mode: 0o755,
51
- owner,
52
- group
53
- }
54
- )
41
+ this.templateContent(...permissions)
55
42
  );
56
43
 
57
44
  yield packageData;