npm-pkgbuild 22.1.0 → 22.1.2
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 +4 -1
- package/package.json +1 -1
- package/src/output/alpm.mjs +28 -23
package/README.md
CHANGED
|
@@ -348,6 +348,9 @@ Source of package content.
|
|
|
348
348
|
### Properties
|
|
349
349
|
|
|
350
350
|
* `dir` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
351
|
+
* `destination` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
352
|
+
* `defaultProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
353
|
+
* `permissions` **[Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object), [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** 
|
|
351
354
|
|
|
352
355
|
### propertiesFor
|
|
353
356
|
|
|
@@ -356,7 +359,7 @@ Source of package content.
|
|
|
356
359
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
357
360
|
* `isCollection` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
358
361
|
|
|
359
|
-
Returns **
|
|
362
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
360
363
|
|
|
361
364
|
### asyncIterator
|
|
362
365
|
|
package/package.json
CHANGED
package/src/output/alpm.mjs
CHANGED
|
@@ -137,7 +137,11 @@ export class ALPM extends Packager {
|
|
|
137
137
|
default: ["any"],
|
|
138
138
|
mandatory: true
|
|
139
139
|
},
|
|
140
|
-
backup: {
|
|
140
|
+
backup: {
|
|
141
|
+
...string_collection_attribute_writable,
|
|
142
|
+
name: "backup",
|
|
143
|
+
skipEmpty: true
|
|
144
|
+
},
|
|
141
145
|
depends: {
|
|
142
146
|
...dependency_attribute_collection_writable /*, alias: "dependencies" */,
|
|
143
147
|
name: "depends"
|
|
@@ -156,10 +160,15 @@ export class ALPM extends Packager {
|
|
|
156
160
|
},
|
|
157
161
|
conflicts: {
|
|
158
162
|
...dependency_attribute_collection_writable,
|
|
159
|
-
name: "conflicts"
|
|
163
|
+
name: "conflicts",
|
|
164
|
+
skipEmpty: true
|
|
160
165
|
},
|
|
161
166
|
provides: { ...dependency_attribute_collection_writable, name: "provides" },
|
|
162
|
-
replaces: {
|
|
167
|
+
replaces: {
|
|
168
|
+
...dependency_attribute_collection_writable,
|
|
169
|
+
name: "replaces",
|
|
170
|
+
skipEmpty: true
|
|
171
|
+
},
|
|
163
172
|
options: { ...default_attribute, name: "options" }
|
|
164
173
|
};
|
|
165
174
|
|
|
@@ -241,7 +250,7 @@ package() {
|
|
|
241
250
|
|
|
242
251
|
if [ "$(ls -A $srcdir)" ]
|
|
243
252
|
then
|
|
244
|
-
|
|
253
|
+
cp -rp $srcdir/* "$pkgdir"
|
|
245
254
|
### PERMISSION ###
|
|
246
255
|
|
|
247
256
|
${verbose}
|
|
@@ -271,37 +280,33 @@ package() {
|
|
|
271
280
|
createEntryWhenMissing: () => new ContentEntry(PKGBUILD)
|
|
272
281
|
});
|
|
273
282
|
|
|
274
|
-
const
|
|
283
|
+
const permission = [];
|
|
275
284
|
|
|
276
285
|
for await (const file of copyEntries(
|
|
277
286
|
transform(aggregate(sources), transformer),
|
|
278
287
|
join(staging, "src"),
|
|
279
288
|
expander
|
|
280
289
|
)) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
290
|
+
if(file.destination !== '../PKGBUILD') {
|
|
291
|
+
if (file.owner || file.group) {
|
|
292
|
+
permission.push(
|
|
293
|
+
` chown ${[file.owner ?? "", file.group ?? ""].join(":")} \"$pkgdir/${file.destination}\"`
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
const mode = (await file.mode) & 0o7777;
|
|
297
|
+
if (mode) {
|
|
298
|
+
permission.push(
|
|
299
|
+
` chmod ${Number(mode).toString(8)} \"$pkgdir/${file.destination}\"`
|
|
300
|
+
);
|
|
301
|
+
}
|
|
294
302
|
}
|
|
295
|
-
install.push(
|
|
296
|
-
` install ${file.isBlob ? "-D" : "-d"} ${options.join(" ")} \"$srcdir/${file.name}\" \"$pkgdir/${file.destination}\"`
|
|
297
|
-
);
|
|
298
303
|
|
|
299
304
|
if (options.verbose) {
|
|
300
305
|
console.log(file.destination);
|
|
301
306
|
}
|
|
302
307
|
}
|
|
303
308
|
|
|
304
|
-
if (
|
|
309
|
+
if (permission.length) {
|
|
305
310
|
const pkgbuild = join(staging, PKGBUILD);
|
|
306
311
|
const content = await readFile(pkgbuild, utf8StreamOptions);
|
|
307
312
|
const markerPos = content.indexOf("### PERMISSION ###");
|
|
@@ -309,7 +314,7 @@ package() {
|
|
|
309
314
|
await writeFile(
|
|
310
315
|
pkgbuild,
|
|
311
316
|
content.substring(0, markerPos) +
|
|
312
|
-
|
|
317
|
+
permission.join("\n") +
|
|
313
318
|
content.substring(markerPos + 18),
|
|
314
319
|
utf8StreamOptions
|
|
315
320
|
);
|