npm-pkgbuild 22.2.1 → 22.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-pkgbuild",
3
- "version": "22.2.1",
3
+ "version": "22.2.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -134,11 +134,13 @@ export class ALPM extends Packager {
134
134
  source: {
135
135
  ...string_collection_attribute_writable,
136
136
  name: "source",
137
+ separator: undefined,
137
138
  skipEmpty: true
138
139
  },
139
140
  validpgpkeys: {
140
141
  ...string_collection_attribute_writable,
141
142
  name: "validpgpkeys",
143
+ separator: undefined,
142
144
  skipEmpty: true
143
145
  },
144
146
  noextract: { ...default_attribute, name: "noextract", skipEmpty: true },
@@ -150,32 +152,37 @@ export class ALPM extends Packager {
150
152
  md5sums: {
151
153
  ...string_collection_attribute_writable,
152
154
  name: "md5sums",
155
+ separator: undefined,
153
156
  default: ["SKIP"]
154
- // skipEmpty: true
155
157
  },
156
158
  sha1sums: {
157
159
  ...string_collection_attribute_writable,
158
160
  name: "sha1sums",
161
+ separator: undefined,
159
162
  skipEmpty: true
160
163
  },
161
164
  sha256sums: {
162
165
  ...string_collection_attribute_writable,
163
166
  name: "sha256sums",
167
+ separator: undefined,
164
168
  skipEmpty: true
165
169
  },
166
170
  sha384sums: {
167
171
  ...string_collection_attribute_writable,
168
172
  name: "sha384sums",
173
+ separator: undefined,
169
174
  skipEmpty: true
170
175
  },
171
176
  sha512sums: {
172
177
  ...string_collection_attribute_writable,
173
178
  name: "sha512sums",
179
+ separator: undefined,
174
180
  skipEmpty: true
175
181
  },
176
182
  groups: {
177
183
  ...string_collection_attribute_writable,
178
184
  name: "groups",
185
+ separator: undefined,
179
186
  skipEmpty: true
180
187
  },
181
188
  arch: {
@@ -185,6 +192,7 @@ export class ALPM extends Packager {
185
192
  backup: {
186
193
  ...string_collection_attribute_writable,
187
194
  name: "backup",
195
+ separator: undefined,
188
196
  skipEmpty: true
189
197
  },
190
198
  dependencies: {
@@ -223,7 +231,12 @@ export class ALPM extends Packager {
223
231
  name: "replaces",
224
232
  skipEmpty: true
225
233
  },
226
- options: { ...default_attribute, name: "options", skipEmpty: true }
234
+ options: {
235
+ ...default_attribute,
236
+ name: "options",
237
+ separator: undefined,
238
+ skipEmpty: true
239
+ }
227
240
  };
228
241
 
229
242
  static async prepare(options = {}, variant = {}) {
@@ -2,7 +2,12 @@ import { join } from "node:path";
2
2
  import { tmpdir } from "node:os";
3
3
  import { mkdtemp, mkdir } from "node:fs/promises";
4
4
  import { createReadStream } from "node:fs";
5
- import { expand, expandContextDoubbleCurly, iterateToExternal } from "pacc";
5
+ import {
6
+ expand,
7
+ expandContextDoubbleCurly,
8
+ attributeIterator,
9
+ iterateToExternal
10
+ } from "pacc";
6
11
  import { StringContentEntry } from "content-entry";
7
12
  import { publish } from "../publish.mjs";
8
13
  import {
@@ -60,6 +65,14 @@ export class Packager {
60
65
  */
61
66
  constructor(properties) {
62
67
  this.properties = { ...properties, type: this.constructor.name };
68
+
69
+ for (const [path, attribute] of attributeIterator(
70
+ this.constructor.attributes,
71
+ attribute => attribute.default !== undefined
72
+ )) {
73
+ const name = path.join(".");
74
+ this.properties[name] ??= attribute.default;
75
+ }
63
76
  }
64
77
 
65
78
  get externalProperties() {
@@ -3,10 +3,9 @@ import { readFile } from "node:fs/promises";
3
3
  import { cp } from "node:fs/promises";
4
4
  import { execa } from "execa";
5
5
  import {
6
- integer_attribute,
7
- url_attribute,
8
- string_attribute,
9
- string_collection_attribute_writable
6
+ integer_attribute_writable,
7
+ url_attribute_writable,
8
+ string_attribute_writable
10
9
  } from "pacc";
11
10
  import { ContentEntry, IteratorContentEntry } from "content-entry";
12
11
  import { transform } from "content-entry-transform";
@@ -20,7 +19,8 @@ import {
20
19
  pkgbuild_version_attribute,
21
20
  pkgbuild_description_attribute,
22
21
  pkgbuild_name_attribute,
23
- arch_attribute_writable
22
+ arch_attribute_writable,
23
+ dependency_attribute_collection_writable
24
24
  } from "../types.mjs";
25
25
  import {
26
26
  copyEntries,
@@ -65,40 +65,69 @@ export class RPM extends Packager {
65
65
  name: { ...pkgbuild_name_attribute, externalName: "Name" },
66
66
  description: { ...pkgbuild_description_attribute, externalName: "Summary" },
67
67
  license: {
68
- ...string_attribute,
68
+ ...string_attribute_writable,
69
69
  name: "license",
70
70
  externalName: "License",
71
71
  mandatory: true
72
72
  },
73
73
  version: { ...pkgbuild_version_attribute, externalName: "Version" },
74
74
  release: {
75
- ...integer_attribute,
75
+ ...integer_attribute_writable,
76
76
  externalName: "Release",
77
77
  name: "release",
78
78
  default: 1,
79
79
  mandatory: true
80
80
  },
81
- source: { ...string_attribute, externalName: "Source0", name: "source" },
82
- groups: { ...string_attribute, externalName: "Group", name: "groups" },
81
+ source: {
82
+ ...string_attribute_writable,
83
+ externalName: "Source0",
84
+ name: "source",
85
+ skipEmpty: true
86
+ },
87
+ groups: {
88
+ ...string_attribute_writable,
89
+ externalName: "Group",
90
+ name: "groups",
91
+ skipEmpty: true
92
+ },
83
93
  maintainer: {
84
- ...string_attribute,
94
+ ...string_attribute_writable,
85
95
  name: "maintainer",
86
96
  externalName: "Packager"
87
97
  },
88
- vendor: { ...string_attribute, externalName: "Vendor", name: "vendor" },
98
+ vendor: {
99
+ ...string_attribute_writable,
100
+ externalName: "Vendor",
101
+ name: "vendor",
102
+ skipEmpty: true
103
+ },
89
104
  arch: {
90
105
  ...arch_attribute_writable,
91
106
  externalName: "BuildArch",
92
107
  default: "noarch",
93
108
  mapping: { any: "noarch" }
94
109
  },
95
- URL: { ...url_attribute, name: "URL", alias: "homepage" },
110
+ URL: {
111
+ ...url_attribute_writable,
112
+ name: "URL",
113
+ alias: "homepage",
114
+ skipEmpty: true
115
+ },
96
116
  dependencies: {
97
- ...string_collection_attribute_writable,
98
- externalName: "Requires"
117
+ ...dependency_attribute_collection_writable,
118
+ externalName: "Requires",
119
+ skipEmpty: true
120
+ },
121
+ Obsoletes: {
122
+ ...dependency_attribute_collection_writable,
123
+ name: "Obsoletes",
124
+ skipEmpty: true
99
125
  },
100
- Obsoletes: { ...string_collection_attribute_writable, name: "Obsoletes" },
101
- Conflicts: { ...string_collection_attribute_writable, name: "Conflicts" }
126
+ Conflicts: {
127
+ ...dependency_attribute_collection_writable,
128
+ name: "Conflicts",
129
+ skipEmpty: true
130
+ }
102
131
  };
103
132
 
104
133
  static get workspaceLayout() {