npm-pkgbuild 22.1.11 → 22.1.12
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 +1 -1
- package/src/output/debian.mjs +6 -3
- package/src/output/packager.mjs +15 -0
- package/src/util.mjs +1 -1
package/package.json
CHANGED
package/src/output/debian.mjs
CHANGED
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
integer_attribute_writable,
|
|
6
6
|
yesno_attribute_writable,
|
|
7
7
|
string_attribute_writable,
|
|
8
|
-
string_collection_attribute_writable
|
|
8
|
+
string_collection_attribute_writable,
|
|
9
|
+
toExternal
|
|
9
10
|
} from "pacc";
|
|
10
11
|
import { ContentEntry, IteratorContentEntry } from "content-entry";
|
|
11
12
|
import {
|
|
@@ -18,7 +19,8 @@ import {
|
|
|
18
19
|
pkgbuild_version_attribute,
|
|
19
20
|
pkgbuild_description_attribute,
|
|
20
21
|
pkgbuild_name_attribute,
|
|
21
|
-
dependency_attribute_collection_writable
|
|
22
|
+
dependency_attribute_collection_writable,
|
|
23
|
+
architectureType
|
|
22
24
|
} from "./packager.mjs";
|
|
23
25
|
import { copyEntries, fieldProvider, aggregate } from "../util.mjs";
|
|
24
26
|
|
|
@@ -73,6 +75,7 @@ export class DEBIAN extends Packager {
|
|
|
73
75
|
alias: "arch",
|
|
74
76
|
default: "all",
|
|
75
77
|
mandatory: true,
|
|
78
|
+
type: architectureType,
|
|
76
79
|
mapping: { aarch64: "arm64" }
|
|
77
80
|
},
|
|
78
81
|
Homepage: {
|
|
@@ -153,7 +156,7 @@ export class DEBIAN extends Packager {
|
|
|
153
156
|
const p = this.properties;
|
|
154
157
|
|
|
155
158
|
// TODO utility to provide final values
|
|
156
|
-
const arch = this.attributes.Architecture
|
|
159
|
+
const arch = toExternal(p.arch, this.attributes.Architecture);
|
|
157
160
|
|
|
158
161
|
// @ts-ignore
|
|
159
162
|
return `${p.name}_${p.version}_${arch}${this.constructor.fileNameExtension}`;
|
package/src/output/packager.mjs
CHANGED
|
@@ -301,6 +301,21 @@ export const dependency_type = {
|
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
+
export const architectureType = {
|
|
305
|
+
name: "dependency",
|
|
306
|
+
primitive: true,
|
|
307
|
+
|
|
308
|
+
toInternal: (value, attribute) => {
|
|
309
|
+
// console.log("architectureType toInternal", value);
|
|
310
|
+
return value;
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
toExternal: (value, attribute) => {
|
|
314
|
+
// console.log("architectureType toExternal", value);
|
|
315
|
+
return attribute.mapping[value] ?? value;
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
|
|
304
319
|
export const dependency_attribute_collection_writable = {
|
|
305
320
|
...string_collection_attribute_writable,
|
|
306
321
|
type: dependency_type,
|
package/src/util.mjs
CHANGED
|
@@ -182,7 +182,7 @@ export function fieldProvider(properties, attributes) {
|
|
|
182
182
|
}
|
|
183
183
|
} else {
|
|
184
184
|
const attribute = attributes[k];
|
|
185
|
-
yield [k, av(attribute, toExternal(properties[k]
|
|
185
|
+
yield [k, av(attribute, toExternal(properties[k] ?? v, attribute))];
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
188
|
}
|