npm-pkgbuild 22.0.2 → 22.0.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 +2 -2
- package/src/output/alpm.mjs +26 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": false
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"compare-versions": "^6.1.1",
|
|
55
55
|
"content-entry": "^15.0.2",
|
|
56
56
|
"content-entry-filesystem": "^9.1.2",
|
|
57
|
-
"content-entry-transform": "^1.7.
|
|
57
|
+
"content-entry-transform": "^1.7.5",
|
|
58
58
|
"execa": "^10.0.1",
|
|
59
59
|
"ini": "^7.0.0",
|
|
60
60
|
"iterable-string-interceptor": "^3.0.8",
|
package/src/output/alpm.mjs
CHANGED
|
@@ -241,7 +241,7 @@ package() {
|
|
|
241
241
|
|
|
242
242
|
if [ "$(ls -A $srcdir)" ]
|
|
243
243
|
then
|
|
244
|
-
cp -rp $srcdir/* "$pkgdir"
|
|
244
|
+
#cp -rp $srcdir/* "$pkgdir"
|
|
245
245
|
### PERMISSION ###
|
|
246
246
|
|
|
247
247
|
${verbose}
|
|
@@ -271,48 +271,48 @@ package() {
|
|
|
271
271
|
createEntryWhenMissing: () => new ContentEntry(PKGBUILD)
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
-
const
|
|
274
|
+
const install = [];
|
|
275
275
|
|
|
276
276
|
for await (const file of copyEntries(
|
|
277
277
|
transform(aggregate(sources), transformer),
|
|
278
278
|
join(staging, "src"),
|
|
279
279
|
expander
|
|
280
280
|
)) {
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
const flags = {
|
|
282
|
+
user: ["-u", value => value],
|
|
283
|
+
group: ["-g", value => value],
|
|
284
|
+
mode: ["-m", value => Number(value & 0o7777).toString(8)]
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const options = [];
|
|
288
|
+
for (const [name, config] of Object.entries(flags)) {
|
|
289
|
+
const value = await file[name];
|
|
290
|
+
|
|
291
|
+
if (value !== undefined) {
|
|
292
|
+
options.push(`${config[0]} ${config[1](value)}`);
|
|
293
|
+
}
|
|
283
294
|
}
|
|
295
|
+
install.push(
|
|
296
|
+
` install ${file.isBlob ? "-D" : "-d"} ${options.join(" ")} \"$srcdir/${file.name}\" \"$pkgdir/${file.destination}\"`
|
|
297
|
+
);
|
|
284
298
|
|
|
285
299
|
if (options.verbose) {
|
|
286
300
|
console.log(file.destination);
|
|
287
301
|
}
|
|
288
302
|
}
|
|
289
303
|
|
|
290
|
-
if (
|
|
304
|
+
if (install.length) {
|
|
291
305
|
const pkgbuild = join(staging, PKGBUILD);
|
|
292
|
-
|
|
306
|
+
const content = await readFile(pkgbuild, utf8StreamOptions);
|
|
293
307
|
const markerPos = content.indexOf("### PERMISSION ###");
|
|
294
308
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
group: ["-g", f => f.group],
|
|
298
|
-
mode: ["-m", f => Number(f.mode & 0o7777).toString(8)] // TODO why only 12 bits
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
content =
|
|
309
|
+
await writeFile(
|
|
310
|
+
pkgbuild,
|
|
302
311
|
content.substring(0, markerPos) +
|
|
303
|
-
|
|
304
|
-
.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
.filter(name => f[name])
|
|
308
|
-
.map(name => `${flags[name][0]} ${flags[name][1](f)}`)
|
|
309
|
-
.join(" ");
|
|
310
|
-
return ` install -D ${options} \"$srcdir/${f.name}\" \"$pkgdir/${f.destination}\"`;
|
|
311
|
-
})
|
|
312
|
-
.join("\n") +
|
|
313
|
-
content.substring(markerPos + 18);
|
|
314
|
-
|
|
315
|
-
await writeFile(pkgbuild, content, utf8StreamOptions);
|
|
312
|
+
install.join("\n") +
|
|
313
|
+
content.substring(markerPos + 18),
|
|
314
|
+
utf8StreamOptions
|
|
315
|
+
);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
if (options.verbose) {
|