npm-pkgbuild 22.1.1 → 22.1.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.1.1",
3
+ "version": "22.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": false
@@ -39,8 +39,10 @@ export class NodeModulesContentProvider extends ContentProvider {
39
39
  }
40
40
  super(definitions);
41
41
 
42
- this.withoutDevelpmentDependencies =
43
- definitions.withoutDevelpmentDependencies;
42
+ if (definitions.withoutDevelpmentDependencies !== undefined) {
43
+ this.withoutDevelpmentDependencies =
44
+ definitions.withoutDevelpmentDependencies;
45
+ }
44
46
  }
45
47
 
46
48
  /**
@@ -250,6 +250,7 @@ package() {
250
250
 
251
251
  if [ "$(ls -A $srcdir)" ]
252
252
  then
253
+ cp -rp $srcdir/* "$pkgdir"
253
254
  ### PERMISSION ###
254
255
 
255
256
  ${verbose}
@@ -279,37 +280,33 @@ package() {
279
280
  createEntryWhenMissing: () => new ContentEntry(PKGBUILD)
280
281
  });
281
282
 
282
- const install = [];
283
+ const permission = [];
283
284
 
284
285
  for await (const file of copyEntries(
285
286
  transform(aggregate(sources), transformer),
286
287
  join(staging, "src"),
287
288
  expander
288
289
  )) {
289
- const flags = {
290
- user: ["-o", value => value],
291
- group: ["-g", value => value],
292
- mode: ["-m", value => Number(value & 0o7777).toString(8)]
293
- };
294
-
295
- const options = [];
296
- for (const [name, config] of Object.entries(flags)) {
297
- const value = await file[name];
298
-
299
- if (value !== undefined) {
300
- options.push(`${config[0]} ${config[1](value)}`);
301
- }
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
+ }
302
302
  }
303
- install.push(
304
- ` install ${file.isBlob ? "-D" : "-d"} ${options.join(" ")} \"$srcdir/${file.name}\" \"$pkgdir/${file.destination}\"`
305
- );
306
303
 
307
304
  if (options.verbose) {
308
305
  console.log(file.destination);
309
306
  }
310
307
  }
311
308
 
312
- if (install.length) {
309
+ if (permission.length) {
313
310
  const pkgbuild = join(staging, PKGBUILD);
314
311
  const content = await readFile(pkgbuild, utf8StreamOptions);
315
312
  const markerPos = content.indexOf("### PERMISSION ###");
@@ -317,7 +314,7 @@ package() {
317
314
  await writeFile(
318
315
  pkgbuild,
319
316
  content.substring(0, markerPos) +
320
- install.join("\n") +
317
+ permission.join("\n") +
321
318
  content.substring(markerPos + 18),
322
319
  utf8StreamOptions
323
320
  );