npm-pkgbuild 17.3.0 → 17.3.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 +10 -10
- package/package.json +1 -1
- package/src/output/arch.mjs +5 -5
- package/src/output/debian.mjs +7 -15
- package/src/output/packager.mjs +6 -5
- package/src/output/rpm.mjs +9 -14
- package/types/output/debian.d.mts +0 -1
- package/types/output/packager.d.mts +2 -1
- package/types/output/rpm.d.mts +1 -1
package/README.md
CHANGED
|
@@ -117,9 +117,8 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
117
117
|
* [Parameters](#parameters-6)
|
|
118
118
|
* [Properties](#properties-3)
|
|
119
119
|
* [asyncIterator](#asynciterator)
|
|
120
|
-
* [hookMapping](#hookmapping)
|
|
121
|
-
* [hookMapping](#hookmapping-1)
|
|
122
120
|
* [DEBIAN](#debian)
|
|
121
|
+
* [hookMapping](#hookmapping)
|
|
123
122
|
* [prepare](#prepare)
|
|
124
123
|
* [Parameters](#parameters-7)
|
|
125
124
|
* [fields](#fields)
|
|
@@ -130,6 +129,7 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
130
129
|
* [quoteFile](#quotefile)
|
|
131
130
|
* [Parameters](#parameters-8)
|
|
132
131
|
* [RPM](#rpm)
|
|
132
|
+
* [hookMapping](#hookmapping-1)
|
|
133
133
|
* [prepare](#prepare-1)
|
|
134
134
|
* [Parameters](#parameters-9)
|
|
135
135
|
* [OCI](#oci)
|
|
@@ -339,20 +339,16 @@ List all entries.
|
|
|
339
339
|
|
|
340
340
|
Returns **AsyncIterable\<ContentEntry>** all entries
|
|
341
341
|
|
|
342
|
-
## hookMapping
|
|
343
|
-
|
|
344
|
-
map install hook named from arch to deb
|
|
345
|
-
|
|
346
|
-
## hookMapping
|
|
347
|
-
|
|
348
|
-
map install hook named from arch to rpm
|
|
349
|
-
|
|
350
342
|
## DEBIAN
|
|
351
343
|
|
|
352
344
|
**Extends Packager**
|
|
353
345
|
|
|
354
346
|
Create .deb packages
|
|
355
347
|
|
|
348
|
+
### hookMapping
|
|
349
|
+
|
|
350
|
+
Map install hook named from default (arch) to deb.
|
|
351
|
+
|
|
356
352
|
### prepare
|
|
357
353
|
|
|
358
354
|
#### Parameters
|
|
@@ -398,6 +394,10 @@ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Globa
|
|
|
398
394
|
|
|
399
395
|
Produce rpm packages.
|
|
400
396
|
|
|
397
|
+
### hookMapping
|
|
398
|
+
|
|
399
|
+
Map install hook named from default (arch) to rpm.
|
|
400
|
+
|
|
401
401
|
### prepare
|
|
402
402
|
|
|
403
403
|
Check for rpmbuild presence.
|
package/package.json
CHANGED
package/src/output/arch.mjs
CHANGED
|
@@ -117,6 +117,10 @@ export class ARCH extends Packager {
|
|
|
117
117
|
return `${p.name}-${p.version}-${p.release}-${p.arch}${this.fileNameExtension}`;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
dependencyExpression(name, expression) {
|
|
121
|
+
return quote(`${this.packageName(name)}${normalizeExpression(expression)}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
120
124
|
async create(sources, transformer, publishingDetails, options, expander) {
|
|
121
125
|
const { properties, staging, destination } = await this.prepare(options);
|
|
122
126
|
|
|
@@ -143,11 +147,7 @@ export class ARCH extends Packager {
|
|
|
143
147
|
async function* trailingLines() {
|
|
144
148
|
yield `
|
|
145
149
|
package() {
|
|
146
|
-
depends=(${self
|
|
147
|
-
.makeDepends(properties.dependencies, (name, expression) =>
|
|
148
|
-
quote(`${self.packageName(name)}${normalizeExpression(expression)}`)
|
|
149
|
-
)
|
|
150
|
-
.join(" ")})
|
|
150
|
+
depends=(${self.makeDepends(properties.dependencies).join(" ")})
|
|
151
151
|
|
|
152
152
|
if [ "$(ls -A $srcdir)" ]
|
|
153
153
|
then
|
package/src/output/debian.mjs
CHANGED
|
@@ -75,12 +75,9 @@ export class DEBIAN extends Packager {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
? `${this.packageName(name)} (${expression})`
|
|
82
|
-
: this.packageName(name)
|
|
83
|
-
);
|
|
78
|
+
dependencyExpression(name, expression) {
|
|
79
|
+
name = this.packageName(name);
|
|
80
|
+
return expression ? `${name} (${expression})` : name;
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
async create(sources, transformer, publishingDetails, options, expander) {
|
|
@@ -94,11 +91,9 @@ export class DEBIAN extends Packager {
|
|
|
94
91
|
)
|
|
95
92
|
);
|
|
96
93
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
) {
|
|
101
|
-
properties.Depends = this.makeDepends(properties.dependencies);
|
|
94
|
+
const depends = this.makeDepends(properties.dependencies);
|
|
95
|
+
if(depends.length) {
|
|
96
|
+
properties.Depends = depends;
|
|
102
97
|
}
|
|
103
98
|
|
|
104
99
|
const fp = fieldProvider(properties, fields);
|
|
@@ -115,10 +110,7 @@ export class DEBIAN extends Packager {
|
|
|
115
110
|
});
|
|
116
111
|
|
|
117
112
|
for await (const file of copyEntries(
|
|
118
|
-
transform(
|
|
119
|
-
aggregateFifo([...sources, this.hookContent()]),
|
|
120
|
-
transformer
|
|
121
|
-
),
|
|
113
|
+
transform(aggregateFifo([...sources, this.hookContent()]), transformer),
|
|
122
114
|
staging,
|
|
123
115
|
expander
|
|
124
116
|
)) {
|
package/src/output/packager.mjs
CHANGED
|
@@ -115,10 +115,11 @@ export class Packager {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
dependencyExpression(name, expression) {
|
|
119
|
+
return expression ? `${name}${expression}`: name;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
makeDepends(dependencies) {
|
|
122
123
|
if (!dependencies) {
|
|
123
124
|
return [];
|
|
124
125
|
}
|
|
@@ -133,7 +134,7 @@ export class Packager {
|
|
|
133
134
|
}
|
|
134
135
|
return Object.entries(dependencies)
|
|
135
136
|
.filter(filterOutUnwantedDependencies())
|
|
136
|
-
.map(([name, expression]) =>
|
|
137
|
+
.map(([name, expression]) => this.dependencyExpression(name, expression));
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
get fileNameExtension() {
|
package/src/output/rpm.mjs
CHANGED
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
copyEntries,
|
|
21
21
|
fieldProvider,
|
|
22
22
|
utf8StreamOptions,
|
|
23
|
-
extractFunctions,
|
|
24
23
|
compileFields
|
|
25
24
|
} from "../util.mjs";
|
|
26
25
|
|
|
@@ -86,18 +85,14 @@ export class RPM extends Packager {
|
|
|
86
85
|
return false;
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/^\s*(<|<=|>|>=|=)\s*(\w+)/,
|
|
98
|
-
(match, p1, p2) => ` ${p1} ${p2}`
|
|
99
|
-
)}`
|
|
100
|
-
);
|
|
88
|
+
dependencyExpression(name, expression) {
|
|
89
|
+
return `${this.packageName(name)}${expression
|
|
90
|
+
.replace(/^\s*(\w+)/, (match, p1) => ` = ${p1}`)
|
|
91
|
+
.replace(/^\s*$/, "")
|
|
92
|
+
.replace(
|
|
93
|
+
/^\s*(<|<=|>|>=|=)\s*(\w+)/,
|
|
94
|
+
(match, p1, p2) => ` ${p1} ${p2}`
|
|
95
|
+
)}`;
|
|
101
96
|
}
|
|
102
97
|
|
|
103
98
|
/**
|
|
@@ -138,7 +133,7 @@ export class RPM extends Packager {
|
|
|
138
133
|
|
|
139
134
|
for await (const hook of self.hookContent()) {
|
|
140
135
|
yield `%${hook.name}\n`;
|
|
141
|
-
yield
|
|
136
|
+
yield* hook.string.split("\n").map(l => l + "\n");
|
|
142
137
|
}
|
|
143
138
|
|
|
144
139
|
yield `%files\n\n`;
|
|
@@ -22,7 +22,6 @@ export class DEBIAN extends Packager {
|
|
|
22
22
|
post_install: string;
|
|
23
23
|
post_remove: string;
|
|
24
24
|
};
|
|
25
|
-
makeDepends(deps: any): string[];
|
|
26
25
|
create(sources: any, transformer: any, publishingDetails: any, options: any, expander: any): Promise<string>;
|
|
27
26
|
}
|
|
28
27
|
import { Packager } from "./packager.mjs";
|
|
@@ -40,7 +40,8 @@ export class Packager {
|
|
|
40
40
|
packageName(name: string): string;
|
|
41
41
|
get hookMapping(): {};
|
|
42
42
|
hookContent(): AsyncGenerator<StringContentEntry, void, unknown>;
|
|
43
|
-
|
|
43
|
+
dependencyExpression(name: any, expression: any): any;
|
|
44
|
+
makeDepends(dependencies: any): any[];
|
|
44
45
|
get fileNameExtension(): any;
|
|
45
46
|
get fields(): any;
|
|
46
47
|
get properties(): any;
|
package/types/output/rpm.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ export class RPM extends Packager {
|
|
|
22
22
|
arch: string;
|
|
23
23
|
}): Promise<boolean>;
|
|
24
24
|
get packageFileName(): string;
|
|
25
|
-
|
|
25
|
+
dependencyExpression(name: any, expression: any): string;
|
|
26
26
|
/**
|
|
27
27
|
* Map install hook named from default (arch) to rpm.
|
|
28
28
|
*/
|